我正在加载带有动态数据的条形图.在单击任何条形图时,它会向下钻取到由动态数据构成的折线图.问题是当我点击"返回"按钮时,条形图显示不正确.他们减少一半,如图图像.但是当图表滚动一点时,所有条形都显示得很好.图表图像按步骤顺序显示四个图表.
以下是代码示例:
Highcharts.chart(div_id, {
chart: {
type: type,
height: height,
width: 800,
inverted:true,
events: {
drilldown: function (e) {
if (drill=="yes"){
if (!e.seriesOptions) {
var chart = this;
chart.inverted = false;
chart.showLoading('Loading ...');
var node=e.point.name.toLowerCase();
drill_ajax(x,y,z).done(function(r){
temp=r["dropdowns"];
dropdownlines=r["drilldownsLines"];
selected_valforpatdata=e.point.name.toLowerCase();
var seriesLine = dropdownlines[e.point.name];
var max_len=seriesLine.data.length;
var points = []
seriesLine.data.forEach(function (theData) {
points.push(theData[1]);
});
chart.legend.update({enabled:true});
chart.xAxis[0].update({max:(max_len > 7) ? 7 : max_len-1});
chart.yAxis[0].update({
max: Math.max.apply(Math, points)
});
chart.addSingleSeriesAsDrilldown(e.point, seriesLine);
chart.applyDrilldown();
chart.hideLoading();
});
} …Run Code Online (Sandbox Code Playgroud)