How to fix hidden dataLabel in highcharts?

岁酱吖の 提交于 2019-12-02 02:42:56

问题


Please take a look at JSFIDDLE. Here, the green bar doesn't display any value. I know adding overflow:"none", crop:false will display the value. But it goes out of plotting area, sometimes for larger numbers it overlaps title. I would like to get green bar value (ONLY) inside the bar instead of hiding the value.


回答1:


For particular column (i.e green column) label value to be inside, you can add attribute inside: true in data .Refer dataLabels.inside for more info

 series: [{
    color: colors[0],
    showInLegend: false,
     data: [{
     ....//first value
     , {
      y: 3500,
      name: 'Second',
      color: colors[1],
      dataLabels: {
        inside: true //labels  will be inside column
      }
    },... // third and remaining
   });

Fiddle demonstration



来源:https://stackoverflow.com/questions/45678049/how-to-fix-hidden-datalabel-in-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!