Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grouped Categories #18923

Open
ghost opened this issue Jul 24, 2023 · 6 comments
Open

Grouped Categories #18923

ghost opened this issue Jul 24, 2023 · 6 comments
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@ghost
Copy link

ghost commented Jul 24, 2023

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

@ghost ghost added the new-feature label Jul 24, 2023
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Jul 24, 2023
@helgasoft
Copy link

use second (grouping) X-axis
Demo Code
image

@ysk3a
Copy link

ysk3a commented Dec 27, 2023

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
Copy link

The smaller the chart container is the labels just disappear.

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

@ysk3a
Copy link

ysk3a commented Jan 9, 2024

  • I think, i'll need some time with the echarts api. thanks for sharing! I'll check out the interval attribute.

  • at this point i'm being nitpicky but on very narrow chart container the labels disappear still. 😛 (i don't think anyone will view a chart that narrow anyways)
    would be a nice-to-have feature if echarts could natively handle this to change orientation of labels in addition ellipsis(in the scenario where labels are very long) depending on size of container like
    image

@ggregoire
Copy link

@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
Copy link

helgasoft commented Jan 12, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

3 participants