HorizontalLine constructor

HorizontalLine({
  1. required double y,
  2. HorizontalLineLabel? label,
  3. Color? color,
  4. Gradient? gradient,
  5. double strokeWidth = 2,
  6. List<int>? dashArray,
  7. Image? image,
  8. SizedPicture? sizedPicture,
  9. StrokeCap strokeCap = StrokeCap.butt,
})

LineChart draws horizontal lines from left to right side of the chart in the provided y value, and color it using color. You can define the thickness using strokeWidth

It draws a label over it.

You can have a dashed line by filling dashArray with dash size and space respectively.

It draws an image in left side of the chart, use sizedPicture for vectors, or image for any kind of image.

Implementation

HorizontalLine({
  required this.y,
  HorizontalLineLabel? label,
  super.color,
  super.gradient,
  super.strokeWidth,
  super.dashArray,
  this.image,
  this.sizedPicture,
  this.strokeCap = StrokeCap.butt,
}) : label = label ?? HorizontalLineLabel();