HorizontalBarChartRenderer class

Draws the bars of a horizontal bar chart, where the x values run along the vertical axis and the bar values along the horizontal axis. Uses a HorizontalBarBuffer per data set and places value labels to the right of the bars (to the left for negative values).

Inheritance

Constructors

HorizontalBarChartRenderer(BarDataProvider chart, ChartAnimator animator, ViewPortHandler viewPortHandler)
Creates a renderer for the bar data of chart; value labels are drawn left aligned.

Properties

animator → ChartAnimator
Supplies the animation phases (0 to 1) that scale the drawn entries.
finalinherited
barBorderPaint → ChartPaint
Stroke paint for the bar borders; color and width (dp) come from the data set.
finalinherited
barBuffers ↔ List<BarBuffer>
One buffer per data set holding its bar rectangles, created by initBuffers. Empty until the chart has data.
getter/setter pairinherited
barRect → MutableRect
Pixel rectangle of the bar being highlighted, filled by prepareBarHighlight.
finalinherited
barShadowRectBuffer → MutableRect
Rectangle reused while drawing bar shadows.
finalinherited
barShapePath → Path
Clip path for rounded bars, reused across draws.
finalinherited
barShapeRadii → Float32List
Corner radii for barShapePath, two values per corner starting top left.
finalinherited
chart → BarDataProvider
The chart that supplies the bar data, the transformers and the bar settings.
finalinherited
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.columnCounts says 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 indices up to count instead 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
shadowPaint → ChartPaint
Paint for the bar shadow drawn behind each bar over the full content height when the chart enables it; its color is the bar shadow color of the data set.
finalinherited
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 setteroverride
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 set into valuePaint.
inherited
barCorners(IBarDataSet dataSet, int pos, int sections, [BarCorners outermost = BarCorners.TOP]) → BarCorners
Corners to round for the bar rect at pos of a data set: all for plain bars and, in a stack, all of every section when the set rounds its sections, otherwise only the end of the outermost one.
inherited
buffersFitData(BarData barData) → bool
True while barBuffers still holds one buffer for every data set of barData that has both its size and its stacking. The stacking is part of the question because two data sets of different shape can need the same number of floats, and a buffer built for plain bars would drop the sections of a stacked one.
inherited
drawBarShape(Canvas c, IBarDataSet dataSet, double left, double top, double right, double bottom, BarCorners corners, void draw()) → void
Runs draw clipped to the rounded shape of a bar when dataSet has a IBarDataSet.barCornerRadius, otherwise runs it directly. Coordinates are pixels.
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.
inherited
drawDataSet(Canvas c, IBarDataSet dataSet, int index) → void
Same as the base class, but skips bars by their vertical position and fills custom fills left to right.
override
drawExtras(Canvas c) → void
Does nothing; bar charts have no extras.
inherited
drawHighlighted(Canvas c, List<Highlight> indices) → void
Draws a rectangle in the highlight color and alpha of the data set over each highlighted bar. For a stacked entry only the selected stack value is covered, unless the chart highlights full bars.
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 stackIndex is the position of value in 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 color at the pixel position (x, y), where y is the text baseline.
inherited
drawValues(Canvas c) → void
Draws the value label and icon of each visible bar above it (or below it for negative values, and the other way round when values are drawn inside the bars). Stacked bars get one label per stack value.
override
drawValueText(Canvas c, String valueText, double x, double y, Color color) → void
Draws an already formatted value text with valuePaint in color, left aligned at the pixel position (x, y), where y is the text baseline.
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
Creates one HorizontalBarBuffer per data set.
override
isInBoundsX(Entry? e, IBarLineScatterCandleBubbleDataSet<Entry> set) → bool
Returns true if e lies within the part of set that 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
prepareBarHighlight(double x, double y1, double y2, double barWidthHalf, Transformer trans) → void
Swaps the axes: the bar is centered vertically on the x value x and spans horizontally from y1 to y2.
override
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 dataSet inside xBounds that are worth drawing in the viewport of chart, or with all of them while BarLineScatterCandleBubbleDataProvider.isDecimationEnabled is off. Needs a preceding XBounds.set.
inherited
setHighlightDrawPos(Highlight high, MutableRect bar) → void
Stores on high the vertical center of the highlighted bar as its x and the bar's right edge as its y; HorizontalBarChart.getMarkerPosition swaps them back, so the marker sits at the right end of the bar, vertically centered.
override
shouldDrawValues(BarLineScatterCandleBubbleDataProvider chart, IBarLineScatterCandleBubbleDataSet<Entry> set) → bool
Returns true if set draws values or icons and has at most BarLineScatterCandleBubbleDataProvider.maxVisibleCount entries inside the visible x range of chart, above which the labels would sit too close together to read.
inherited
shouldDrawValuesOf(IDataSet<Entry> set) → bool
Returns true if set is visible and has value labels or icons enabled.
inherited
sizeOf(Entry entry) → double
How much of the picture entry takes, 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 set that lie inside the visible x range of chart.
inherited

Operators

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