lineType property

CrosshairLineType lineType
final

Type of crosshair line.

By default, both vertical and horizontal lines will be displayed. You can change this by specifying values to this property.

Defaults to CrosshairLineType.both.

Also refer CrosshairLineType.

late CrosshairBehavior _crosshairBehavior;

void initState() {
  _crosshairBehavior = CrosshairBehavior(
    enable: true,
    lineType: CrosshairLineType.horizontal
  );
  super.initState();
}

Widget build(BuildContext context) {
  return SfCartesianChart(
    crosshairBehavior: _crosshairBehavior
  );
}

Implementation

final CrosshairLineType lineType;