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

Fix stacked bar chart #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

marcus-deans
Copy link

Allows stacked bar chart to stack as per ECharts instead of superimposing.

Consider

<%= stacked_bar_chart [
                                              { name: 'Pending', data: {'Jan 1' => 5, 'Jan 2' => 6, 'Jan 3' => 10}},
                                              { name: 'Done', data: {'Jan 1' => 6, 'Jan 2' => 4, 'Jan 3' => 1}}
                              ],
                              {
                                options: {
                                  title: {
                                    text: "Popular vs Unpopular"
                                  },
                                },
                                class: 'box',
                                vertical: true
                              } %>

yields
image

With this change, the same code yields
image

Not sure if it's meant to be extensible. I've tried to add stack: 'stack' in multiple places with the existing code, but it's unclear how to fix it. If this already exists properly, adding the explanation to the docs would be great

@manastyretskyi
Copy link
Contributor

@marcus-deans First of all thanks for opening this PR. I tried to replicate behaviour on your screenshots, but for me chart looks the same no matter if I use current version or version with changes that you've proposed. Can you add more context on what the issue is?

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

Successfully merging this pull request may close these issues.

2 participants