public abstract class RoundChart

  1. Object
  2. AbstractChart
  3. 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 = 10The legend shape width.
protected static final int NO_VALUE = 2147483647A no value constant.
protected CategorySeries mDatasetThe series dataset.
protected DefaultRenderer mRendererThe series renderer.
protected int mCenterXThe chart center X axis.
protected int mCenterYThe 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 = 10
The legend shape width.

NO_VALUE

protected static final int NO_VALUE = 2147483647
A no value constant.

mDataset

protected CategorySeries mDataset
The series dataset.

mRenderer

protected DefaultRenderer mRenderer
The series renderer.

mCenterX

protected int mCenterX
The chart center X axis.

mCenterY

protected int mCenterY
The chart center y axis.

autoCalculateCenter

protected boolean autoCalculateCenter

Constructor details

RoundChart

public RoundChart(CategorySeries dataset, DefaultRenderer renderer)
Round chart.

Parameters

dataset CategorySeries
the series dataset
renderer DefaultRenderer
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

canvas Canvas
the canvas to paint to
x int
the top left x value of the view to draw to
y int
the top left y value of the view to draw to
width int
the width of the view to draw to
paint Paint
the paint

getLegendShapeWidth

public int getLegendShapeWidth(int seriesIndex)
Returns the legend shape width.

Parameters

seriesIndex int
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

canvas Canvas
the canvas to paint to
renderer SimpleSeriesRenderer
the series renderer
x float
the x value of the point the shape should be drawn at
y float
the y value of the point the shape should be drawn at
seriesIndex int
the series index
paint Paint
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

centerX int
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

centerY int
center on Y axis

isAutocalculateCenter

public boolean isAutocalculateCenter()

setAutocalculateCenter

public void setAutocalculateCenter(boolean a)