Pro bar chart custom sort?

2461
9
07-20-2017 06:23 AM
BrandonFlessner
Occasional Contributor

I'm making a bar chart that graphs car accidents by the day of the week the accident occurred. The problem is that the bar chart automatically sorts alphabetically by category. I want to have the days of the week in order ( mon, tue, wed, thurs etc.) not alphabetically (fri, mon, sat, sun, thurs, tues, wed). Is there a way to do this?

Note I tried using a numeric field which worked to get the days in the correct order, but then the axis labels were 0, 1, 2 etc. which is not what I'm after (See below). I couldn't find anyway to alter the labels. I tried using a coded value domain, ( 0 = Monday, 1 = Tuesday etc.) but the chart resorted back to alphabetical order. I also tried using a date field where I coerced all the dates into one week but the labels were again not satisfactory (1/5/2015 for Monday) and I couldn't find a way to format the date labels to show day of week. 

Accidents by the day of week bar chart with incorrect labels

0 Kudos
9 Replies
Nicole_Ueberschär
Esri Regular Contributor

It's a pity that nobody commented on this issue yet. 

I am running into a similar problem with categories that show ranges of income but would sort alphabetically in the chart. It would be nice if the chart would take over the sorting of the legend for example where I can easily put the categories in the right order. 

ShawnCW
New Contributor

I am having the exact same issue as Brandon. I am unable to sort the x-axis on a bar chart and/or customize the x-axis labels. If a text field is used to create the bar chart, the bars are displayed in alphabetical order (i.e.: Friday, Monday, Sunday, etc.).  If a numeric field is used to create the bar chart the bars are displayed in numerical order but that's not user-friendly for the end-user. I need to be able to sort the text by day of week (Sunday, Monday, Tuesday, etc.) or at least edit the x-axis labels to read, Sunday (rather than 0), Monday (rather than 1) etc.

We run these types of charts all day long so a quick or automated method of being able to sort them by day of week would be the preferred so we don't have to hand-edit the numeric labels every time.

KoryKramer
Esri Community Moderator

Brandon posted this idea - https://community.esri.com/ideas/15823 

ShawnCW
New Contributor

Has anyone discovered a way to custom sort/order the x-axis (string) values or, at least, to manually edit the x-axis labels?

0 Kudos
KevinMayall
Occasional Contributor III

I have a chart of polygon areas, but I want to show them from smallest area to largest area, in order to display the distribution in an intuitive way.  I can only pick a category (e.g. polygon id/name), so I'd like to (1) be able to pick a numeric field, and (2) sort it ascending or descending.

Kevin
0 Kudos
KevinMayall
Occasional Contributor III

I just noticed that there is a Sort droplist on the toolbar immediately above the chart in ArcGIS Pro.

Also, I figured out I could create a new text field to hold a string version of the ShapeArea field values, and then use that for the x axis.

Why do these discoveries not happen before I post to a forum?  🙂

Kevin
FloraVale
Esri Contributor

So we can all benefit from your thought process!

Robert_LeClair
Esri Notable Contributor

It looks like the custom sort for charts was implemented in the just released ArcGIS Pro 2.6 - https://community.esri.com/ideas/15823 !

JenRankin
New Contributor

for some reason i dont have permission to view the link above.  i finally was able to get my dates in order but i can't get my other axis to be in the order that i want.  i am also new to pro and haven't been looking all over for an answer. 

0 Kudos