我正在使用highchart来显示一些图表,这些图表分3步进行深入分析。调用API并获取第2步的数据。现在单击第二步点,将渲染第三步。有多个带有钻取事件的图表,其中 我为此使用了同步请求,它正在工作,但问题是所有highchart事件请求都被一个接一个地调用。 我无法识别出确切的问题。帮帮我
service.dataUsesChart = function(scope,id,regionList,companyList,fromDate,toDate){
scope.currentPoint = '';
var dataUses = Highcharts.chart(id, {
chart: {
type: 'column',
events: {
drilldown: function (e) {
if (!e.seriesOptions) {
var chart = this,
drilldowns = {};
var reqBody = {
"companyCode" : e.point.companyCode,
"fromDate" : fromDate,
"toDate" : toDate
}
var drillDownName = e.point.drilldown;
$.ajax({
method: "POST",
async : false,
url: myURL,
data: JSON.stringify(reqBody),
contentType: "application/json",
dataType: 'jsonp',
jsonp : false,
success: function(res){
drilldowns[drillDownName]['data'] = res;
series = drilldowns[drillDownName];
chart.addSeriesAsDrilldown(e.point, series);
},error:function(e){
console.log(e);
}
});
}
}
}
},
title: {
text: ''
},
lang: {
drillUpText: 'Back'
},
xAxis: {
type:'category',
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
formatter: function () {
return this.series.name+' : '+this.y+' '+this.point.unit ;
}
}
}
},
series: regionList,
drilldown: {
drillUpButton: {
position: {
align: 'left'
}
},
series: companyList
}
})
}