drawAxes method

void drawAxes(
  1. Canvas canvas,
  2. Size size
)

Draws the graph axes on the given canvas with the provided size.

Implementation

void drawAxes(
  Canvas canvas,
  Size size,
) {
  var xAddition = -graph.focusPoint.x;
  var yAddition = -graph.focusPoint.y;
  addObject(GraphLine(
      color: graph.axesColor,
      startOffset: Offset(-(size.width / 2 + xAddition.abs()), 0),
      endOffset: Offset(size.width / 2 - xAddition, 0),
      lineWidth: graph.axesWidth));
  addObject(GraphLine(
      lineWidth: graph.axesWidth,
      color: graph.axesColor,
      startOffset: Offset(0, -(size.height / 2 + yAddition.abs())),
      endOffset: Offset(0, size.height / 2 + yAddition.abs())));
}