M
- the data type used by this seriespublic class ScatterSeries<M> extends Series<M>
ScatterSeries series = new ScatterSeries(); series.setYAxisPosition(Position.LEFT); series.setYField(dataAccess.data1()); Sprite marker = Primitives.cross(0, 0, 8); marker.setFill(RGB.GREEN); series.setMarkerConfig(marker); chart.addSeries(series);First the series is created with its associated data type. The y-axis position is set to tell the series the scale of the displayed axis. Otherwise the series will use its own internal scale. Next the value provider field is set, which provides the value of each point. A sprite is added that determines the representation of each point in the scatter. Finally the series is added to the chart where it will be displayed.
Series.LabelPosition
Constructor and Description |
---|
ScatterSeries()
Creates a scatter
Series . |
Modifier and Type | Method and Description |
---|---|
void |
calculateBounds() |
void |
drawSeries()
Draws the series for the current chart.
|
Sprite |
getMarkerConfig()
Returns the marker configuration.
|
double |
getSelectionTolerance()
Returns the selection tolerance of markers.
|
String |
getTitle()
Returns the series title used in the legend.
|
Chart.Position |
getXAxisPosition()
Returns the x axis position of the series.
|
Chart.Position |
getYAxisPosition()
Returns the y axis position of the series.
|
ValueProvider<? super M,? extends Number> |
getYField()
Returns the
ValueProvider used for the y axis of the series. |
void |
hide(int yFieldIndex)
Hides the given y field index from the series.
|
void |
highlight(int yFieldIndex)
Highlights the series at the given series index.
|
void |
highlightAll(int index)
Highlights all of the items in the series.
|
void |
setLegendTitle(String title)
Set the series title used in the legend.
|
void |
setMarkerConfig(Sprite markerConfig)
Sets the marker configuration.
|
void |
setSelectionTolerance(double selectionTolerance)
Sets the selection tolerance of markers.
|
void |
setXAxisPosition(Chart.Position xAxisPosition)
Sets the position of the x axis on the chart to be used by the series.
|
void |
setYAxisPosition(Chart.Position yAxisPosition)
Sets the position of the y axis on the chart to be used by the series.
|
void |
setYField(ValueProvider<? super M,? extends Number> yField)
Sets the
ValueProvider used for the y axis of the series. |
void |
show(int yFieldIndex)
Shows the given y field index from the series.
|
void |
unHighlight(int yFieldIndex)
Removes highlighting from the given series index.
|
void |
unHighlightAll(int index)
UnHighlights all items in the series.
|
boolean |
visibleInLegend(int index)
Returns whether or not the given series index is visible in legend.
|
addSeriesHandler, addSeriesItemOutHandler, addSeriesItemOverHandler, addSeriesItemUpHandler, addSeriesSelectionHandler, calculateBBox, clear, getBBox, getChart, getGutters, getHighlighter, getLabelConfig, getLegendNames, getLegendTitles, getRenderer, getShadowRenderer, getStroke, getStrokeWidth, getToolTip, getToolTipConfig, getValueProviderName, getXField, hideToolTip, highlightedState, isHighlighting, isShownInLegend, onMouseDown, onMouseMove, onMouseOut, onMouseUp, removeToolTip, setChart, setHighlighter, setHighlighting, setLabelConfig, setRenderer, setShadowRenderer, setShownInLegend, setStroke, setStrokeWidth, setToolTipConfig, setXField
public ScatterSeries()
Series
.public void calculateBounds()
public void drawSeries()
Series
drawSeries
in class Series<M>
public Sprite getMarkerConfig()
public double getSelectionTolerance()
public String getTitle()
public Chart.Position getXAxisPosition()
public Chart.Position getYAxisPosition()
public ValueProvider<? super M,? extends Number> getYField()
ValueProvider
used for the y axis of the series.public void hide(int yFieldIndex)
Series
public void highlight(int yFieldIndex)
Series
public void highlightAll(int index)
Series
highlightAll
in class Series<M>
index
- the index of the seriespublic void setLegendTitle(String title)
title
- the series title used in the legendpublic void setMarkerConfig(Sprite markerConfig)
markerConfig
- the marker configurationpublic void setSelectionTolerance(double selectionTolerance)
selectionTolerance
- the selection tolerance of markerspublic void setXAxisPosition(Chart.Position xAxisPosition)
xAxisPosition
- the position of the x axis on the chart to be used by
the seriespublic void setYAxisPosition(Chart.Position yAxisPosition)
yAxisPosition
- the position of the y axis on the chart to be used by
the seriespublic void setYField(ValueProvider<? super M,? extends Number> yField)
ValueProvider
used for the y axis of the series.yField
- the value providerpublic void show(int yFieldIndex)
Series
public void unHighlight(int yFieldIndex)
Series
unHighlight
in class Series<M>
yFieldIndex
- the index to have its highlighting removedpublic void unHighlightAll(int index)
Series
unHighlightAll
in class Series<M>
index
- the index of the seriespublic boolean visibleInLegend(int index)
Series
visibleInLegend
in class Series<M>
index
- the series index to determine visibleCopyright © 2015. All rights reserved.