Reputation: 1620
How do you go about specifying the series to display in a Chartkick bar chart?
Currently I have:
<%= bar_chart User.group(:user_type).count %>
Which works great. Say, however, that I have 3 different types of users: A, B, C. How do I only display A and B within the Chartkick bar chart?
Upvotes: 1
Views: 628
Reputation: 1620
And the answer is:
<%= bar_chart User.group(:user_type).where(:user_type => ["A", "B"]).count %>
Upvotes: 3