0
我試圖在「向下鑽取」內給「數據」一些值。但是我總是收到一條錯誤消息,指出「data.drilldown」沒有被定義「我在做什麼wong?它與下面代碼最後一行的語法有關,我嘗試了十幾個不同的選項來定義data.drilldown.data但我不找到合適的解決方案。爲javascript數組賦值
PLZ給我一些幫助:)
溴。
<script type="text/javascript">
$(document).ready(function() {
var colors = Highcharts.getOptions().colors,
categories = ['MSIE', 'Firefox', 'Chrome', 'Safari', 'Opera'],
name = 'Browser brands',
data = [
{
y: 55.11,
color: colors[0],
drilldown: {
name: 'MSIE versions',
categories: ['MSIE 6.0', 'MSIE 7.0', 'MSIE 8.0', 'MSIE 9.0'],
data: [{}],
color: colors[0]
}
},
{
y: 55.11,
color: colors[0],
drilldown: {
name: 'MSIE versions',
categories: ['MSIE 6.0', 'MSIE 7.0', 'MSIE 8.0', 'MSIE 9.0'],
data: [{}],
color: colors[0]
}
}
];
var url = "php/live-server-data.php?callback=?";
$.getJSON(url, function(data) {
*data.drilldown.data = data;*
});
..