Class DoughnutChart
Visualises a MultipleCategorySeries as concentric rings that share a
common centre (also known as a doughnut chart).
Each category in the dataset is drawn as a separate ring, making it suitable
for representing hierarchical proportions. Construct the chart with the
dataset and a DefaultRenderer and wrap it in a
com.codename1.charts.ChartComponent to place it on screen.
-
Field Summary
Fields inherited from class RoundChart
autoCalculateCenter, mCenterX, mCenterY, mRenderer, NO_VALUE, SHAPE_WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionDoughnutChart(MultipleCategorySeries dataset, DefaultRenderer renderer) Builds a new doughnut chart instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidThe graphical representation of the doughnut chart.voiddrawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint) The graphical representation of the legend shape.intgetLegendShapeWidth(int seriesIndex) Returns the legend shape width.Methods inherited from class RoundChart
drawTitle, getCenterX, getCenterY, getRenderer, isAutocalculateCenter, setAutocalculateCenter, setCenterX, setCenterYMethods inherited from class AbstractChart
calculateDrawPoints, drawBackground, drawLabel, drawLegend, drawPath, drawPath, drawString, getExceed, getLabel, getLegendSize, getSeriesAndPointForScreenCoordinate, isNullValue, isVertical
-
Constructor Details
-
DoughnutChart
Builds a new doughnut chart instance.
Parameters
-
dataset: the series dataset -
renderer: the series renderer
-
-
-
Method Details
-
draw
The graphical representation of the doughnut 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
-
-
getLegendShapeWidth
public int getLegendShapeWidth(int seriesIndex) Returns the legend shape width.
Parameters
seriesIndex: the series index
Returns
the legend shape width
- Overrides:
getLegendShapeWidthin classRoundChart
-
drawLegendShape
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint) The graphical representation of the legend shape.
Parameters
-
canvas: the canvas to paint to -
renderer: the series renderer -
x: the x value of the point the shape should be drawn at -
y: the y value of the point the shape should be drawn at -
seriesIndex: the series index -
paint: the paint to be used for drawing
- Overrides:
drawLegendShapein classRoundChart
-
-