

Using JSON Data in Highcharts
source link: https://www.codesd.com/item/using-json-data-in-highcharts.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Using JSON Data in Highcharts
I have some JSON data:
data1=[
{"date": 1396828800, "impressions": 49145385},
{"date": 1396915200, "impressions": 46704447},
{"date": 1397001600, "impressions": 47181000},
{"date": 1397088000, "impressions": 47337965},
{"date": 1397174400, "impressions": 51129266},
{"date": 1397260800, "impressions": 60547397},
{"date": 1397347200, "impressions": 62217077},
{"date": 1397433600, "impressions": 49145385},
{"date": 1397520000, "impressions": 46704447},
{"date": 1397606400, "impressions": 47181000},
{"date": 1397692800, "impressions": 47337965},
{"date": 1397779200, "impressions": 51129266},
{"date": 1397865600, "impressions": 60547397}
];
and I want to display this in Highcharts. Here is the template I am working off of: http://jsfiddle.net/hohenheim/j8cTE/9/
How can I get this data into the highcharts chart?
You need to do some processesing of your data to get it into the format highcharts wants.
for (var i=0;i< data1.length;i++) {
data1[i] = [data1[i].date, data1[i].impressions];
}
and then use it as the series:
series:
[{
data: data1
}]
Related Articles
Create a HighCharts pie chart using JSON data
Browse the Highchart Multi-Line Diagram using JSON Data
How to create an html table using JSON data?
Using JSON data is better than database querying when there is no security problem for the data
can not work live graphic stock in android using json data URL
Use Json data from the network call in UITableView
Need help using JSON data in the Windows application
Using JSON Data in ASP.NET MVC
How to Use JSON Data from a URL to Set Markers in an Android Card Activity
Trying to Pass JSON Data to Highcharts Without Success
I do not understand how to use JSON data in Xcode
how to use JSON data in chart.js?
How can I prevent my application from blocking unexpectedly, & ldquo; force close, when using JSON data and handle the exception instead?
How can I dynamically populate jQuery Mobile pages using JSON data?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK