LineChartData class

LineChart needs this class to render itself.

It holds data needed to draw a line chart, including bar lines, spots, colors, touches, ...

Inheritance

Constructors

LineChartData({List<LineChartBarData> lineBarsData = const [], List<BetweenBarsData> betweenBarsData = const [], FlTitlesData titlesData = const FlTitlesData(), ExtraLinesData? extraLinesData = const ExtraLinesData(), LineTouchData lineTouchData = const LineTouchData(), List<ShowingTooltipIndicators> showingTooltipIndicators = const [], FlGridData? gridData = const FlGridData(), FlBorderData? borderData, RangeAnnotations? rangeAnnotations = const RangeAnnotations(), double? minX, double? maxX, double? baselineX, double? minY, double? maxY, double? baselineY, FlClipData? clipData = const FlClipData.none(), Color? backgroundColor})
LineChart draws some lines in various shapes and overlaps them. lines are defined in lineBarsData, sometimes you need to fill space between two bars with a color or gradient, you can use betweenBarsData to achieve that.

Properties

backgroundColor Color
A background color which is drawn behind the chart.
getter/setter pairinherited
baselineX double
getter/setter pairinherited
baselineY double
getter/setter pairinherited
betweenBarsData List<BetweenBarsData>
Fills area between two LineChartBarData with a color or gradient.
final
borderData FlBorderData
Holds data to drawing border around the chart.
getter/setter pairinherited
clipData FlClipData
clip the chart to the border (prevent draw outside the border)
getter/setter pairinherited
extraLinesData ExtraLinesData
Extra horizontal or vertical lines to draw on the chart.
finalinherited
gridData FlGridData
finalinherited
hashCode int
The hash code for this object.
no setterinherited
horizontalDiff double
Difference of maxX and minX
no setterinherited
lineBarsData List<LineChartBarData>
LineChart draws some lines in various shapes and overlaps them.
final
lineTouchData LineTouchData
Handles touch behaviors and responses.
final
maxX double
getter/setter pairinherited
maxY double
getter/setter pairinherited
minX double
getter/setter pairinherited
minY double
getter/setter pairinherited
props List<Object?>
Used for equality check, see EquatableMixin.
no setteroverride
rangeAnnotations RangeAnnotations
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showingTooltipIndicators List<ShowingTooltipIndicators>
You can show some tooltipIndicators (a popup with an information) on top of each LineChartBarData.spots using showingTooltipIndicators, just put line indicator number and spots indices you want to show it on top of them.
final
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
titlesData FlTitlesData
finalinherited
touchData FlTouchData<BaseTouchResponse>
Holds data needed to touch behavior and responses.
getter/setter pairinherited
verticalDiff double
Difference of maxY and minY
no setterinherited

Methods

copyWith({List<LineChartBarData>? lineBarsData, List<BetweenBarsData>? betweenBarsData, FlTitlesData? titlesData, RangeAnnotations? rangeAnnotations, ExtraLinesData? extraLinesData, LineTouchData? lineTouchData, List<ShowingTooltipIndicators>? showingTooltipIndicators, FlGridData? gridData, FlBorderData? borderData, double? minX, double? maxX, double? baselineX, double? minY, double? maxY, double? baselineY, FlClipData? clipData, Color? backgroundColor}) LineChartData
Copies current LineChartData to a new LineChartData, and replaces provided values.
lerp(BaseChartData a, BaseChartData b, double t) LineChartData
Lerps a BaseChartData based on t value, check Tween.lerp.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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