drawInvertedTriangleMarker method

void drawInvertedTriangleMarker(
  1. Canvas canvas,
  2. double x,
  3. double y,
  4. DataMarkerStyle style,
)

Implementation

void drawInvertedTriangleMarker(Canvas canvas, double x, double y, DataMarkerStyle style) {
  final path = Path()
    ..moveTo(x, y + style.height / 2)
    ..lineTo(x + style.width / 2, y - style.height / 2)
    ..lineTo(x - style.width / 2, y - style.height / 2)
    ..close();

  final fillPaint = Paint()
    ..color = style.color
    ..style = PaintingStyle.fill;

  final borderPaint = Paint()
    ..color = style.borderColor
    ..strokeWidth = style.borderWidth
    ..style = PaintingStyle.stroke;

  canvas.drawPath(path, fillPaint);
  if (style.borderWidth > 0) {
    canvas.drawPath(path, borderPaint);
  }
}