I need to create a pie chart on commerce orders according to user roles (for example, how many orders for people with a specific role).

I have tried with Views and Charts but the aggregation on user:roles does not seem to work well.

Is there a way to build this chart?

EDIT : if not a chart, a table will do the trick, but I can not find the way to build a two column table, one with the role label, the second with the number of orders related to people with this role? Aggregate seems to work really bad with user:roles (duplicates, false numbers, invisible fields if aggregation activated before adding the field...) but I guess someone has already built a View like this? Any idea?

  • Did you try just writing a sql query and outputting it as table in a block? Views can't always do everything. – Kevin Dec 14 '18 at 16:01

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.