Package org.faceless.graph2
Class Marker
- java.lang.Object
-
- org.faceless.graph2.AbstractMarker
-
- org.faceless.graph2.Marker
-
- All Implemented Interfaces:
Cloneable
public class Marker extends AbstractMarker
A Marker is simply a point marked on the graph with a symbol like a star or a circle. Markers can be placed anywhere on a series using theSeries.addMarker
method - a typical use would be to highlight points on aLineSeries
, 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 theaddCustom
method, or aMarkerAxis
can be used to draw markers directly onto an axis. The Graph Library is supplied with several predefined markers, includingsquare 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"). Additionallyflag.EU
can be used as well.- See Also:
Series.addMarker
,Key.addCustom
,MarkerAxis
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setRotate(double rotate)
Set the rotation of this marker around its center, in degrees clockwisevoid
setStyle(Style style)
Set the style of this marker.String
toString()
-
Methods inherited from class org.faceless.graph2.AbstractMarker
setName
-
-
-
-
Constructor Detail
-
Marker
public Marker(String type, double size)
Create a new Marker. The shape of the marker is defined by it's type, which is name of aResourceBundle
representing the shape of the marker. See this classes API docs for more information.- Parameters:
type
- the type of Markersize
- the size of the marker in pixels, points or whatever the native unit of yourOutput
class is
-
-
Method Detail
-
setRotate
public void setRotate(double rotate)
Set the rotation of this marker around its center, in degrees clockwise- Parameters:
rotate
- how far to rotate the marker. The default is 0.
-
setStyle
public void setStyle(Style style)
Set the style of this marker. For uncolored markers like "square", "circle" etc., this method may be called to change the color of a specific marker. If not set, the color defaults to the series color. For colored markers like flags, this method can optionally set a border color around the marker, but the main color is ignored.- Parameters:
style
- the style to draw the marker in
-
-