M - data type used by this seriespublic class PieSeries<M> extends AbstractPieSeries<M>
PieSeries series = new PieSeries();
series.setAngleField(dataAccess.data1());
series.addColor(slice1);
series.addColor(slice2);
series.addColor(slice3);
series.addColor(slice4);
series.addColor(slice5);
series.addColor(slice6);
chart.addSeries(series);
First the series is created with its associated data type. Next the value
provider field is set, which provides the value of the pie slices. A color is
also added to represent each slice in the pie. Finally the series is added to
the chart where it will be displayed.Series.LabelPosition| Constructor and Description |
|---|
PieSeries()
Creates a pie series.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLengthField(ValueProvider<? super M,? extends Number> lengthField)
Adds a
ValueProvider that represents the radius of a pie slice. |
void |
clear()
Removes all the sprites of the series from the surface.
|
void |
drawSeries()
Draws the series for the current chart.
|
ArrayList<ValueProvider<? super M,? extends Number>> |
getLengthFields()
Returns the list of value providers that represent the radius of pie
slices.
|
double |
getPopOutMargin()
Returns the margin that the slices pop out.
|
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.
|
int |
onMouseMove(PrecisePoint point,
Event event)
Method used when the series is moused over.
|
void |
setPopOutMargin(double popOutMargin)
Sets the margin that the slices pop out.
|
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.
|
getAngleField, getDonut, getLegendLabelProvider, getLegendTitles, setAngleField, setDonut, setLegendLabelProvider, setLegendValueProvideraddColor, addColor, getColor, getColors, removeColor, removeColor, setColoraddSeriesHandler, addSeriesItemOutHandler, addSeriesItemOverHandler, addSeriesItemUpHandler, addSeriesSelectionHandler, calculateBBox, getBBox, getChart, getGutters, getHighlighter, getLabelConfig, getLegendNames, getRenderer, getShadowRenderer, getStroke, getStrokeWidth, getToolTip, getToolTipConfig, getValueProviderName, getXField, hideToolTip, highlightedState, isHighlighting, isShownInLegend, onMouseDown, onMouseOut, onMouseUp, removeToolTip, setChart, setHighlighter, setHighlighting, setLabelConfig, setRenderer, setShadowRenderer, setShownInLegend, setStroke, setStrokeWidth, setToolTipConfig, setXFieldpublic void addLengthField(ValueProvider<? super M,? extends Number> lengthField)
ValueProvider that represents the radius of a pie slice.lengthField - the value providerpublic void clear()
Seriespublic void drawSeries()
SeriesdrawSeries in class Series<M>public ArrayList<ValueProvider<? super M,? extends Number>> getLengthFields()
public double getPopOutMargin()
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 int onMouseMove(PrecisePoint point, Event event)
SeriesonMouseMove in class Series<M>point - the point moused overpublic void setPopOutMargin(double popOutMargin)
popOutMargin - the margin that the slices pop outpublic 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.