LineChartData class

Data configuration for line charts.

Example:

LineChartData(
  series: [
    LineSeries(
      name: 'Sales',
      data: salesData,
      color: Colors.blue,
    ),
    LineSeries(
      name: 'Costs',
      data: costsData,
      color: Colors.red,
    ),
  ],
  xAxis: AxisConfig(
    label: 'Month',
    type: AxisType.category,
  ),
  yAxis: AxisConfig(
    label: 'Amount (\$)',
    min: 0,
  ),
)
Inheritance
Annotations

Constructors

LineChartData({required List<LineSeries<dynamic, num>> series, ChartAnimation? animation, String? title, String? subtitle, AxisConfig? xAxis, AxisConfig? yAxis, AxisConfig? secondaryYAxis, GridStyle? gridStyle, bool clipBehavior = true, bool showLegend = false, LegendPosition legendPosition = LegendPosition.bottom, bool crosshairEnabled = false, bool tooltipEnabled = true})
Creates line chart data.
const

Properties

allSeries List<ChartSeries>
The series contained in this chart data.
no setteroverride
animation ChartAnimation?
Animation configuration for this chart.
finalinherited
clipBehavior bool
Whether to clip data outside the chart area.
finalinherited
crosshairEnabled bool
Whether to show a crosshair on hover/touch.
final
gridStyle GridStyle?
Grid styling configuration.
finalinherited
hashCode int
The hash code for this object.
no setteroverride
isEmpty bool
Returns true if this chart data has no series or all series are empty.
no setterinherited
isNotEmpty bool
Returns true if this chart data has at least one non-empty series.
no setterinherited
legendPosition LegendPosition
Position of the legend.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryYAxis AxisConfig?
Optional secondary Y-axis configuration.
finalinherited
series List<LineSeries<dynamic, num>>
The line series to display.
final
showLegend bool
Whether to show the legend.
final
subtitle String?
Optional chart subtitle.
finalinherited
title String?
Optional chart title.
finalinherited
tooltipEnabled bool
Whether to show tooltips.
final
xAxis AxisConfig?
X-axis configuration.
finalinherited
yAxis AxisConfig?
Primary Y-axis configuration.
finalinherited

Methods

copyWith({List<LineSeries<dynamic, num>>? series, ChartAnimation? animation, String? title, String? subtitle, AxisConfig? xAxis, AxisConfig? yAxis, AxisConfig? secondaryYAxis, GridStyle? gridStyle, bool? clipBehavior, bool? showLegend, LegendPosition? legendPosition, bool? crosshairEnabled, bool? tooltipEnabled}) LineChartData
Creates a copy of this chart data with the given values replaced.
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.
override