Class PieRenderer
-
- All Implemented Interfaces:
public class PieRenderer extends SeriesRenderer<PieChart, Segment, SegmentFormatter>
Basic renderer for drawing pie charts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumPieRenderer.DonutMode
-
Field Summary
Fields Modifier and Type Field Description public floatstartDegspublic floatextentDegspublic PlotTypeplot
-
Constructor Summary
Constructors Constructor Description PieRenderer(PieChart plot)
-
Method Summary
Modifier and Type Method Description floatgetStartDegs()voidsetStartDegs(float degs)Set the starting point in degrees from which series will be drawn in order. floatgetExtentDegs()voidsetExtentDegs(float degs)Set the size in degrees of the pie chart, extending from the startDegs. floatgetRadius(@NonNull() RectF rect)voidonRender(@NonNull() Canvas canvas, @NonNull() RectF plotArea, @NonNull() Segment series, @NonNull() SegmentFormatter formatter, @NonNull() RenderStack stack)voidsetDonutSize(float size, @NonNull() PieRenderer.DonutMode mode)Set the size of the pie's empty inner space. SegmentgetContainingSegment(@NonNull() PointF point)Retrieve the segment containing the specified point. -
Methods inherited from class com.androidplot.ui.SeriesRenderer
drawSeriesLegendIcon, getFormatter, getPlot, getSeriesAndFormatterList, getSeriesList, render, setPlot -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PieRenderer
PieRenderer(PieChart plot)
-
-
Method Detail
-
getStartDegs
float getStartDegs()
-
setStartDegs
void setStartDegs(float degs)
Set the starting point in degrees from which series will be drawn in order. The input value must be within the range 0 - 360.
-
getExtentDegs
float getExtentDegs()
-
setExtentDegs
void setExtentDegs(float degs)
Set the size in degrees of the pie chart, extending from the startDegs. The input value must be within the range 0 - 360. An input value would represent 100% of the pie as a half circle while an input value of 360 would be a full circle.
-
onRender
void onRender(@NonNull() Canvas canvas, @NonNull() RectF plotArea, @NonNull() Segment series, @NonNull() SegmentFormatter formatter, @NonNull() RenderStack stack)
- Parameters:
series- The series to be renderedformatter- The getFormatter that should be used to render the seriesstack- Ordered list of all series being renderered.
-
setDonutSize
void setDonutSize(float size, @NonNull() PieRenderer.DonutMode mode)
Set the size of the pie's empty inner space. May be specified as either pixels or as a percentage. If using PIXELS, the best practice is to specify values in dp using dpToPix. If using PERCENT the value must be within the range 0 - 1. The value being set corresponds to the size of the donut radius relative to the pie's total radius.
-
getContainingSegment
@Nullable() Segment getContainingSegment(@NonNull() PointF point)
Retrieve the segment containing the specified point. This current implementation only matches against angle; clicks outside of the pie/donut inner/outer boundaries will still trigger a match on the segment whose beginning and ending angle contains the angle of the line drawn between the pie chart's center point and the clicked point.
- Parameters:
point- The clicked point- Returns:
Segment containing the clicked point.
-
-
-
-