M
- data type used by this seriespublic class PieSeries<M> extends AbstractPieSeries<M>
Creates a Pie Chart. A Pie Chart is a useful visualization technique to display quantitative information for different categories that also have a meaning as a whole.
Here is an example pie configuration:
PieSeries<Data> series = new PieSeries<Data>();
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
angleField, center, donut, margin, radius
colors
bbox, chart, handlerManager, highlighter, highlighting, labelConfig, labels, lastDisplayedTooltipIndex, lastHighlighted, legendNames, legendTitles, renderer, shadowAttributes, shadowed, shadowGroups, shadowRenderer, shownInLegend, sprites, stroke, strokeWidth, toolTip, toolTipConfig, xField
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.
|
protected int |
getIndex(PrecisePoint point)
Returns the series index from the given point.
|
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.
|
protected ValueProvider<? super M,? extends Number> |
getValueProvider(int index)
Returns the value at the given series index.
|
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.
|
calculateSegment, createSegmentAnimator, getAngleField, getDonut, getLegendLabelProvider, getLegendTitles, getStoreIndex, setAngleField, setDonut, setLegendLabelProvider, setLegendValueProvider
addColor, addColor, getColor, getColors, removeColor, removeColor, setColor
addSeriesHandler, addSeriesItemOutHandler, addSeriesItemOverHandler, addSeriesItemUpHandler, addSeriesSelectionHandler, calculateBBox, ensureHandlers, getBBox, getChart, getGutters, getHighlighter, getLabelConfig, getLegendNames, getPointFromCommand, getRenderer, getShadowRenderer, getStroke, getStrokeWidth, getToolTip, getToolTipConfig, getValueProviderName, getXField, hideAllOtherSeriesTooltips, hideShadows, hideToolTip, highlightedState, isHighlighting, isShownInLegend, onMouseDown, onMouseOut, onMouseUp, removeToolTip, setChart, setHighlighter, setHighlighting, setLabelConfig, setLabelContrast, setLabelText, setRenderer, setShadowRenderer, setShownInLegend, setStroke, setStrokeWidth, setToolTipConfig, setXField, showTooltip
public void addLengthField(ValueProvider<? super M,? extends Number> lengthField)
ValueProvider
that represents the radius of a pie slice.lengthField
- the value providerpublic void clear()
Series
public void drawSeries()
Series
drawSeries
in class Series<M>
public ArrayList<ValueProvider<? super M,? extends Number>> getLengthFields()
public double getPopOutMargin()
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 int onMouseMove(PrecisePoint point, Event event)
Series
onMouseMove
in class Series<M>
point
- the point moused overevent
- the event being handledpublic void setPopOutMargin(double popOutMargin)
popOutMargin
- the margin that the slices pop outpublic 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 visibleprotected int getIndex(PrecisePoint point)
Series
protected ValueProvider<? super M,? extends Number> getValueProvider(int index)
Series
getValueProvider
in class Series<M>
index
- the series indexCopyright © 2018. All rights reserved.