apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.15k stars 19.6k forks source link

Grouped Categories #18923

Open ghost opened 1 year ago

ghost commented 1 year ago

What problem does this feature solve?

I'm changing plots on my websites from Highcharts to Echarts. I want a feature for grouped categories similar like this: http://blacklabel.github.io/grouped_categories/. If anyone can help? Thanks in advance.

What does the proposed API look like?

Provide grouped categories

helgasoft commented 1 year ago

use second (grouping) X-axis Demo Code image

ysk3a commented 8 months ago

Hi, it seems that demo code is not responsive and 'breaks' once the dimension of parent changes like when resizing the browser. The smaller the chart container is the labels just disappear.

i'm also looking for a performant chart library that has grouped categories like blacklabel's plugin but highchart+grouped_categories is very buggy when using with angular.

helgasoft commented 8 months ago

The smaller the chart container is the labels just disappear.

interval for axisLabel was not set, Try now with new Demo Code

ysk3a commented 8 months ago
ggregoire commented 8 months ago

@helgasoft Hi, I'm using your solution and it works great with an odd number of columns (e.g. 3 columns), the label is perfectly centered with the column in the middle.

Do you have a solution for an even number of columns (e.g. 4 columns)? I tried by adding some hardcoded paddings to center it between the second and third columns, but it won't be centered if your monitor resolution is different than mine.

Here I updated your demo if you want to take a look at the problem.

Thanks.

helgasoft commented 8 months ago

@ggregoire, nice try with the demo, but it is still not responsive (on size changes). I do not think centering is doable for even number of columns. 😓 Take a look at the demo in #19250 - a more complex, but maybe better solution. EDIT: centering and responsiveness is doable