drawHorizontalAxesLine method

  1. @override
void drawHorizontalAxesLine(
  1. Canvas canvas,
  2. ChartAxisRenderer axisRenderer,
  3. SfCartesianChart chart
)

To draw the horizontal axis line

Implementation

@override
void drawHorizontalAxesLine(
    Canvas canvas, ChartAxisRenderer axisRenderer, SfCartesianChart chart) {
  final ChartAxis axis = axisRenderer._axis;
  final Rect rect = Rect.fromLTWH(
      axisRenderer._bounds.left - axis.plotOffset,
      axisRenderer._bounds.top,
      axisRenderer._bounds.width + 2 * axis.plotOffset,
      axisRenderer._bounds.height);

  final _CustomPaintStyle paintStyle = _CustomPaintStyle(
      axisRenderer.getAxisLineWidth(axis),
      axisRenderer.getAxisLineColor(axis) ??
          _chartState._chartTheme.axisLineColor,
      PaintingStyle.stroke);
  _drawDashedPath(canvas, paintStyle, Offset(rect.left, rect.top),
      Offset(rect.left + rect.width, rect.top), axis.axisLine.dashArray);
  _xAxisStart = Offset(rect.left, rect.top);
  _xAxisEnd = Offset(rect.left + rect.width, rect.top);
}