Highcharts Grouped Data In Subgroup

2019-07-13 04:11发布

问题:

is it possible to achieve this? I need to draw a graph and it's based on categories. Each category will have an subcategory and this will an aggregator.

This will be a column bar chart and i must draw something like this. Look.

Exaplanation:

Agg 1 and 2 will be fixed categories in xAxis. But Cat 1, Cat 2, Cat... will be dynamic over it. Data will be the column bars in the specified Cat group.

I dunno if this graph can handle what i want and even if its possible. I only know how to draw simple graphs and don't found any example like this.

I've tried stacks but don't got what I want or used it wrong.

回答1:

There is not a built in way to achieve this in Highcharts.

One thing you can do is spoof it, using multiple x axes, making use of the axis offset property, and setting different categories and/or tickpositions on the different axes.

There is also a feature request that you can add your votes and/or comments to here:

http://highcharts.uservoice.com/forums/55896-general/suggestions/2230615-grouped-x-axis

Relevant thread from old help forum:

http://highslide.com/forum/viewtopic.php?f=9&t=16011



回答2:

Black Label has created plugin for Highcharts to achieve that: https://github.com/blacklabel/grouped_categories