Highcharts bar with non-stacked percent series

2019-07-05 00:05发布

问题:

I want to create Highcharts bar chart with non-stacked percentage values.

I use:

plotOptions.bar.stacking = 'percent'

But this stack all series on top another to get to 100%. I want each series to be rendered as different bar.

I there any way doing it other than processing series data myself?

回答1:

Yes, what you've specified there is how you want the chart to stack the bars, specifically.

To see labels/tooltips, etc as % of total, you'll need to loop through the data and calculate it all.

Then you use the formatters to output the right values for the axis labels, the tooltip, the data labels, etc

Example:

  • http://jsfiddle.net/JVNjs/320/