How to draw line graph in using corona with JSON data

Hi,

I am newbie of corona, i need guide or any tutorial reference for building line graph using JSON data in corona SDK.

Thanks in advance  :slight_smile:

Well you would need to know how to read a file.  Look at the file.* and io.* API calls in the documentation.  Once you’ve read your JSON file in, then you need to decode it, look for the json.* API calls.  If you’re getting the data from a network server, you need to know how to use the network.* API calls.  After that, if your data has X, Y values and you can determine the end point of each line you would use display.newLine() to draw the line.

All of that is talked about in the Documentation (link at the top of the page) and each API call should have examples.

Rob

Hi Rob,

Thanks alot for your guide, i will try and let you know the outcome.

Thanks alot again

yogesh  :wink:

Well you would need to know how to read a file.  Look at the file.* and io.* API calls in the documentation.  Once you’ve read your JSON file in, then you need to decode it, look for the json.* API calls.  If you’re getting the data from a network server, you need to know how to use the network.* API calls.  After that, if your data has X, Y values and you can determine the end point of each line you would use display.newLine() to draw the line.

All of that is talked about in the Documentation (link at the top of the page) and each API call should have examples.

Rob

Hi Rob,

Thanks alot for your guide, i will try and let you know the outcome.

Thanks alot again

yogesh  :wink:

I’m wondering if there’s a professional (or free) plugin to help with advanced graphing/charting.  Obviously it can be done using lines and data coordinates but I’m wondering if there’s a plugin that would take the coordinate data and help generate the graph views.

Has anyone built something to help with things like pie charts, bar graphs, etc?  I’ve looked around but I don’t see anything current.

I’m wondering if there’s a professional (or free) plugin to help with advanced graphing/charting.  Obviously it can be done using lines and data coordinates but I’m wondering if there’s a plugin that would take the coordinate data and help generate the graph views.

Has anyone built something to help with things like pie charts, bar graphs, etc?  I’ve looked around but I don’t see anything current.

Regarding a graphing plugin, would it be possible to use a webview and then load a local json file into a webpage that makes use of a javascript library like d3?

There is no reason you couldn’t use Web technologies to do this.

Rob

Hi Rob,

One would think so, but I’m struggling with how to convince a webpage to load a dynamically created json file - see my current struggles here (Creating graphs with d3).

Any insights would be most appreciated!

Jeff

Regarding a graphing plugin, would it be possible to use a webview and then load a local json file into a webpage that makes use of a javascript library like d3?

There is no reason you couldn’t use Web technologies to do this.

Rob

Hi Rob,

One would think so, but I’m struggling with how to convince a webpage to load a dynamically created json file - see my current struggles here (Creating graphs with d3).

Any insights would be most appreciated!

Jeff