chart icon indicating copy to clipboard operation
chart copied to clipboard

Option for stacked bar chart

Open jarrettyew opened this issue 8 years ago • 3 comments

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 avatar Oct 29 '17 07:10 jarrettyew

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?

jarrettyew avatar Oct 30 '17 15:10 jarrettyew

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

ytbryan avatar Oct 30 '17 15:10 ytbryan

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

sameersharma25 avatar Apr 22 '18 19:04 sameersharma25