BubbleChartRenderer class
Draws the bubbles of a BubbleDataProvider. Each entry is a filled circle at its x and y value whose diameter follows the entry size relative to the largest size of its data set. A highlight redraws the outline of the bubble in a darker shade of its color.
- Inheritance
-
- Object
- Renderer
- DataRenderer
- BarLineScatterCandleBubbleRenderer
- BubbleChartRenderer
Constructors
- BubbleChartRenderer(BubbleDataProvider chart, ChartAnimator animator, ViewPortHandler viewPortHandler)
-
Creates a renderer for the bubble data of
chart.
Properties
- animator → ChartAnimator
-
Supplies the animation phases (0 to 1) that scale the drawn entries.
finalinherited
- chart → BubbleDataProvider
-
The chart that supplies the bubble 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 setteroverride
- 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, IBubbleDataSet dataSet) → void -
Draws every bubble of
dataSetinside the visible range that the reduction kept, with the color of its entry. -
drawExtras(
Canvas c) → void -
Does nothing; bubble 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 -
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 size value of each bubble that was drawn centered on it, fading the text in with the animation.
override
-
getShapeSize(
double entrySize, double maxSize, double reference, bool normalizeSize) → double - Returns the diameter in pixels of a bubble with the given size.
-
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.override -
initBuffers(
) → void -
Does nothing; bubbles 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.override -
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.override -
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