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;
      break;
    case AxisOrientation.bottom:
      start = axisBounds.topLeft;
      end = axisBounds.topRight;
      break;
    case AxisOrientation.right:
      start = axisBounds.topLeft;
      end = axisBounds.bottomLeft;
      break;
    case AxisOrientation.left:
      start = axisBounds.topRight;
      end = axisBounds.bottomRight;
      break;
  }

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