Hi
I am new to JSON so wanted to ask you how to pass the returned JSON data and put it directly into Highcharts. This is my data:
JSON = [{"name":"Book","data":[14,17,9,10,6,19,6,8,0,4]},{"name":"Book Chapter","data":[65,74,44,66,9,23,36,51,53,36]},
{"name":"Conference Proceedings","data":[15,17,27,30,28,54,35,43,50,35]},{"name":"Journal Article","data":[178,162,133,139,133,191,160,194,149,169]}]
If I put that directly like this Series: JSON, it does not work, but if I specify manually then it does. I do not know why. Please help.
Regards
Buksh
What I have tried:
Have tried using the below,
$('#chartTrendsPublicationRankDetailed').highcharts({
chart: {
type: 'line'
},
title: {
text: 'My data'
},
xAxis: {
categories: ['2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016']
},
series: [{ "name": "Book", "data": [14, 17, 9, 10, 6, 19, 6, 8, 0, 4] }, { "name": "Book Chapter", "data": [65, 74, 44, 66, 9, 23, 36, 51, 53, 36] }, { "name": "Conference Proceedings", "data": [15, 17, 27, 30, 28, 54, 35, 43, 50, 35] }, { "name": "Journal Article", "data": [178, 162, 133, 139, 133, 191, 160, 194, 149, 169] }]
});
This works, but I need to pass the variable and specify manually.