2017-02-21 64 views
0

我使用HighCharts做出3级钻取的X轴项的最大数量。是否有HighCharts

当我在第二级使用了50个项目,该项目的文本将不再显示在左侧。点击第一项(家长1),然后你会看到第二级和什么不显示。

这是由于我使用JSON数据量?

这里是我使用的图表

let options = { 
chart: { 
    type: 'bar', 
    events: { 
     drilldown: function (e) { 
      if (e.seriesOptions) { 
       e.seriesOptions.hiddenValue = e.point.options.hiddenValue; 
      } 
     } 
    } 
}, 
title: { 
    text: 'Overall Status' 
}, 
xAxis: { 
    type: 'category', 
    labels: { 
     style: { 
      fontSize: '15px' 
     } 
    } 
}, 
yAxis: { 
    title:{ 
      text: "Percentage Complete" 
     }, 
    labels: { 
     style: { 
      fontSize: '15px' 
     } 
    } 
}, 

legend: { 
    enabled: false 
}, 

plotOptions: { 
    series: { 
     borderWidth: 0, 
     dataLabels: { 
      enabled: true, 
      style: { 
       fontSize: '20px' 
      } 
     }, 
     cursor: 'pointer', 
     point: { 
      events: { 
       click: function() { 
        let seriesOptions = this.series && this.series.options; 
        let hiddenValue = seriesOptions && seriesOptions.hiddenValue; 
        if(this.options && this.options.url) { 
         location.href = this.options.url + '?id=' + hiddenValue; 
        } 
       } 
      } 
     } 
    } 
}, 
series: [{ 
    name: 'Status', 
    colorByPoint: true 
}], 
drilldown: { 
} 
}; 

的代码,我这里有一个小提琴具有JSON数据。 https://jsfiddle.net/mark2017/yb3y9dt9/

+0

是的,这是由于空间量。 IIRC,酒吧将全部显示,但标签不会。 – user3080953

回答

2

您可以看到第一个下钻不是从0值开始,而是从10开始 - 就像它将计入顶层系列中的所有值一样。这是这是已经在github上报道了一个错误:Drilldown to more than 50 - skip categories name

设置cropTreshold了一些比你的所有点的数量越大,似乎在你的案件的工作 - 它必须为所有的系列,例如设置在plotOptions.series

plotOptions: { 
    series: { 
    cropThreshold: 2000, 
    borderWidth: 0, 

例如:https://jsfiddle.net/hfpofx28/

+0

谢谢你,我已经尝试了改变,是的,名称现在显示,但仍不显示超过50项? – user813813

+0

通过项目,你的意思是标签或列?如果标签碰撞他们中的一些会被隐藏起来 - 克服这一集labels.step = 1 - 如果你的意思是数据标签,你需要allowOverlap设置为true。 https://jsfiddle.net/hfpofx28/1/ – morganfree