3

Using chartkicks for showing charts in rails.It works fine but in pie_charts it show only percentage .I want that count of data also shown.

enter image description here

My query now is

<%= pie_chart users.all.group('users.gender').count.map { |k, v| [User.genders.key(k), v] }.to_h %>
Nishith Kant Chaturvedi
  • 4,719
  • 2
  • 16
  • 24
Haseeb Ahmad
  • 7,914
  • 12
  • 55
  • 133
  • just checked out, it does shows the number for each of them. – Abhinay Feb 03 '16 at 05:26
  • 1
    it only show when move cursor on it.I want all time – Haseeb Ahmad Feb 03 '16 at 05:27
  • I am not sure about the way through Chartkicks but if you can store `Goal.group(:name).count` this value into a variable and then pass it to `pie_chart` and at the same time you can try printing the value next to it. I dont know if that will work, just a quick thought. :) – Abhinay Feb 03 '16 at 05:33
  • I update my question you can see my query. Which changes you say? – Haseeb Ahmad Feb 03 '16 at 05:37
  • 1
    I am sorry, it wont work this way just tried on my system. – Abhinay Feb 03 '16 at 06:11
  • Its not implemented yet I guess, I can see an open issue here regarding the same: https://github.com/ankane/chartkick/issues/80 – Abhinay Feb 03 '16 at 06:29

0 Answers0