Highcharts JS를 사용하여 그래프를 플롯하려고합니다. https://api.myjson.com/bins/gdpu7
원격 JSON 파일에서 Highcharts 그래프 플롯
receive_date
X 축이어야하며 responses
는 Y 축해야한다 -이 : 나는 JSON 파일 같은,
[{"receive_date":"2013-11-04","responses":"2"}]
JSON있다. 원격 JSON 데이터를로드하고이를 Highcharts로 전달하고 있습니다. 그러나 X 축 receive_date
키를 할당하고 Y 축 responses
키를 할당하는 것이 좋습니다.
JSFiddle : -
http://jsfiddle.net/273x2f13/1/
// Create the chart
$.getJSON("https://api.myjson.com/bins/gdpu7", function(data){
chart: {
type: 'column'
},
title: {
text: 'Date Vs Rsponses'
},
subtitle: {
text: 'Chart View Here'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Responses'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
series: [{
x: 'receive_date',
y: 'responses'
colorByPoint: true,
data: data
}]
});
내가주는이 사용하고는 X 축과 Y 축 값입니다. 그러나 올바른 것은 아닙니다.
series: [{
x: 'receive_date',
y: 'responses'
colorByPoint: true,
data: data
}]