Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter - Draw Graphs on the screen

Is there any library for Flutter (Dart) for drawing Graphs on the screen with a coordinate system? Or how would I approach doing it from scratch?

like image 229
OhMad Avatar asked Apr 30 '17 06:04

OhMad


People also ask

What is canvas Flutter?

Like an artist's canvas is a physical surface to draw on, a Canvas in Flutter is a virtual surface for drawing. But unlike a regular art canvas, you can't paint on the Flutter canvas with physical brushes. Flutter Canvas uses a two-point (x and y) coordinate system to determine the position of a point on the screen.


1 Answers

There is no graph drawing library for Flutter right now. The Dart UI package contains a canvas implementation. There are some examples using the class: example mentioned in comment above, part two in the series of those blog post, or this official example in the Flutter repo. The official canvas example seems outdated, not all objects are rendered within the visible part of the canvas.

Flutter issues: There is an open issue for Charting library for Flutter #9043, and a documentation issue mentions questions regarding charting as well. Based on that information it doesn't seem like the Flutter team is currently working on charting components, so it could be done as a community effort.

Update: There is now a an open source Flutter library for charting created by Google called chart_flutter. Among the examples there is a simple line chart example which might fit your needs.

like image 108
raju-bitter Avatar answered Oct 23 '22 06:10

raju-bitter