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

Boxplot overlaps with other chart types (ie. bar) by default - how to change that so the different types are side by side? #100

Open
sqmch opened this issue Feb 1, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sqmch
Copy link

sqmch commented Feb 1, 2024

Hi there,

By default, chartjs behaves so that if you have multiple datasets with the same chart types (such as bar and bar, or boxplot and boxplot), they divide the category space between them and appear side by side. Boxplot + boxplot also behaves that way, however I'm building something that allows the addition of various datasets with different chart types and am having an issue where the boxplot overlaps bar charts instead of them being side by side.

I saw in the docs an example of the same behaviour, so it seems that it is perhaps intended, however I'd like to figure out how to make for example a bar and a boxplot appear side by side instead of overlapping. Could you point me in the right direction?

Example of how two datasets with type "bar" automatically appear side by side (desired behavior with boxplot and bar):

Example 1

Current behavior with boxplot and bar

Example 2

@sqmch sqmch added the question Further information is requested label Feb 1, 2024
@sgratzl
Copy link
Owner

sgratzl commented Feb 3, 2024

I'm not sure whether this is possible. The grouped bar chart is handled by a single BarController, while here there are two controllers in place. You might be able to play with barPercentage to make the bar and boxplot smaller and then find a way to shift one to the left and the other to the right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants