1
我需要在Highcharts中從數組中設置一些Xaxis值。Highcharts從數組中設置xaxis值
print_r($monthName);
我有數組:Array ([0] => August [1] => September [2] => October [3] => November [4] => December [5] => January)
。
我的代碼是:
<script>
$(function() {
var monthNameData = [];
monthNameData.push({
data: ['<?php echo join ($monthName, ',') ?>']
});
$('#iw').highcharts({
chart: {
...
xAxis: {
categories: monthNameData[0].data
},
series: ...
});
});
我的結果是:
謝謝
非常感謝你。它正在工作。 –