ScatterChartRenderer class
Draws the points of a ScatterDataProvider. Each entry is drawn at its pixel position by the shape renderer of its data set; a highlight is shown with the standard highlight lines.
- Inheritance
-
- Object
- Renderer
- DataRenderer
- BarLineScatterCandleBubbleRenderer
- LineScatterCandleRadarRenderer
- ScatterChartRenderer
Constructors
- ScatterChartRenderer(ScatterDataProvider chart, ChartAnimator animator, ViewPortHandler viewPortHandler)
-
Creates a renderer for the scatter data of
chart.
Properties
- animator → ChartAnimator
-
Supplies the animation phases (0 to 1) that scale the drawn entries.
finalinherited
- chart → ScatterDataProvider
-
The chart that supplies the scatter data and the transformers.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSizes → bool
-
True while the entries of this renderer are drawn in sizes of their own, so that the reduction keeps the
largest of every column as well as its extremes. Only the bubble chart says yes; for everyone else asking
would cost a read per entry and answer 0 every time.
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.
finalinherited
- paintHighlight → ChartPaint
-
The paint used for highlight indicators, see highlightPaint.
no setterinherited
- paintRender → ChartPaint
-
The paint used for the data shapes, see renderPaint.
no setterinherited
- paintValues → ChartPaint
-
The paint used for value labels, see valuePaint.
no setterinherited
- reducedColumnWidth → double
-
Width in x value units of one pixel column of the last reduceVisible, or 0 while decimation is off. A
renderer that paints an entry as a shape with a width of its own widens that shape to the room the shapes
of its column took together, at most this much, so it still covers the ground the entries left out covered.
reducer.columnCountssays how many entries each kept one stands for.no setterinherited - reducer → PointReducer
-
Entries of the data set drawn last that are worth drawing, filled by reduceVisible. A renderer walks
indicesup tocountinstead of walking xBounds.finalinherited - 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.
finalinherited
- 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.
finalinherited
- viewPortHandler → ViewPortHandler
-
Holds the content rectangle and the current zoom and translation of the chart, in pixels.
finalinherited
- xAxisPixels → double
-
How many pixels the x values are spread over, which is the width of the content rectangle for every chart
but the horizontal bar chart, where the x values run down the screen.
no setterinherited
- xBounds → XBounds
-
Index range of the entries currently visible on screen; renderers update it per data set with XBounds.set.
latefinalinherited
Methods
-
applyValueTextStyle(
IDataSet< Entry> set) → void -
Copies the value typeface and value text size (dp, converted to pixels) of
setinto valuePaint.inherited -
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.override -
drawDataSet(
Canvas c, IScatterDataSet dataSet) → void -
Draws every entry of
dataSetthat is visible in the content rectangle with the data set's shape renderer, stopping at the entry count revealed by the x animation phase. -
drawExtras(
Canvas c) → void -
Does nothing; scatter charts have no extras.
override
-
drawHighlighted(
Canvas c, List< Highlight> indices) → void -
Draws the highlight indicators for the given selections onto
c. Called right after drawData.override -
drawHighlightLines(
Canvas c, double x, double y, ILineScatterCandleRadarDataSet< Entry> set) → void -
Draws the highlight lines of
setthrough the pixel position (x,y): a vertical line over the content height and a horizontal line over the content width, each only when the data set enables that indicator and each as far as its span allows. Uses the highlight color, line width (dp) and dash effect of the data set on highlightPaint.inherited -
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.inherited -
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.inherited -
drawValues(
Canvas c) → void -
Draws the y value of each entry that was drawn one shape size above it.
override
-
highOf(
Entry entry) → double -
Top of the y range of
entry. Charts with one y value per entry read it; candle charts read the high.inherited -
initBuffers(
) → void -
Does nothing; scatter shapes are drawn without a buffer.
override
-
isInBoundsX(
Entry? e, IBarLineScatterCandleBubbleDataSet< Entry> set) → bool -
Returns true if
elies within the part ofsetthat the x animation phase has already revealed, false for null.inherited -
lowOf(
Entry entry) → double -
Bottom of the y range of
entry. Charts with one y value per entry read it; candle charts read the low.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reducedPositions(
IBarLineScatterCandleBubbleDataSet< Entry> dataSet, Transformer trans, double phaseY) → Float32List -
Pixel positions of the entries reduceVisible picked, as x, y pairs, where y is highOf the entry
multiplied by
phaseY. Needs a preceding reduceVisible.inherited -
reduceVisible(
BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet< Entry> dataSet, [bool reduceWhenCrowded = false]) → void -
Fills reducer with the entries of
dataSetinside xBounds that are worth drawing in the viewport ofchart, or with all of them while BarLineScatterCandleBubbleDataProvider.isDecimationEnabled is off. Needs a preceding XBounds.set.inherited -
shouldDrawValues(
BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet< Entry> set) → bool -
Returns true if
setdraws values or icons and has at most BarLineScatterCandleBubbleDataProvider.maxVisibleCount entries inside the visible x range ofchart, above which the labels would sit too close together to read.inherited -
shouldDrawValuesOf(
IDataSet< Entry> set) → bool -
Returns true if
setis visible and has value labels or icons enabled.inherited -
sizeOf(
Entry entry) → double -
How much of the picture
entrytakes, for renderers whose entries have sizes of their own.inherited -
toString(
) → String -
A string representation of this object.
inherited
-
visibleEntryCount(
BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet< Entry> set) → int -
Number of entries of
setthat lie inside the visible x range ofchart.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited