dmt2989
dmt2989

Reputation: 1620

Chartkick bar chart: specify which series to display

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

Answers (1)

dmt2989
dmt2989

Reputation: 1620

And the answer is:

<%= bar_chart User.group(:user_type).where(:user_type => ["A", "B"]).count %>

Upvotes: 3

Related Questions