SfSparkLineChart class Null safety

This class renders a sparkline chart. The SfSparkLineChart 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 sparkline chart, create the instance of SfSparkLineChart. Set the value for data property which of type List. Now, it shows the line to represent the provided data.

It provides option to customize its appearance with the properties such as color, width, dashArray. To highlight the provided data, use either its marker property or 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

SfSparkLineChart({Key? key, List<num>? data, SparkChartPlotBand? plotBand, double width = 2, List<double>? dashArray, Color color = Colors.blue, bool isInversed = false, double axisCrossesAt = 0, Color axisLineColor = Colors.black, double axisLineWidth = 2, List<double>? axisLineDashArray, Color? highPointColor, Color? lowPointColor, Color? negativePointColor, Color? firstPointColor, Color? lastPointColor, SparkChartMarker? marker, SparkChartLabelDisplayMode? labelDisplayMode, TextStyle labelStyle = const TextStyle(fontFamily: 'Roboto', fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 12), SparkChartTrackball? trackball})
Creates a sparkline chart for the provided set of data with its default view. [...]
SfSparkLineChart.custom({Key? key, int? dataCount, SparkChartIndexedValueMapper? xValueMapper, SparkChartIndexedValueMapper<num>? yValueMapper, SparkChartPlotBand? plotBand, double width = 2, List<double>? dashArray, Color color = Colors.blue, bool isInversed = false, double axisCrossesAt = 0, Color axisLineColor = Colors.black, double axisLineWidth = 2, List<double>? axisLineDashArray, Color? highPointColor, Color? lowPointColor, Color? negativePointColor, Color? firstPointColor, Color? lastPointColor, SparkChartTrackball? trackball, SparkChartMarker? marker, SparkChartLabelDisplayMode? labelDisplayMode, TextStyle labelStyle = const TextStyle(fontFamily: 'Roboto', fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 12)})
Creates the sparkline 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
color Color
Customizes the spark line chart color. [...]
final
dashArray List<double>?
Dashes of the line of a sparkline chart. 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
firstPointColor Color?
Customizes the marker color of the first data point. [...]
final
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
highPointColor Color?
Customizes the marker color of the highest data point. [...]
final
isInversed bool
Inverts the axis from right to left. [...]
final
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
labelDisplayMode SparkChartLabelDisplayMode?
Enables the data labels. [...]
final
labelStyle TextStyle
Customizes the data label text style. [...]
final
lastPointColor Color?
Customizes the marker color of the last data point. [...]
final
lowPointColor Color?
Customizes the marker color of the lowest data point. [...]
final
marker SparkChartMarker?
Enables and customizes the markers. [...]
final
negativePointColor Color?
Customizes the marker 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.
read-only, inherited
trackball SparkChartTrackball?
Enables and customizes the trackball. [...]
final
width double
Customizes the line width of the sparkline chart. [...]
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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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. [...]
@nonVirtual, inherited