ChartDataPoint class

Represents a single data point in a chart.

Each point has an x-coordinate (horizontal position) and y-coordinate (vertical value). An optional label can be provided for display purposes.

This is an immutable value class that represents a single data point in various chart types (line, bar, area, scatter, etc.).

Example

const ChartDataPoint(
  x: 0,
  y: 10.5,
  label: 'January',
)

See also:

Implementers

Constructors

ChartDataPoint({required double x, required double y, String? label, bool showValue = true})
Creates a chart data point.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
label String?
Optional label for the data point (e.g., "Jan", "Q1").
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showValue bool
Whether to show the value for this data point.
final
x double
The x-coordinate (horizontal position) of the data point.
final
y double
The y-coordinate (vertical value) of the data point.
final

Methods

copyWith({double? x, double? y, String? label, bool? showValue}) ChartDataPoint
Creates a copy of this data point 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