How to display json data in flutter charts

1,032 views
Skip to first unread message

Eti V.

unread,
Jul 17, 2018, 4:06:26 PM7/17/18
to Flutter Dev
The title says it, knows anyone an example for how to display data you got from a http request  or can help with this?

thank you. 

Dale King

unread,
Jul 17, 2018, 4:25:31 PM7/17/18
to Flutter Dev
You need to be more specific on where you are having problems. You will have to convert the JSON data to a form that the particular chart library is expecting. The chart library will not know anything about JSON data, nor should it.

Eti V.

unread,
Jul 17, 2018, 4:40:14 PM7/17/18
to Flutter Dev
I guess this "You will have to convert the JSON data to a form that the particular chart library is expecting" is my biggest issue. 

Am Dienstag, 17. Juli 2018 22:25:31 UTC+2 schrieb Dale King:
You need to be more specific on where you are having problems. c. The chart library will not know anything about JSON data, nor should it.

Dale King

unread,
Jul 17, 2018, 4:57:33 PM7/17/18
to Flutter Dev
You need to break it up into several development steps.

First you need to figure out how to generate the particular style of chart you want in the chosen chart library using some hardcoded data. You did not specify which chart library you are trying to use, but charts_flutter is an official one from Google.

Any good chart library is going to have examples of how to generate each type of chart (e.g. here are the examples from charts_flutter). Start with the example code for the particular chart you want and tweak it to appear how you want with some hardcoded data.

Doing that you should have a good idea what form of input the chart needs then it is just a matter of reading the JSON and converting it into that form. See this for help in how to handle JSON in flutter.
Reply all
Reply to author
Forward
0 new messages