column-drilldown数据显示问题,打注释的部分数据传过来为什么一直没有效果
$(function () {
$.getJSON("../Models/AnnualSalesHandler.ashx", function (data) {
$.getJSON("../Models/AnnualSalesHandler.ashx?id=1", function (drilldowns) {
// alert(drilldowns);
$('#containers').highcharts({
chart: {
type: 'column'
},
title: {
text: '网吧销售记录总计'
},
subtitle: {
text: '详细情况如下:'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: '销量:元'
}
},
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><br/>'
},
series: [{
name: "金额",
colorByPoint: true,
data: data
}],
drilldown: {
series:drilldowns
//[{
// name: "香烟",
// id: "1",
// data: [
// [
// "1月", 24.13],
// [
// "2月", 17.2],
// [
// "3月", 8.11],
// [
// "4月", 5.33],
// [
// "5月", 1.06],
// [
// "6月", 0.5],
// [
// "7月", 24.13],
// [
// "8月", 17.2],
// [
// "9月", 8.11],
// [
// "10月", 5.33],
// [
// "11月", 1.06],
// [
// "12月", 0.5]
// ]
//}, {
// name: "Chrome",
// id: "2",
// data: [
// [
// "v40.0", 5],
// [
// "v41.0", 4.32],
// [
// "v42.0", 3.68],
// [
// "v39.0", 2.96],
// [
// "v36.0", 2.53],
// [
// "v43.0", 1.45],
// [
// "v31.0", 1.24],
// [
// "v35.0", 0.85],
// [
// "v38.0", 0.6],
// [
// "v32.0", 0.55],
// [
// "v37.0", 0.38],
// [
// "v33.0", 0.19],
// [
// "v34.0", 0.14],
// [
// "v30.0", 0.14]
// ]
//}, {
// name: "Firefox",
// id: "3",
// data: [
// [
// "v35", 2.76],
// [
// "v36", 2.32],
// [
// "v37", 2.31],
// [
// "v34", 1.27],
// [
// "v38", 1.02],
// [
// "v31", 0.33],
// [
// "v33", 0.22],
// [
// "v32", 0.15]
// ]
//}]
}
});
});//second getjson end
});//first getjson end
});//$end
$.getJSON("../Models/AnnualSalesHandler.ashx", function (data) {
$.getJSON("../Models/AnnualSalesHandler.ashx?id=1", function (drilldowns) {
// alert(drilldowns);
$('#containers').highcharts({
chart: {
type: 'column'
},
title: {
text: '网吧销售记录总计'
},
subtitle: {
text: '详细情况如下:'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: '销量:元'
}
},
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><br/>'
},
series: [{
name: "金额",
colorByPoint: true,
data: data
}],
drilldown: {
series:drilldowns
//[{
// name: "香烟",
// id: "1",
// data: [
// [
// "1月", 24.13],
// [
// "2月", 17.2],
// [
// "3月", 8.11],
// [
// "4月", 5.33],
// [
// "5月", 1.06],
// [
// "6月", 0.5],
// [
// "7月", 24.13],
// [
// "8月", 17.2],
// [
// "9月", 8.11],
// [
// "10月", 5.33],
// [
// "11月", 1.06],
// [
// "12月", 0.5]
// ]
//}, {
// name: "Chrome",
// id: "2",
// data: [
// [
// "v40.0", 5],
// [
// "v41.0", 4.32],
// [
// "v42.0", 3.68],
// [
// "v39.0", 2.96],
// [
// "v36.0", 2.53],
// [
// "v43.0", 1.45],
// [
// "v31.0", 1.24],
// [
// "v35.0", 0.85],
// [
// "v38.0", 0.6],
// [
// "v32.0", 0.55],
// [
// "v37.0", 0.38],
// [
// "v33.0", 0.19],
// [
// "v34.0", 0.14],
// [
// "v30.0", 0.14]
// ]
//}, {
// name: "Firefox",
// id: "3",
// data: [
// [
// "v35", 2.76],
// [
// "v36", 2.32],
// [
// "v37", 2.31],
// [
// "v34", 1.27],
// [
// "v38", 1.02],
// [
// "v31", 0.33],
// [
// "v33", 0.22],
// [
// "v32", 0.15]
// ]
//}]
}
});
});//second getjson end
});//first getjson end
});//$end
1 个回复
jsbome - 个人博客:http://highcharts.daxueba.net
赞同来自:
series:drilldowns
这里写错了。series后面不需要加drilldowns