public class Marker extends AbstractMarker
Series.addMarker
method - a typical use would be to highlight points on a LineSeries
, like so:
LineSeries series = new LineSeries("Data"); for (int i=0;i<data.length;i++) { series.set(data.x(), data.y()); Marker marker = new Marker("diamond", 15); marker.setStyle(style); series.addMarker(marker, data.x(), data.y()); }Markers can also be added to the Key using the
addCustom
method, or
a MarkerAxis
can be used to draw markers directly onto an axis.
The Graph Library is supplied with several predefined markers, including
square | A square |
---|---|
diamond | A diamond-shape |
circle | A circle |
star | A five-pointed star |
plus | A plus-sign |
cross | An "x" or diagonal cross |
flag.XX
can be used to display the national flag for
the specified country. "XX" is the two letter country code, eg. "US", "NZ", "CA", "DE"
(the United Kingdom uses "UK"). Additionally flag.EU
can be used as well.Series.addMarker
,
Key.addCustom
,
MarkerAxis
Modifier and Type | Field and Description |
---|---|
protected org.faceless.graph2.Point |
centroid |
box, matrix
Constructor and Description |
---|
Marker(String type,
double size)
Create a new Marker.
|
Modifier and Type | Method and Description |
---|---|
void |
setRotate(double rotate)
Set the rotation of this marker around its center, in degrees clockwise
|
void |
setStyle(Style style)
Set the style of this marker.
|
String |
toString() |
setName
public Marker(String type, double size)
ResourceBundle
representing the shape of the marker. See this
classes API docs for more information.type
- the type of Markersize
- the size of the marker in pixels, points or whatever the native unit of your Output
class ispublic void setRotate(double rotate)
rotate
- how far to rotate the marker. The default is 0.public void setStyle(Style style)
style
- the style to draw the marker inCopyright © 2001-2016 Big Faceless Organization