drawDescription method

void drawDescription(
  1. Canvas c,
  2. Size size
)

Draws the description text in the bottom right corner of the chart (per default)

Implementation

void drawDescription(Canvas c, Size size) {
  // check if description should be drawn
  if (_description != null && _description!.enabled) {
    MPPointF? position = _description!.position;
    double? x, y;
    // if no position specified, draw on default position
    if (position == null) {
      x = size.width -
          _viewPortHandler!.offsetRight() -
          _description!.xOffset;
      y = size.height -
          _viewPortHandler!.offsetBottom() -
          _description!.yOffset;
    } else {
      x = position.x;
      y = position.y;
    }
    _descPaint!.layout();
    _descPaint!.paint(c, Offset(x, y));
  }
}