drawAxisLine method

  1. @override
void drawAxisLine(
  1. ChartCanvas canvas,
  2. AxisOrientation orientation,
  3. Rectangle<int> axisBounds
)
override

Implementation

@override
void drawAxisLine(
  ChartCanvas canvas,
  AxisOrientation orientation,
  Rectangle<int> axisBounds,
) {
  Point<num> start;
  Point<num> end;

  switch (orientation) {
    case AxisOrientation.top:
      start = axisBounds.bottomLeft;
      end = axisBounds.bottomRight;
    case AxisOrientation.bottom:
      start = axisBounds.topLeft;
      end = axisBounds.topRight;
    case AxisOrientation.right:
      start = axisBounds.topLeft;
      end = axisBounds.bottomLeft;
    case AxisOrientation.left:
      start = axisBounds.topRight;
      end = axisBounds.bottomRight;
  }

  canvas.drawLine(
    points: [start, end],
    fill: axisLineStyle.color,
    stroke: axisLineStyle.color,
    strokeWidthPx: axisLineStyle.strokeWidth.toDouble(),
    dashPattern: axisLineStyle.dashPattern,
  );
}