highChart
여러 번 시도한 것을 사용하여 데이터를 선형 차트로 표시 하려고합니다. 이것들은 내가하려고했지만 차트는 여전히 비어 있습니다!
<script>
$(document).ready(function() {
var options={
chart: {
renderTo: 'container',
type: 'line'
},
title : {
text: 'Monthly Average Temperature'
},
subtitle : {
text: 'Source: WorldClimate.com'
},
xAxis : {
categories: ['11','jj','jj','11']
},
yAxis :{
title: {
text: 'Temperature (\xB0C)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip : {
valueSuffix: '\xB0C'
},
legend : {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series : [{}]
}
$.ajax({
type: 'GET',
contentType : 'application/json',
dataType: 'JSON',
url: 'json',
data: "",
success: function(data){
var array=[] ;
$.each(data, function(i) {
array.push(data[i].id);
})
alert(array);
options.series[0]= array;
var chart = new Highcharts.Chart(options);
}
});
});
</script>
여기 alert(array);
에서 json의 값 배열을 올바르게 반환합니다. 하지만 여전히 series
! 제발 도와주세요?
series[0]
데이터가 특정 형식이어야합니다.
하는 대신 options.series[0]= array;
하다,
options.series[0]= {"data":array};
작업 바이올린
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다