Highcharts: Dynamically change single column width to highlight one sample

后端 未结 2 896
悲哀的现实
悲哀的现实 2020-12-21 09:13

In a Highcharts column chart we\'d like to highlight one value/sample by drawing its column a little bit wider... But this seems not to be possible, is it?

poi

2条回答
  •  心在旅途
    2020-12-21 09:21

    I don't see any way to do this with the current API. As an equally not nice solution you could adjust the SVG after the plot is drawn:

    // make fifth bar of first series wider
    var bar = $($('.highcharts-series').children()[4]);
    bar.attr('width',parseInt(bar.attr('width'))+20);
    bar.attr('x',parseInt(bar.attr('x'))-10); // keep it centered
    

    Fiddle here.

提交回复
热议问题