PieChartPainter class

Inheritance

Constructors

PieChartPainter(PieData? data, Animator? animator, ViewPortHandler? viewPortHandler, double? maxHighlightDistance, bool highLightPerTapEnabled, double extraLeftOffset, double extraTopOffset, double extraRightOffset, double extraBottomOffset, IMarker? marker, Description? desc, bool drawMarkers, Color? infoBgColor, TextPainter? infoPainter, TextPainter? descPainter, XAxis? xAxis, Legend? legend, LegendRenderer? legendRenderer, DataRendererSettingFunction? rendererSettingFunction, OnChartValueSelectedListener? selectedListener, double rotationAngle, double? rawRotationAngle, bool rotateEnabled, double minOffset, bool drawEntryLabels, bool drawHole, bool drawSlicesUnderHole, bool usePercentValues, bool drawRoundedSlices, String centerText, double centerTextOffsetX, double centerTextOffsetY, TypeFace? entryLabelTypeface, TypeFace? centerTextTypeface, double holeRadiusPercent, double transparentCircleRadiusPercent, bool drawCenterText, double centerTextRadiusPercent, double maxAngle, double minAngleForSlices, Color? backgroundColor, Color holeColor, Color? centerTextColor, double? centerTextSize)

Properties

animator Animator?
no setterinherited
centerTextColor Color?
no setter
centerTextSize double?
no setter
centerTextTypeface TypeFace?
no setter
extraBottomOffset double
no setterinherited
extraLeftOffset double
no setterinherited
extraRightOffset double
no setterinherited
extraTopOffset double
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
highlighter IHighlighter?
getter/setter pairinherited
highLightPerTapEnabled bool
no setterinherited
indicesToHighlight List<Highlight>?
no setterinherited
isDrawMarkers bool
no setterinherited
legend Legend?
no setterinherited
legendRenderer LegendRenderer?
no setterinherited
marker IMarker?
no setterinherited
renderer DataRenderer?
//////////////////////////////////////////////// object responsible for rendering the data
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsBuilder SemanticsBuilderCallback?
Returns a function that builds semantic information for the picture drawn by this painter.
no setterinherited
size Size?
no setterinherited
viewPortHandler ViewPortHandler?
no setterinherited
xAxis XAxis?
no setterinherited

Methods

addListener(VoidCallback listener) → void
Register a closure to be notified when it is time to repaint.
inherited
calcAngle1(double value) double
calculates the needed angle for a given value
calcAngle2(double value, double yValueSum) double
calculates the needed angle for a given value
calcAngles() → void
calculates the needed angles for the chart slices
calcMinMax() → void
Calculates the y-min and y-max value and the y-delta and x-delta value
override
calculateOffsets() → void
Calculates the offsets of the chart to the border depending on the position of an eventual legend or depending on the length of the y-axis and x-axis labels and their position
override
distanceToCenter(double x, double y) double
Returns the distance of a certain point on the chart to the center of the chart.
inherited
drawDescription(Canvas c, Size size) → void
Draws the description text in the bottom right corner of the chart (per default)
inherited
drawMarkers(Canvas canvas) → void
draws all MarkerViews on the highlighted positions
inherited
getAbsoluteAngles() List<double?>
returns the absolute angles of the different chart slices (where the slices end)
getAngleForPoint(double x, double y) double
returns the angle relative to the chart center for the given point on the chart in degrees. The angle is always between 0 and 360°, 0° is NORTH, 90° is EAST, ...
inherited
getCenter(Size size) MPPointF
Returns a recyclable MPPointF instance. Returns the center point of the chart (the whole View) in pixels.
inherited
getCenterCircleBox() MPPointF
returns the center of the circlebox
getCenterOffsets() MPPointF
Returns a recyclable MPPointF instance. Returns the center of the chart taking offsets under consideration. (returns the center of the content rectangle)
inherited
getCenterText() String
returns the text that is drawn in the center of the pie-chart
getCenterTextOffset() MPPointF
Returns the offset on the x- and y-axis the center text has in dp.
getCenterTextRadiusPercent() double
the rectangular radius of the bounding box for the center text, as a percentage of the pie hole default 1.f (100%)
getCircleBox() Rect
returns the circlebox, the boundingbox of the pie-chart slices
getData() ChartData<IDataSet<Entry>>?
inherited
getDataSetIndexForIndex(int xIndex) int
Returns the index of the DataSet this x-index belongs to.
getDefaultValueFormatter() ValueFormatter
inherited
getDiameter() double
returns the diameter of the pie- or radar-chart
inherited
getDrawAngles() List<double?>
returns an integer array of all the different angles the chart slices have the angles in the returned array determine how much space (of 360°) each slice takes
getHighlightByTouchPoint(double x, double y) Highlight?
Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the Line-, Scatter-, or CandleStick-Chart.
inherited
getHoleColor() Color
getHoleRadius() double
Returns the size of the hole radius in percent of the total radius.
getIndexForAngle(double angle) int
Returns the xIndex for the given angle around the center of the chart. Returns -1 if not found / outofbounds.
override
getMarkerPosition(Highlight high) List<double>
Returns the actual position in pixels of the MarkerView for the given Highlight object.
override
getMaxHighlightDistance() double?
Returns the maximum distance in scren dp a touch can be away from an entry to cause it to get highlighted.
inherited
getMaxVisibleCount() int
inherited
getMeasuredHeight() double
inherited
getMeasuredWidth() double
inherited
getMinOffset() double
Gets the minimum offset (padding) around the chart, defaults to 0.f
inherited
getPosition1(MPPointF center, double dist, double angle) MPPointF
Returns a recyclable MPPointF instance. Calculates the position around a center point, depending on the distance from the center, and the angle of the position around the center.
inherited
getPosition2(MPPointF center, double dist, double angle, MPPointF outputPoint) → void
inherited
getRadius() double
Returns the radius of the chart in pixels.
override
getRawRotationAngle() double?
gets the raw version of the current rotation angle of the pie chart the returned value could be any value, negative or positive, outside of the 360 degrees. this is used when working with rotation direction, mainly by gestures and animations.
inherited
getRequiredBaseOffset() double
Returns the base offset needed for the chart without calculating the legend size.
override
getRequiredLegendOffset() double
Returns the required offset for the chart legend.
override
getRotationAngle() double
gets a normalized version of the current rotation angle of the pie chart, which will always be between 0.0 < 360.0
inherited
getTransparentCircleRadius() double
getYChartMax() double?
Returns the maximum y value of the chart, regardless of zoom or translation.
inherited
getYChartMin() double?
Returns the minimum y value of the chart, regardless of zoom or translation.
inherited
highlightValue1(double x, int dataSetIndex) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. This method will call the listener. @param x The x-value to highlight @param dataSetIndex The dataset index to search in
inherited
highlightValue2(double x, double y, int dataSetIndex) → void
Highlights the value at the given x-value and y-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. This method will call the listener. @param x The x-value to highlight @param y The y-value to highlight. Supply NaN for "any" @param dataSetIndex The dataset index to search in
inherited
highlightValue3(double x, int dataSetIndex, bool callListener) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. @param x The x-value to highlight @param dataSetIndex The dataset index to search in @param callListener Should the listener be called for this change
inherited
highlightValue4(double x, double y, int dataSetIndex, bool callListener) → void
Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. @param x The x-value to highlight @param y The y-value to highlight. Supply NaN for "any" @param dataSetIndex The dataset index to search in @param callListener Should the listener be called for this change
inherited
highlightValue5(Highlight highlight) → void
Highlights the values represented by the provided Highlight object This method will not call the listener.
inherited
highlightValue6(Highlight? high, bool callListener) → void
Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.
inherited
highlightValues(List<Highlight> highs) → void
Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This method will not call the listener.
inherited
hitTest(Offset position) bool?
Called whenever a hit test is being performed on an object that is using this custom paint delegate.
inherited
init() → void
inherited
initDefaultNormal() → void
inherited
initDefaultWithData() → void
override
isDrawCenterTextEnabled() bool
returns true if drawing the center text is enabled
isDrawEntryLabelsEnabled() bool
Returns true if drawing the entry labels is enabled, false if not.
isDrawHoleEnabled() bool
returns true if the hole in the center of the pie-chart is set to be visible, false if not
isDrawRoundedSlicesEnabled() bool
Returns true if the chart is set to draw each end of a pie-slice "rounded".
isDrawSlicesUnderHoleEnabled() bool
Returns true if the inner tips of the slices are visible behind the hole, false if not.
isRotationEnabled() bool
Returns true if rotation of the chart by touch is enabled, false if not.
inherited
isUsePercentValuesEnabled() bool
Returns true if using percentage values is enabled for the chart.
needsHighlight(int index) bool
Checks if the given index is set to be highlighted.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPaint(Canvas canvas, Size size) → void
override
paint(Canvas canvas, Size size) → void
Called whenever the object needs to paint. The given Canvas has its coordinate space configured such that the origin is at the top left of the box. The area of the box is the size of the size argument.
inherited
reassemble() → void
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that the object notifies when it is time to repaint.
inherited
selectedValue(Highlight? high) → void
inherited
setRotationAngle(double angle) → void
inherited
shouldRebuildSemantics(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
shouldRepaint(covariant CustomPainter oldDelegate) bool
Called whenever a new instance of the custom painter delegate class is provided to the RenderCustomPaint object, or any time that a new CustomPaint object is created with a new instance of the custom painter delegate class (which amounts to the same thing, because the latter is implemented in terms of the former).
inherited
toString() String
A string representation of this object.
inherited
valuesToHighlight() bool
Returns true if there are values to highlight, false if there are no values to highlight. Checks if the highlight array is null, has a length of zero or if the first object is null.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited