How to Reverse Order of Legend in ArcGIS Operations Dashboard

2578
6
Jump to solution
04-07-2020 05:54 PM
SeanTovar
New Contributor

Hello!

I am an ArcGIS Beginner and looking for feedback on how to reverse the order of the legend from a Series chart that is created from an existing layer.

I'm mapping COVID-19 cases by age and the age legend is stacked the opposite of what the stacked bar chart looks like. I'm looking to reverse the order of the legend so that "age0" corresponds to the bottom of the legend, and bottom of the stack, followed by "age20" and so on. Is there a way to do this without creating a custom widget using the ArcGIS Javascript API?

Thanks!

0 Kudos
1 Solution

Accepted Solutions
DerekLaw
Esri Esteemed Contributor

Hi Sean,

> I'm looking to reverse the order of the legend so that "age0" corresponds to the bottom of the legend, and bottom of the stack, followed by "age20" and so on.

Unfortunately, there is no way to "re-order" the legend categories. But this is a good enhancement request, please post on the ArcGIS Ideas site for ArcGIS Dashboards.

> Is there a way to do this without creating a custom widget using the ArcGIS Javascript API?

This isn't possible either, as ArcGIS Dashboards does not support any custom development. Sorry.

FYI, since you mentioned you're new to ArcGIS Dashboards a good resource: https://community.esri.com/community/gis/applications/arcgis-dashboards/blog/2019/03/01/operations-d... 

Hope this helps,

View solution in original post

6 Replies
DerekLaw
Esri Esteemed Contributor

Hi Sean,

> I'm looking to reverse the order of the legend so that "age0" corresponds to the bottom of the legend, and bottom of the stack, followed by "age20" and so on.

Unfortunately, there is no way to "re-order" the legend categories. But this is a good enhancement request, please post on the ArcGIS Ideas site for ArcGIS Dashboards.

> Is there a way to do this without creating a custom widget using the ArcGIS Javascript API?

This isn't possible either, as ArcGIS Dashboards does not support any custom development. Sorry.

FYI, since you mentioned you're new to ArcGIS Dashboards a good resource: https://community.esri.com/community/gis/applications/arcgis-dashboards/blog/2019/03/01/operations-d... 

Hope this helps,

SeanTovar
New Contributor

Thanks Derek!

Bob_Spaulding
New Contributor III

Hi Derek Law‌,

At the risk of seeming annoying (not trying to be), surely there is some cue, intended or not, that programatically determines the order of things in the legend.  I've seen some suggest that it was ObjectID or the like, that didn't seem to be it in my brief trials.  But something has to effectively determine the order, it isn't wholly random (unless you wrote a randomizing statement in the code for Ops Dashboard, but there'd be no reason for that). 

So just to ask one more time another way, I get that a slick interface-style fix doesn't exist, is there anything user-accessible that we could change on our end that would change the order?  Or is it based on some variable that is wholly behind the scenes?

0 Kudos
DerekLaw
Esri Esteemed Contributor

Hi Bob,

> So just to ask one more time another way, I get that a slick interface-style fix doesn't exist, is there anything user-accessible that we could change on our end that would change the order?

Currently, there is no way to "control" the legend categories in the dashboard. Sorry.

Please vote for the enhancement request, Ability to order the legend items in Operations Dashboard. 

EDIT: I did get an unsupported workaround suggestion from the Dev team: in the case of a serial chart with a split by field; if you configure two sort fields: the category field and the statistic field, then changing the 'ascending' or 'descending' property of the statistic field will change the order of the legend (and also the chart's columns) - this might meet your needs.

Hope this helps,

Bob_Spaulding
New Contributor III

Derek, I see what you mean - thanks so much!!

The approach as I think you imply won't always solve everything, depending on how I want the category axis sorted, but potentially big help in specific cases.

As I crunch through the formatting for fifteen or twenty of these charts, a very useful tool.  Thanks again!!

by Anonymous User
Not applicable

I have experienced this and it does work. The chart is sorted by the statistic value and the legend is sorted the same way. It's nice but more support for sorting the legend is crucial. I have supported the enhancement request.

Thank you,

Randy McGregor