Highcharts: Dynamically change single column width to highlight one sample

后端 未结 2 891
悲哀的现实
悲哀的现实 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.

    0 讨论(0)
  • 2020-12-21 09:24

    You can also use data attribute and modify width.

    http://jsfiddle.net/cDvmy/2/

     chart.series[0].data[0].graphic.attr({
                width:50
            });
    
    0 讨论(0)
提交回复
热议问题