public class PieSeries extends ChartSeries
ChartSeries
which is used in RadPieChartView
.
Each data items provided through PieSeries is visually represented by a pie slice. The angle
of each slice is calculated depending on the value of the data item that it represents
in a way that all slices together form a pie.Modifier and Type | Field and Description |
---|---|
static String |
ARC_STROKE_WIDTH_KEY |
static double |
DEFAULT_SELECTION_OFFSET |
SERIES_Z_INDEX
Constructor and Description |
---|
PieSeries()
Initializes a new instance of the
PieSeries class. |
Modifier and Type | Method and Description |
---|---|
ElementCollection<PieDataPoint> |
dataPoints()
Gets the data points that are visualized by this instance.
|
DataPointInfo |
findClosestPoint(Point location)
Finds the closest
DataPoint to the given location. |
AngleRange |
getAngleRange()
Gets the
AngleRange that is
used to visualize the data points in this instance. |
int |
getDataPointColor(int dataPointIndex) |
boolean |
getDisplayPercentage()
Gets a boolean value determining whether percentage is displayed in the slice label.
|
String |
getLabelFormat()
Gets the format that is applied to the percent value when creating labels for the
data points.
|
double |
getLabelOffset()
Gets the offset in pixels that is applied to the labels relative to the arc of the
data point.
|
DataPointBinding |
getNameBinding()
Gets a
DataPointBinding which is used to obtain a name for the data points
which will be displayed in the legend. |
RadPoint |
getPointLocation(PieDataPoint point) |
double |
getRadiusFactor()
Gets the value of the radius factor.
|
double |
getSelectedPointOffset() |
double |
getSliceOffset()
Gets the offset in pixels that is applied to the slices relative to the center of the pie.
|
List<SliceStyle> |
getSliceStyles()
Gets a
List of
SliceStyle objects
that define how the different slices in a pie will be visualized. |
DataPointBinding |
getValueBinding()
Gets the
DataPointBinding
object that defines the way the value of a data point is calculated
depending on the business object that it represents. |
DataPoint |
hitTestDataPoint(PointF touchLocation)
Determines if the provided point argument is on a data point.
|
PieSeriesModel |
model()
Gets the series model for this instance.
|
void |
setAngleRange(AngleRange value)
Sets the
AngleRange that is
used to visualize the data points in this instance. |
void |
setData(Iterable value)
Sets the items source of the series.
|
void |
setDisplayPercentage(boolean value)
Sets a boolean value determining whether percentage is displayed in the slice label.
|
void |
setLabelFormat(String value)
Sets a format that will be applied to the percent value when creating labels for the
data points.
|
void |
setLabelOffset(double value)
Gets the offset in pixels that is applied to the labels relative to the arc of the
data point.
|
void |
setNameBinding(DataPointBinding value) |
void |
setRadiusFactor(double value)
Gets the value of the radius factor.
|
void |
setSelectedPointOffset(double value) |
void |
setSliceOffset(double value)
Gets the offset in pixels that is applied to the slices relative to the center of the pie.
|
void |
setSliceStyles(List<SliceStyle> value)
Sets a
List of
SliceStyle objects
that define how the different slices in a pie will be visualized. |
void |
setValueBinding(DataPointBinding value)
Sets a
DataPointBinding
object that defines the way the value of a data point will be calculated
depending on the values of the business object that it will represent. |
addPropertyChangedListener, dataSource, getClipToPlotArea, getData, getDistanceToPoint, getIsSelected, getIsVisibleInLegend, getLabelFillColor, getLabelFont, getLabelFontStyle, getLabelMargin, getLabelRenderer, getLabelSize, getLabelStrokeColor, getLabelTextColor, getLabelValueToStringConverter, getPlotAreaSize, getSelectionMode, getShowLabels, hitTest, onBoundItemPropertyChanged, onDataBindingComplete, onDataPointIsSelectedChanged, onPointAdded, onPointRemoved, postRender, removePropertyChangedListener, render, setClipToPlotArea, setIsSelected, setIsVisibleInLegend, setLabelFillColor, setLabelFont, setLabelFontStyle, setLabelMargin, setLabelPadding, setLabelRenderer, setLabelSize, setLabelStrokeColor, setLabelTextColor, setLabelValueToStringConverter, setSelectionMode, setShowLabels
attach, detach, getCanApplyPalette, getChart, getCollectionIndex, getPalette, getZIndex, invalidatePalette, onPaletteInvalidated, onPaletteUpdated, requestLayout, requestRender, setZIndex, updatePalette
getPaletteFamily, getPaletteFamilyCore, isLoaded, isPaletteApplied, isVisible, measureContent, paletteFamily, refreshNode, setCanApplyPalette, setPaletteFamily, setVisible, setVisible
getValue, resetPropertyValue, setValue, setValue
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCollectionIndex, invalidatePalette, measureContent, refreshNode
public static final String ARC_STROKE_WIDTH_KEY
public static final double DEFAULT_SELECTION_OFFSET
public PieSeries()
PieSeries
class.public ElementCollection<PieDataPoint> dataPoints()
RadPieChartView
can be passed
in one of the following ways: manually or with data binding. With the manual approach
is selected then the dataPoints collection can be used to manually add
new instances of type PieDataPoint
which represent the data. The other option is to set a collection of data items
through the setData
method.to provide the data through data binding
public void setData(Iterable value)
ChartSeries
setData
in class ChartSeries
value
- The new items source of the series.public DataPointBinding getValueBinding()
DataPointBinding
object that defines the way the value of a data point is calculated
depending on the business object that it represents.public void setValueBinding(DataPointBinding value)
DataPointBinding
object that defines the way the value of a data point will be calculated
depending on the values of the business object that it will represent.value
- the value binding definitionpublic void setNameBinding(DataPointBinding value)
public DataPointBinding getNameBinding()
DataPointBinding
which is used to obtain a name for the data points
which will be displayed in the legend.public List<SliceStyle> getSliceStyles()
List
of
SliceStyle
objects
that define how the different slices in a pie will be visualized.SliceStyle
public void setSliceStyles(List<SliceStyle> value)
List
of
SliceStyle
objects
that define how the different slices in a pie will be visualized.value
- a collection of slice stylesSliceStyle
public double getRadiusFactor()
RadPieChartView
calculates the necessary radius in order to consume the whole
available space. When this value is calculated, the radius factor is applied.
The default value is 1.0
. This means that the radius will not be changed.
If the value is less than 1.0
, the radius will be decreased, so the
whole available space will not be taken.
If the value is more than 1.0
, the radius will be increased, so the
chart will not entirely fit in the available space.public void setRadiusFactor(double value)
RadPieChartView
calculates the necessary radius in order to consume the whole
available space. When this value is calculated, the radius factor is applied.
The default value is 1.0
. This means that the radius will not be changed.
If the value is less than 1.0
, the radius will be decreased, so the
whole available space will not be taken.
If the value is more than 1.0
, the radius will be increased, so the
chart will not entirely fit in the available space.value
- the radius factor, the value must be positivepublic String getLabelFormat()
%d %%
.getLabelFormat
in class ChartSeries
public void setLabelFormat(String value)
%d %%
.setLabelFormat
in class ChartSeries
value
- the format of the labelspublic double getLabelOffset()
10.0
.
The value is negative when the label is positioned out of the pie.public void setLabelOffset(double value)
10.0
.
If the value is negative, the label will be positioned out of the pie.value
- the offset of the labelspublic double getSliceOffset()
2.0
.
The value can be 0.0
, if the slices will have no empty space among them.
The value can be negative, if the slices are overlapping.public void setSliceOffset(double value)
2.0
.
If the value is 0.0
, the slices will have no empty space among them.
If the value is negative, the slices be overlapping.value
- the offset of the slicespublic AngleRange getAngleRange()
AngleRange
that is
used to visualize the data points in this instance.
The default value is a range which is starting at 0
and
is 360
degrees large.public void setAngleRange(AngleRange value)
AngleRange
that is
used to visualize the data points in this instance.
The default value is a range which is starting at 0
and
is 360
degrees large.public PieSeriesModel model()
ChartSeries
model
in class ChartSeries
ChartSeriesModel
.public DataPointInfo findClosestPoint(Point location)
ChartSeries
DataPoint
to the given location.findClosestPoint
in class ChartSeries
location
- The location.DataPoint
to the given location.public int getDataPointColor(int dataPointIndex)
public DataPoint hitTestDataPoint(PointF touchLocation)
ChartSeries
hitTestDataPoint
in class ChartSeries
touchLocation
- The point to test.public boolean getDisplayPercentage()
true
if percentage will be displayed, false
otherwise.public void setDisplayPercentage(boolean value)
value
- true
if percentage will be displayed, false
otherwise.public void setSelectedPointOffset(double value)
public double getSelectedPointOffset()
public RadPoint getPointLocation(PieDataPoint point)