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

Stacked bar chart plotted as staircased #649

Open
AdityaTiwari2102 opened this issue Nov 19, 2019 · 3 comments
Open

Stacked bar chart plotted as staircased #649

AdityaTiwari2102 opened this issue Nov 19, 2019 · 3 comments

Comments

@AdityaTiwari2102
Copy link

I am using this gem for generating the excel charts on ruby on rails. My requirement is to generate a stacked bar chart but it is generating in a staircase format refer the image here. To generate the chart I have used the following code,

sheet.add_chart(Axlsx::BarChart, start_at: "B5", end_at: "I20", title: "Test Title", grouping: :stacked) do |chart|
    chart.barDir = :col
    chart.add_series(data: sheet["C3:E3"], labels: sheet["C2:E2"], title: sheet["C1"])
    chart.add_series(data: sheet["F3:H3"], labels: sheet["C2:E2"], title: sheet["F1"])
  end

When I manually edit the generated chart in Microsoft Excel and set Series Overlap to 100%, I'm getting the desired output refer the image here.

@AdityaTiwari2102
Copy link
Author

@randym Request for help

@menporulporiayalan
Copy link

Have you tried chart.grouping = :stacked method? I think it should solve your issue.

@AdityaTiwari2102
Copy link
Author

AdityaTiwari2102 commented Dec 31, 2019

@menporulporiayalan - I tried that too, it is not working. Moreover, I have defined the grouping as stacked in add_chart as well (as mentioned in the sample code too), both generated the same result 😢.

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

No branches or pull requests

2 participants