public abstract class RoundChart
- Object
- AbstractChart
- RoundChart
Known subtypesDialChart, DoughnutChart, PieChart, RadarChart
Base class for charts that render circular data representations such as pie charts, doughnut charts or gauges.
Subclasses operate on CategorySeries data and share common
functionality for drawing the chart title, legend entries and handling
layout. Developers typically work with concrete subclasses such as
PieChart or DoughnutChart directly.
Fields
protected static final int SHAPE_WIDTH = 10 | The legend shape width. |
protected static final int NO_VALUE = 2147483647 | A no value constant. |
protected CategorySeries mDataset | The series dataset. |
protected DefaultRenderer mRenderer | The series renderer. |
protected int mCenterX | The chart center X axis. |
protected int mCenterY | The chart center y axis. |
protected boolean autoCalculateCenter |
Constructors
public RoundChart(CategorySeries dataset, DefaultRenderer renderer) | Round chart. |
Methods
public void drawTitle(Canvas canvas, int x, int y, int width, Paint paint) | The graphical representation of the round chart title. |
public int getLegendShapeWidth(int seriesIndex) | Returns the legend shape width. |
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint) | The graphical representation of the legend shape. |
public DefaultRenderer getRenderer() | Returns the renderer. |
public int getCenterX() | Returns the center on X axis. |
public void setCenterX(int centerX) | Sets a new center on X axis. |
public int getCenterY() | Returns the center on Y axis. |
public void setCenterY(int centerY) | Sets a new center on Y axis. |
public boolean isAutocalculateCenter() | |
public void setAutocalculateCenter(boolean a) |
Inherited methods
Field details
SHAPE_WIDTH
protected static final int SHAPE_WIDTH = 10The legend shape width.
NO_VALUE
protected static final int NO_VALUE = 2147483647A no value constant.
mDataset
protected CategorySeries mDatasetThe series dataset.
mRenderer
protected DefaultRenderer mRendererThe series renderer.
mCenterX
protected int mCenterXThe chart center X axis.
mCenterY
protected int mCenterYThe chart center y axis.
autoCalculateCenter
protected boolean autoCalculateCenterConstructor details
RoundChart
public RoundChart(CategorySeries dataset, DefaultRenderer renderer)Round chart.
Parameters
datasetCategorySeries- the series dataset
rendererDefaultRenderer- the series renderer
Method details
drawTitle
public void drawTitle(Canvas canvas, int x, int y, int width, Paint paint)The graphical representation of the round chart title.
Parameters
canvasCanvas- the canvas to paint to
xint- the top left x value of the view to draw to
yint- the top left y value of the view to draw to
widthint- the width of the view to draw to
paintPaint- the paint
getLegendShapeWidth
public int getLegendShapeWidth(int seriesIndex)Returns the legend shape width.
Parameters
seriesIndexint- the series index
Returns
the legend shape width
drawLegendShape
public void drawLegendShape(Canvas canvas, SimpleSeriesRenderer renderer, float x, float y, int seriesIndex, Paint paint)The graphical representation of the legend shape.
Parameters
canvasCanvas- the canvas to paint to
rendererSimpleSeriesRenderer- the series renderer
xfloat- the x value of the point the shape should be drawn at
yfloat- the y value of the point the shape should be drawn at
seriesIndexint- the series index
paintPaint- the paint to be used for drawing
getRenderer
public DefaultRenderer getRenderer()Returns the renderer.
Returns
the renderer
getCenterX
public int getCenterX()Returns the center on X axis.
Returns
the center on X axis
setCenterX
public void setCenterX(int centerX)Sets a new center on X axis.
Parameters
centerXint- center on X axis
getCenterY
public int getCenterY()Returns the center on Y axis.
Returns
the center on Y axis
setCenterY
public void setCenterY(int centerY)Sets a new center on Y axis.
Parameters
centerYint- center on Y axis
isAutocalculateCenter
public boolean isAutocalculateCenter()setAutocalculateCenter
public void setAutocalculateCenter(boolean a)