TinyLineChart class
A Widget that paints a simple line chart.
It is ideal for sparkline charts.
The data can be provided by a list of coordinates that can be
represented by either flutter's Offset or by vector_math
's Vector2
.
The line will be draw using dataPoints as vertices. The data space to be painted by the chart can be bounded by passing the limits to options.
For example, if options.xMaxLimit
is passed, the line chart will be
painted in such a way that any data point beyond that limit will not be
painted.
If both width and height are passed, the chart will try to keep aspect ratio.
See also:
new TinyLineChart
to build a line chart using Offset- TinyLineChart.fromDataVectors to build a line chart using
Vector2
- TinyLineChartOptions for more details on options.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- TinyLineChart
Constructors
-
TinyLineChart({Key? key, required Iterable<
Offset> dataPoints, TinyLineChartOptions? options, double? width, double? height}) -
Creates a TinyLineChart from a Iterable of Offset.
factory
-
TinyLineChart.fromDataVectors({Key? key, required Iterable<
Vector2> dataPoints, TinyLineChartOptions? options, double? width, double? height}) -
Creates a TinyLineChart from a Iterable of
Vector2
.const
Properties
-
dataPoints
→ Iterable<
Vector2> -
The set of coordinates that represents the vertices of the line path.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
If non-null, require the chart to have this height.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- options → TinyLineChartOptions
-
A set of options to customize the chart display, defaults to
kDefaultLineChartOptions when null on construction.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → double?
-
If non-null, require the chart to have this width.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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