M - the data type used by this seriespublic class AreaSeries<M> extends MultipleColorSeries<M>
AreaSeries series = new AreaSeries();
series.setYAxisPosition(Position.LEFT);
series.addYField(dataAccess.data1());
series.addYField(dataAccess.data2());
series.addYField(dataAccess.data3());
series.addYField(dataAccess.data4());
series.addYField(dataAccess.data5());
series.addYField(dataAccess.data6());
series.addYField(dataAccess.data7());
series.addColor(new RGB(148, 174, 10));
series.addColor(new RGB(17, 95, 166));
series.addColor(new RGB(166, 17, 32));
series.addColor(new RGB(255, 136, 9));
series.addColor(new RGB(255, 209, 62));
series.addColor(new RGB(166, 17, 135));
series.addColor(new RGB(36, 173, 154));
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 fields
are added, which represent each layer of the area. A color is also added to
represent each field in the area. Finally the series is added to the chart
where it will be displayed.Series.LabelPosition| Constructor and Description |
|---|
AreaSeries()
Creates an area
Series. |
| Modifier and Type | Method and Description |
|---|---|
void |
addYField(int index,
ValueProvider<? super M,? extends Number> yField)
Adds a data field for the y axis of the series.
|
void |
addYField(ValueProvider<? super M,? extends Number> yField)
Adds a data field for the y axis of the series.
|
void |
drawSeries()
Draws the series for the current chart.
|
Set<Integer> |
getExcluded()
Returns the fields that have been hidden from the series using
hide(int). |
PathSprite |
getHighlightLineConfig()
Returns the configuration sprite for the highlighting line.
|
ArrayList<String> |
getLegendTitles()
Returns the list of titles used in the legend of the series.
|
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(int index)
Returns the value provider for the y-axis of the series at the given index.
|
List<ValueProvider<? super M,? extends Number>> |
getYFields()
Returns the list of value providers 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.
|
ValueProvider<? super M,? extends Number> |
removeYField(int index)
Removes a data field for the y axis of the series.
|
boolean |
removeYField(ValueProvider<? super M,? extends Number> yField)
Removes a data field for the y axis of the series.
|
void |
setHighlightLineConfig(PathSprite highlightLineConfig)
Sets the configuration sprite for the highlighting line.
|
void |
setLegendTitles(List<String> legendTitles)
Sets the list of labels used by the legend.
|
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 |
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.
|
addColor, addColor, getColor, getColors, removeColor, removeColor, setColoraddSeriesHandler, addSeriesItemOutHandler, addSeriesItemOverHandler, addSeriesItemUpHandler, addSeriesSelectionHandler, calculateBBox, clear, getBBox, getChart, getGutters, getHighlighter, getLabelConfig, getLegendNames, 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, setXFieldpublic AreaSeries()
Series.public void addYField(int index,
ValueProvider<? super M,? extends Number> yField)
index - the index to have the yField insertedyField - the value provider for the data on the y axispublic void addYField(ValueProvider<? super M,? extends Number> yField)
yField - the value provider for the data on the y axispublic void drawSeries()
SeriesdrawSeries in class Series<M>public Set<Integer> getExcluded()
hide(int).public PathSprite getHighlightLineConfig()
public ArrayList<String> getLegendTitles()
SeriesgetLegendTitles in class Series<M>public Chart.Position getXAxisPosition()
public Chart.Position getYAxisPosition()
public ValueProvider<? super M,? extends Number> getYField(int index)
index - the index of the value providerpublic List<ValueProvider<? super M,? extends Number>> getYFields()
public void hide(int yFieldIndex)
Seriespublic void highlight(int yFieldIndex)
Seriespublic void highlightAll(int index)
SerieshighlightAll in class Series<M>index - the index of the seriespublic ValueProvider<? super M,? extends Number> removeYField(int index)
index - the index of the data field to removepublic boolean removeYField(ValueProvider<? super M,? extends Number> yField)
yField - the value provider for the data on the y axispublic void setHighlightLineConfig(PathSprite highlightLineConfig)
highlightLineConfig - the configuration sprite for the highlighting
linepublic void setLegendTitles(List<String> legendTitles)
legendTitles - the list of labelspublic 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 show(int yFieldIndex)
Seriespublic void unHighlight(int yFieldIndex)
SeriesunHighlight in class Series<M>yFieldIndex - the index to have its highlighting removedpublic void unHighlightAll(int index)
SeriesunHighlightAll in class Series<M>index - the index of the seriespublic boolean visibleInLegend(int index)
SeriesvisibleInLegend in class Series<M>index - the series index to determine visibleCopyright © 2014. All Rights Reserved.