Class PieChart
Shows each value from a CategorySeries as a slice of a circle.
Combine this chart with a DefaultRenderer to control colours, labels
and gradients. The resulting PieChart can be embedded in a form via a
com.codename1.charts.ChartComponent.
-
Field Summary
Fields inherited from class RoundChart
autoCalculateCenter, mCenterX, mCenterY, mDataset, mRenderer, NO_VALUE, SHAPE_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionPieChart(CategorySeries dataset, DefaultRenderer renderer) Builds a new pie chart instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe graphical representation of the pie chart.getSegmentShape(int pointIndex) Gets the shape of a pie segment given its point index.getSeriesAndPointForScreenCoordinate(Point screenPoint) Given screen coordinates, returns the series and point indexes of a chart element.Methods inherited from class RoundChart
drawLegendShape, drawTitle, getCenterX, getCenterY, getLegendShapeWidth, getRenderer, isAutocalculateCenter, setAutocalculateCenter, setCenterX, setCenterYMethods inherited from class AbstractChart
calculateDrawPoints, drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, isNullValue, isVertical
-
Constructor Details
-
PieChart
Builds a new pie chart instance.
Parameters
-
dataset: the series dataset -
renderer: the series renderer
-
-
-
Method Details
-
draw
The graphical representation of the pie chart.
Parameters
-
canvas: the canvas to paint to -
x: the top left x value of the view to draw to -
y: the top left y value of the view to draw to -
width: the width of the view to draw to -
height: the height of the view to draw to -
paint: the paint
- Specified by:
drawin classAbstractChart
-
-
getSeriesAndPointForScreenCoordinate
Description copied from class:AbstractChartGiven screen coordinates, returns the series and point indexes of a chart element. If there is no chart element (line, point, bar, etc) at those coordinates, null is returned.
Parameters
screenPoint
Returns
the series and point indexes
- Overrides:
getSeriesAndPointForScreenCoordinatein classAbstractChart
-
getSegmentShape
Gets the shape of a pie segment given its point index.
Parameters
pointIndex: The point index representing the pie segment.
Returns
A shape of the outline of the segment.
-