ChartDataSet class

Represents a single data point in a chart.

Each ChartDataSet represents one data point with a color. Multiple ChartDataSet instances can be used to create charts with multiple points, where each dataset represents one point.

This is the primary data structure for line, bar, area, scatter, and other point-based charts.

Example

ChartDataSet(
  color: Colors.blue,
  dataPoint: ChartDataPoint(x: 1, y: 20, label: 'January'),
)

See also:

Constructors

ChartDataSet({required Color color, required ChartDataPoint dataPoint})
Creates a chart data set.
const

Properties

color Color
The color used to render this data point.
final
dataPoint ChartDataPoint
The single data point in this dataset.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ChartDataPoint? dataPoint, Color? color}) ChartDataSet
Creates a copy of this data set with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Methods

isAllDataPointsEmpty(List<ChartDataSet> dataSets) bool
Returns true if dataSets is empty or every data point has both x and y equal to zero (no meaningful data to display).