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

Option for stacked bar chart #4

Open
jarrettyew opened this issue Oct 29, 2017 · 3 comments
Open

Option for stacked bar chart #4

jarrettyew opened this issue Oct 29, 2017 · 3 comments

Comments

@jarrettyew
Copy link

jarrettyew commented Oct 29, 2017

I am using this gem (chart js) for my generating radar and bar charts on pdf. It works great. However, I couldn't find the option for stacked bar chart. Are they included in the gem?

I'm looking for this chart:

image

Currently, this is the chart I have generated.

image

I tried to look for alternative such as chart-js-ror. It has the stacked bar chart option but rendering pdf causes a lot of issues, particularly label inconsistency and responsive problems. And also the pdf generated has some blurred lines. Just wonder if there's such option and sharper image for the chart in this gem. Thanks.

@jarrettyew
Copy link
Author

Found the solution. The stacked bar chart is only available after v2.1 chart.js. Happens that your gem has the source code for the bar charts on v2.2 except there's only preset data for displaying the charts.

I've overridden the method with extra arguments for size and data, just like in chart.js v1. Would you review it once I submit a new request?

@ytbryan
Copy link
Owner

ytbryan commented Oct 30, 2017

sure do! please do that.

And you are looking specifically at this stack bar http://www.chartjs.org/docs/latest/charts/bar.html#stacked-bar-chart

Feel free to let me know if you encounter problem 🙂 @yewness

@sameersharma25
Copy link

I am trying to use chart gem to render highcharts. But each time I do <%= hBar %> or any chart tye prefixed with a h I get the undefined method `hBar' for #<#Class:0x0000000ae206a8:0x000000072e9aa8> error. Same with the gBar

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

3 participants