DataRenderer class abstract
Base class of the renderers that draw chart data (bars, lines, slices, ...).
The chart calls initBuffers whenever its data changes and then, on every draw pass, drawData,
drawHighlighted, drawExtras and drawValues in that order. Subclass it and assign the instance to
chart.renderer to change how a chart draws. All canvas coordinates are pixels.
- Inheritance
- Implementers
Constructors
- DataRenderer(ChartAnimator animator, ViewPortHandler viewPortHandler)
-
Creates a renderer whose drawing follows the phases of
animator.
Properties
- animator → ChartAnimator
-
Supplies the animation phases (0 to 1) that scale the drawn entries.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightPaint → ChartPaint
-
Paint used to draw the highlight indicator of a selected entry. A 2 px orange stroke by default; subclasses
restyle it.
final
- paintHighlight → ChartPaint
-
The paint used for highlight indicators, see highlightPaint.
no setter
- paintRender → ChartPaint
-
The paint used for the data shapes, see renderPaint.
no setter
- paintValues → ChartPaint
-
The paint used for value labels, see valuePaint.
no setter
- renderPaint → ChartPaint
-
Main paint used to draw the data shapes (bars, lines, slices). Anti-aliased and filled by default; subclasses
change its color, style and stroke width per data set.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- valuePaint → ChartPaint
-
Paint used to draw the value labels of entries. Dark gray, centered, 9 dp by default; applyValueTextStyle
copies the typeface and text size of a data set into it before its values are drawn.
final
- viewPortHandler → ViewPortHandler
-
Holds the content rectangle and the current zoom and translation of the chart, in pixels.
finalinherited
Methods
-
applyValueTextStyle(
IDataSet< Entry> set) → void -
Copies the value typeface and value text size (dp, converted to pixels) of
setinto valuePaint. -
drawData(
Canvas c) → void -
Draws the data of the chart (bars, lines, slices, ...) onto
c. Called first in a draw pass, with the canvas clipped to the content rectangle when the chart clips data. -
drawExtras(
Canvas c) → void - Draws whatever the data type needs in addition to the data, such as line circles, the radar web or the pie hole. Called after drawHighlighted, without the content clip.
-
drawHighlighted(
Canvas c, List< Highlight> indices) → void -
Draws the highlight indicators for the given selections onto
c. Called right after drawData. -
drawStackedValue(
Canvas c, IValueFormatter formatter, double value, int stackIndex, Entry entry, int dataSetIndex, double x, double y, Color color) → void -
Draws one value label of a stacked bar entry, where
stackIndexis the position ofvaluein the stack. Same as drawValue otherwise. -
drawValue(
Canvas c, IValueFormatter formatter, double value, Entry entry, int dataSetIndex, double x, double y, Color color) → void -
Draws one value label with valuePaint in
colorat the pixel position (x,y), whereyis the text baseline. -
drawValues(
Canvas c) → void -
Draws the formatted value labels and icons of all entries onto
c. Called last in a draw pass, after the axes have been drawn. -
initBuffers(
) → void - Creates or resizes the buffers needed for the current data. Called by the chart whenever its data changes, before the next draw.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited