rails_charts
rails_charts copied to clipboard
Fix stacked bar chart
trafficstars
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
With this change, the same code yields
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