Reporting on number of subscribers per plan
I'm working on the administrate dashboard to add some (very) basic charts via Chartkick. What i'm trying to do is build a pie_chart that shows how many active subscribers there are for each of my plans. However, i'm coming unstuck and not sure if this could be done via a joins query or another way.
So if I keep with the basics, I can achieve this:
So if I keep with the basics, I can achieve this:
<%= pie_chart Pay::Subscription.group(:processor_plan).count, donut: true %>
This then gives me a pie_chart broken down by processor_plan, however the labels are showing the processor_plan. I would much rather this show the plan name, but i'm unsure how to include this in the query.
Thanks in advance for any support.
Notifications
You’re not receiving notifications from this thread.