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!


Tagged:

Best Answer

  • MarkSnodgrass
    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 <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

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!**
  • @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.

  • MarkSnodgrass
    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 <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • @GrantSmith and @MarkSnodgrass Thank you so much!!!