SfSparkBarChart class

This class renders a bar spark chart. The SfSparkBarChart is a very small chart, typically drawn without axis ticks and labels. It presents the general shape of data in a simple and highly condensed way.

To render a bar spark chart, create the instance of SfSparkBarChart. Set the value for data property which of type List

It provides option to customize its appearance with the properties such as color, borderWidth, borderColor. To highlight the provided data, use its data label property. To highlight the data point, which is tapped, use its trackball property. To highlight the particular region along with the vertical value, use its plotBand property.

Inheritance

Constructors

SfSparkBarChart({Key? key, List<num>? data, SparkChartPlotBand? plotBand, double borderWidth = 0, Color? borderColor, Color? color, bool isInversed = false, double axisCrossesAt = 0, Color? axisLineColor, double axisLineWidth = 2, List<double>? axisLineDashArray, Color? highPointColor, Color? lowPointColor, Color? negativePointColor, Color? firstPointColor, Color? lastPointColor, SparkChartLabelDisplayMode? labelDisplayMode, TextStyle? labelStyle, SparkChartTrackball? trackball})
Creates a spark bar chart for the provided set of data with its default view.
SfSparkBarChart.custom({Key? key, int? dataCount, SparkChartIndexedValueMapper? xValueMapper, SparkChartIndexedValueMapper<num>? yValueMapper, SparkChartPlotBand? plotBand, double borderWidth = 2, Color? borderColor, Color? color, bool isInversed = false, double axisCrossesAt = 0, Color? axisLineColor, double axisLineWidth = 2, List<double>? axisLineDashArray, Color? highPointColor, Color? lowPointColor, Color? negativePointColor, Color? firstPointColor, Color? lastPointColor, SparkChartLabelDisplayMode? labelDisplayMode, TextStyle? labelStyle, SparkChartTrackball? trackball})
Creates the spark bar chart for the provided set of data with its default view.

Properties

axisCrossesAt double
Customize the axis position based on the provided y-value. The axis line is rendered on the minimum y-value and can be repositioned to required y-value.
final
axisLineColor Color?
Customizes the color of the axis line. Colors.transparent can be set to axisLineColor to hide the axis line.
final
axisLineDashArray List<double>?
Dashes of the axis line. Any number of values can be provided on the list. Odd value is considered as rendering size and even value is considered a gap.
final
axisLineWidth double
Customizes the width of the axis line.
final
borderColor Color?
Customizes the border color of each rectangular column segment. The border will be rendered on the top of the spark area chart. To render the border, both the borderWidth and borderColor property needs to be set.
final
borderWidth double
Customizes the border width of each rectangular column segment. To render the border, both the border width and border color property needs to be set.
final
color Color?
Customizes the spark bar chart color.
final
firstPointColor Color?
Customizes the color of the first rectangular column segment.
final
hashCode int
The hash code for this object.
no setterinherited
highPointColor Color?
Customizes the color of the highest rectangular column segment.
final
isInversed bool
Inverts the axis from right to left.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelDisplayMode SparkChartLabelDisplayMode?
Enables the data labels.
final
labelStyle TextStyle?
Customizes the data label text style.
final
lastPointColor Color?
Customizes the color of the last rectangular column segment.
final
lowPointColor Color?
Customizes the color of the lowest rectangular column segment.
final
negativePointColor Color?
Customizes the color of negative data point and data point value less than the axisCrossesAt value.
final
plotBand SparkChartPlotBand?
Render plot band.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trackball SparkChartTrackball?
Enables and customizes the trackball.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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