How to reorder variable categories in legend and how to remove the total section in a pie chart?
I feel like I've tried everything... could really use some advice!
How to reorder variable categories in legend? The sorting function is not really working and I would want to avoid renaming the variable categories (this issue is also prevent in other cards).
Also, does anyone know how to remove the total section in a pie chart?
Thank you in advance!
Best Answer
-
@svetlana what Grant is saying is that you need to have two beast modes, one to be used for display purposes on your chart and one to be used in the sorting properties. They will have the same case statement syntax in them, just the sorting properties beast mode will result in a numerical value rather than a string. This way, the sorting can function properly. Here's an example from one of my cards:
Category for Display (used in the pie name field):
(CASE when `totalreported` < 250000 then '0-250k' when `totalreported` < 1000000 then '250k-1m' when `totalreported` < 2000000 then '1-2m' else '2m+' end)
Category for Sorting (used in the sorting properties):
(CASE when `totalreported` < 250000 then 1 when `totalreported` < 1000000 then 2 when `totalreported` < 2000000 then 3 else 4 end)
Also, it appears that pie charts behave slightly differently than other cards in this area. You also need to go to the General Properties and select No Auto Sort or else adding this beast mode to the sorting properties will have no impact.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2
Answers
-
To fix the sorting create a new beast mode and then have it return as specific numerical value (1-4) and then use that to sort your pie chart. That will reorder the legend in the order you define.
To remove the Total under your chart properties - Hover Legend - Title Value set that equal to None
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
@GrantSmith thank you so much!
Do you think that there is no other way to go about the category order? I would much rather keep the names as is.
0 -
@svetlana what Grant is saying is that you need to have two beast modes, one to be used for display purposes on your chart and one to be used in the sorting properties. They will have the same case statement syntax in them, just the sorting properties beast mode will result in a numerical value rather than a string. This way, the sorting can function properly. Here's an example from one of my cards:
Category for Display (used in the pie name field):
(CASE when `totalreported` < 250000 then '0-250k' when `totalreported` < 1000000 then '250k-1m' when `totalreported` < 2000000 then '1-2m' else '2m+' end)
Category for Sorting (used in the sorting properties):
(CASE when `totalreported` < 250000 then 1 when `totalreported` < 1000000 then 2 when `totalreported` < 2000000 then 3 else 4 end)
Also, it appears that pie charts behave slightly differently than other cards in this area. You also need to go to the General Properties and select No Auto Sort or else adding this beast mode to the sorting properties will have no impact.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
@GrantSmith and @MarkSnodgrass Thank you so much!!!
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive