BarChartPainter class
- Inheritance
-
- Object
- Listenable
- CustomPainter
- ChartPainter<
BarData?> - BarLineChartBasePainter<
BarData?> - BarChartPainter
- Implemented types
- Implementers
Constructors
- BarChartPainter(BarData? 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, int maxVisibleCount, bool autoScaleMinMaxEnabled, bool pinchZoomEnabled, bool doubleTapToZoomEnabled, bool highlightPerDragEnabled, bool dragXEnabled, bool dragYEnabled, bool scaleXEnabled, bool scaleYEnabled, Paint? gridBackgroundPaint, Paint? backgroundPaint, Paint? borderPaint, bool drawGridBackground, bool drawBorders, bool clipValuesToContent, double minOffset, bool keepPositionOnRotation, OnDrawListener? drawListener, YAxis? axisLeft, YAxis? axisRight, YAxisRenderer? axisRendererLeft, YAxisRenderer? axisRendererRight, Transformer? leftAxisTransformer, Transformer? rightAxisTransformer, XAxisRenderer? xAxisRenderer, Matrix4? zoomMatrixBuffer, bool customViewPortEnabled, bool highlightFullBarEnabled, bool drawValueAboveBar, bool drawBarShadow, bool fitBars, ChartTransListener? chartTransListener)
Properties
- animator → Animator?
-
no setterinherited
- axisLeft → YAxis?
-
no setterinherited
- axisRendererLeft → YAxisRenderer?
-
no setterinherited
- axisRendererRight → YAxisRenderer?
-
no setterinherited
- axisRight → YAxis?
-
no setterinherited
- doubleTapToZoomEnabled → bool
-
no setterinherited
- dragXEnabled → bool
-
no setterinherited
- dragYEnabled → bool
-
no setterinherited
- 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
- highlightPerDragEnabled → bool
-
no setterinherited
- highLightPerTapEnabled → bool
-
no setterinherited
-
indicesToHighlight
→ List<
Highlight> ? -
no setterinherited
- isDrawMarkers → bool
-
no setterinherited
- leftAxisTransformer → Transformer?
-
no setterinherited
- legend → Legend?
-
no setterinherited
- legendRenderer → LegendRenderer?
-
no setterinherited
- marker → IMarker?
-
no setterinherited
-
mGetPositionBuffer
↔ List<
double> -
getter/setter pairinherited
- minOffset → double
-
no setterinherited
- posForGetHighestVisibleX ↔ MPPointD
-
buffer for storing highest visible x point
getter/setter pairinherited
- posForGetLowestVisibleX ↔ MPPointD
-
buffer for storing lowest visible x point
getter/setter pairinherited
- renderer ↔ DataRenderer?
-
////////////////////////////////////////////////
object responsible for rendering the data
getter/setter pairinherited
- rightAxisTransformer → Transformer?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scaleXEnabled → bool
-
no setterinherited
- scaleYEnabled → bool
-
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
-
addEntry(
Entry entry, int dataSetIndex) → void -
inherited
-
addEntryByIndex(
int index, Entry entry, int dataSetIndex) → void -
inherited
-
addListener(
VoidCallback listener) → void -
Register a closure to be notified when it is time to repaint.
inherited
-
autoScale(
) → void -
Performs auto scaling of the axis by recalculating the minimum and maximum y-values based on the entries currently in view.
inherited
-
calcMinMax(
) → void -
Calculates the y-min and y-max value and the y-delta and x-delta value
override
-
calculateLegendOffsets(
Rect offsets) → Rect -
inherited
-
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
inherited
-
compute(
) → void -
inherited
-
drawDescription(
Canvas c, Size size) → void -
Draws the description text in the bottom right corner of the chart (per default)
inherited
-
drawGridBackground(
Canvas c) → void -
draws the grid background
inherited
-
drawMarkers(
Canvas canvas) → void -
draws all MarkerViews on the highlighted positions
inherited
-
getAxis(
AxisDependency axis) → YAxis? -
Returns the y-axis object to the corresponding AxisDependency. In the
horizontal bar-chart, LEFT == top, RIGHT == BOTTOM
inherited
-
getAxisRange(
AxisDependency axis) → double -
Returns the range of the specified axis.
inherited
-
getBarBounds(
BarEntry e) → Rect - The passed outputRect will be assigned the values of the bounding box of the specified Entry in the specified DataSet. The rect will be assigned Float.MIN_VALUE in all locations if the Entry could not be found in the charts data.
-
getBarData(
) → BarData? -
override
-
getCenter(
Size size) → MPPointF -
Returns a recyclable MPPointF instance.
Returns the center point of the chart (the whole View) in pixels.
inherited
-
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
-
getData(
) → BarLineScatterCandleBubbleData< IBarLineScatterCandleBubbleDataSet< ?Entry> > -
inherited
-
getDataSetByTouchPoint(
double x, double y) → IBarLineScatterCandleBubbleDataSet< Entry> ? -
returns the DataSet object displayed at the touched position of the chart
inherited
-
getDefaultValueFormatter(
) → ValueFormatter -
inherited
-
getEntryByTouchPoint(
double x, double y) → Entry? -
returns the Entry object displayed at the touched position of the chart
inherited
-
getHighestVisibleX(
) → double -
Returns the highest x-index (value on the x-axis) that is still visible
on the chart.
inherited
-
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 BarChart.
override
-
getLowestVisibleX(
) → double -
Returns the lowest x-index (value on the x-axis) that is still visible on
the chart.
inherited
-
getMarkerPosition(
Highlight high) → List< double> -
Returns the actual position in pixels of the MarkerView for the given
Highlight object.
inherited
-
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
-
getPixelForValues(
double x, double y, AxisDependency axis) → MPPointD -
Returns a recyclable MPPointD instance
Transforms the given chart values into pixels. This is the opposite
method to getValuesByTouchPoint(...).
inherited
-
getPosition(
Entry e, AxisDependency axis) → MPPointF -
Returns a recyclable MPPointF instance.
Returns the position (in pixels) the provided Entry has inside the chart
view or null, if the provided Entry is null.
inherited
-
getScaleX(
) → double -
returns the current x-scale factor
inherited
-
getScaleY(
) → double -
returns the current y-scale factor
inherited
-
getTransformer(
AxisDependency which) → Transformer? -
Returns the Transformer class that contains all matrices and is
responsible for transforming values into pixels on the screen and
backwards.
inherited
-
getValuesByTouchPoint1(
double x, double y, AxisDependency axis) → MPPointD -
Returns a recyclable MPPointD instance
Returns the x and y values in the chart at the given touch point
(encapsulated in a MPPointD). This method transforms pixel coordinates to
coordinates / values in the chart. This is the opposite method to
getPixelForValues(...).
inherited
-
getValuesByTouchPoint2(
double x, double y, AxisDependency axis, MPPointD outputPoint) → void -
inherited
-
getVisibleXRange(
) → double -
Returns the range visible on the x-axis.
inherited
-
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
-
groupBars(
double fromX, double groupSpace, double barSpace) → void - Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries. Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified by the parameters. Calls notifyDataSetChanged() afterwards.
-
hasNoDragOffset(
) → bool -
Returns true if both drag offsets (x and y) are zero or smaller.
inherited
-
highlightValue(
double x, int dataSetIndex, int stackIndex) → void - Highlights the value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting.
-
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 ininherited -
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 changeinherited -
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
-
isAnyAxisInverted(
) → bool -
Returns true if either the left or the right or both axes are inverted.
inherited
-
isDrawBarShadowEnabled(
) → bool -
returns true if drawing shadows (maxvalue) for each bar is enabled, false if not
override
-
isDrawValueAboveBarEnabled(
) → bool -
returns true if drawing values above bars is enabled, false if not
override
-
isFullyZoomedOut(
) → bool -
if the chart is fully zoomed out, return true
inherited
-
isHighlightFullBarEnabled(
) → bool -
@return true the highlight operation is be full-bar oriented, false if single-value
override
-
isInverted(
AxisDependency axis) → bool -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onPaint(
Canvas canvas, Size size) → void -
inherited
-
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 -
prepareOffsetMatrix(
) → void -
inherited
-
prepareValuePxMatrix(
) → void -
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
-
setBorderColor(
Color color) → void -
Sets the color of the chart border lines.
inherited
-
setBorderWidth(
double width) → void -
Sets the width of the border lines in dp.
inherited
-
setDragOffsetX(
double offset) → void -
Set an offset in dp that allows the user to drag the chart over it's
bounds on the x-axis.
inherited
-
setDragOffsetY(
double offset) → void -
Set an offset in dp that allows the user to drag the chart over it's
bounds on the y-axis.
inherited
-
setGridBackgroundColor(
Color color) → void -
Sets the color for the background of the chart-drawing area (everything
behind the grid lines).
inherited
-
setVisibleYRange(
double minYRange, double maxYRange, AxisDependency axis) → void -
Limits the maximum and minimum y range that can be visible by pinching and zooming.
inherited
-
setVisibleYRangeMaximum(
double maxYRange, AxisDependency axis) → void -
Sets the size of the area (range on the y-axis) that should be maximum
visible at once.
inherited
-
setVisibleYRangeMinimum(
double minYRange, AxisDependency axis) → void -
Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible.
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
-
translate(
double dx, double dy) → void -
inherited
-
updateEntry(
int index, Entry entry, int dataSetIndex) → bool -
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
-
zoom(
double scaleX, double scaleY, double? x, double? y) → void -
Zooms in or out by the given scale factor. x and y are the coordinates
(in pixels) of the zoom center.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited