Stacked column chart data format not obvious
How do you actually need to format data to generate a stacked column chart?
<%= column_chart data, stacked: true %>
This is the hash structure you get when you do something like Task.group(:x).group(:animal).count:
{[x1, "dog"] => 1, [x1, "pig"] => 4, [x2, "dog"] => 3, [x2, "pig"] => 5}
I was hoping that would just work, but no such luck.
Also tried using Google's structure but that didn't work either https://developers.google.com/chart/interactive/docs/gallery/columnchart#StackedColumns
Use the same format as multiple series. I have a branch to support the double group format for #70
Ah, that makes sense! Works like a charm. Thanks!
Looking forward to #70.
This should make things easier.
Can you please give an example of how the data needs to be constructed? I can't seem to create a stacked chart..
I still can't figure out how to format data for stacked chart. Can someone give an example please?
Thanks.