Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
line-chart-widget
void paint(Canvas canvas, Size size) {
...
final hr = boxH / (_max - _min); // height per unit value
final lt = Offset(border + boxW / 2.0, border);
final points = _computePoints(lt, boxW, boxH, hr);
final path = _computePath(points);
canvas.drawPath(path, linePaint);
_drawDataPoints(canvas, points, dotPaintFill);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment