How to put the value of different categories on a high-graph X-Axis

I want to use different data to create different bar charts. (just like a line chart, I can click the small icon at the bottom and then change the chart), but I have a problem, each information has different categories in X-Axis, which means that when I change the data, with them categories are changing.

I cannot figure out how to do this, for example:

I have some data in the bar charts:

series: [{ name: 'name', data: data, color: 'white' }, {name: 'name', data: data, color: 'white'}]

In addition, each information has a different category.

 categories: cataTitle1,cataTitle2 

Can't I change categories when changing data?

+4
source share
1 answer

You need several axes and several series with a column diagram. Here is a demo. You can also use several YAxis. Highchart Demo will help you in the details.

  series: [{ name: 'Rainfall', color: '#4572A7', type: 'column', data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4] }, { name: 'Sea-Level Pressure', type: 'column', color: '#AA4643', xAxis: 1, data: [1016, 1016, 1015.9, 1015.5, 1012.3, 1009.5, 1009.6, 1010.2, 1013.1, 1016.9, 1018.2, 1016.7], marker: { enabled: false }, dashStyle: 'shortdot' }] 
+2
source

Source: https://habr.com/ru/post/1446416/


All Articles