Highcharts stacked bar chart hide data labels not to overlap

前端 未结 1 1268
太阳男子
太阳男子 2021-01-06 00:13

Please check out this: http://jsfiddle.net/HA5xE/

So, I have stacked bar chart and I want to hide data labels when they don\'t fit in the area. for Example in Catego

相关标签:
1条回答
  • 2021-01-06 00:44

    You can iterate in each point in each serie, then check width of bar and destroy label if widht is smaller than ie.15px .

    http://jsfiddle.net/HA5xE/1/

     $.each(chart.series,function(i,serie){
            $.each(serie.data,function(j,data){
                if(data.yBottom - data.plotY < 15)
                    data.dataLabel.destroy();
            });
        });
    
    0 讨论(0)
提交回复
热议问题