public class PieChartRenderer extends DataRenderer
| Modifier and Type | Field and Description |
|---|---|
protected android.graphics.Canvas |
mBitmapCanvas |
protected PieChart |
mChart |
protected java.lang.ref.WeakReference<android.graphics.Bitmap> |
mDrawBitmap
Bitmap for drawing the center hole
|
protected android.graphics.Path |
mDrawCenterTextPathBuffer |
protected android.graphics.RectF |
mDrawHighlightedRectF |
protected android.graphics.Paint |
mHolePaint
paint for the hole in the center of the pie chart and the transparent
circle
|
protected android.graphics.Paint |
mTransparentCirclePaint |
protected android.graphics.Paint |
mValueLinePaint |
mAnimator, mDrawPaint, mHighlightPaint, mRenderPaint, mValuePaintmViewPortHandler| Constructor and Description |
|---|
PieChartRenderer(PieChart chart,
ChartAnimator animator,
ViewPortHandler viewPortHandler) |
| Modifier and Type | Method and Description |
|---|---|
protected float |
calculateMinimumRadiusForSpacedSlice(MPPointF center,
float radius,
float angle,
float arcStartPointX,
float arcStartPointY,
float startAngle,
float sweepAngle) |
protected void |
drawCenterText(android.graphics.Canvas c)
draws the description text in the center of the pie chart makes most
sense when center-hole is enabled
|
void |
drawData(android.graphics.Canvas c)
Draws the actual data in form of lines, bars, ...
|
protected void |
drawDataSet(android.graphics.Canvas c,
IPieDataSet dataSet) |
protected void |
drawEntryLabel(android.graphics.Canvas c,
java.lang.String label,
float x,
float y)
Draws an entry label at the specified position.
|
void |
drawExtras(android.graphics.Canvas c)
Draws any kind of additional information (e.g.
|
void |
drawHighlighted(android.graphics.Canvas c,
Highlight[] indices)
Draws all highlight indicators for the values that are currently highlighted.
|
protected void |
drawHole(android.graphics.Canvas c)
draws the hole in the center of the chart and the transparent circle /
hole
|
protected void |
drawRoundedSlices(android.graphics.Canvas c)
This gives all pie-slices a rounded edge.
|
void |
drawValues(android.graphics.Canvas c)
Loops over all Entrys and draws their values.
|
android.text.TextPaint |
getPaintCenterText() |
android.graphics.Paint |
getPaintEntryLabels() |
android.graphics.Paint |
getPaintHole() |
android.graphics.Paint |
getPaintTransparentCircle() |
protected float |
getSliceSpace(IPieDataSet dataSet)
Calculates the sliceSpace to use based on visible values and their size compared to the set sliceSpace.
|
void |
initBuffers()
Initializes the buffers used for rendering with a new size.
|
void |
releaseBitmap()
Releases the drawing bitmap.
|
applyValueTextStyle, drawValue, getPaintHighlight, getPaintRender, getPaintValues, isDrawingValuesAllowedprotected PieChart mChart
protected android.graphics.Paint mHolePaint
protected android.graphics.Paint mTransparentCirclePaint
protected android.graphics.Paint mValueLinePaint
protected java.lang.ref.WeakReference<android.graphics.Bitmap> mDrawBitmap
protected android.graphics.Canvas mBitmapCanvas
protected android.graphics.Path mDrawCenterTextPathBuffer
protected android.graphics.RectF mDrawHighlightedRectF
public PieChartRenderer(PieChart chart, ChartAnimator animator, ViewPortHandler viewPortHandler)
public android.graphics.Paint getPaintHole()
public android.graphics.Paint getPaintTransparentCircle()
public android.text.TextPaint getPaintCenterText()
public android.graphics.Paint getPaintEntryLabels()
public void initBuffers()
DataRendererinitBuffers in class DataRendererpublic void drawData(android.graphics.Canvas c)
DataRendererdrawData in class DataRendererprotected float calculateMinimumRadiusForSpacedSlice(MPPointF center, float radius, float angle, float arcStartPointX, float arcStartPointY, float startAngle, float sweepAngle)
protected float getSliceSpace(IPieDataSet dataSet)
dataSet - protected void drawDataSet(android.graphics.Canvas c,
IPieDataSet dataSet)
public void drawValues(android.graphics.Canvas c)
DataRendererdrawValues in class DataRendererprotected void drawEntryLabel(android.graphics.Canvas c,
java.lang.String label,
float x,
float y)
c - label - x - y - public void drawExtras(android.graphics.Canvas c)
DataRendererdrawExtras in class DataRendererprotected void drawHole(android.graphics.Canvas c)
protected void drawCenterText(android.graphics.Canvas c)
public void drawHighlighted(android.graphics.Canvas c,
Highlight[] indices)
DataRendererdrawHighlighted in class DataRendererindices - the highlighted valuesprotected void drawRoundedSlices(android.graphics.Canvas c)
c - public void releaseBitmap()
LineChart.onDetachedFromWindow().