ChartLineLayer.positiveNegative constructor

const ChartLineLayer.positiveNegative({
  1. required List<Point> items,
  2. required Color? positiveColor,
  3. required Color? negativeColor,
  4. double lineWidth = 1,
  5. List<double>? dashArray,
  6. double? smoothness,
})

Creates a new instance of ChartLineLayer with different colors for the positive and negative portion of the chart.

The items parameter is required and represents the list of points to connect with lines. The positiveColor and negativeColor define the colors for positive and negative values respectively. The lineWidth specifies the width of the line (default is 1). The dashArray is an optional list of values defining the dash pattern for the line. The smoothness is an optional value to smooth the line.

Implementation

const ChartLineLayer.positiveNegative({
  required super.items,
  required this.positiveColor,
  required this.negativeColor,
  this.lineWidth = 1,
  this.dashArray,
  this.smoothness,
}) : colors = null;