I have a bar chart that shows revenue by different segments for each hour in a day. I would like to order each hours revenue data in the bar chart by segment in ascending order. I have pre-sorted the data so that the data is sorted by Time/Date then by Revenue but when I get to PROC GCHART and run the bar chart, each hour is sorted by the Revenue Segment Name, not the Revenue number.
Can I tell it to use the data order (ORDER=DATA) so that my pre-sorted data is preserved in the bar chart?
Share your GCHART code please, and ideally some data sample for detail. I know that GCHART stacked-bar "segments" are sorted alphabetically, and so you must use either a SAS PROC FORMAT to map your desired segment order or hardcode the list in your AXIS statement(s), as desired.
Here's a Google advanced search argument which will generate some interesting technical paper, and other DOC references on the SAS support website http://support.sas.com/ for your reference:
The GCHART/VBAR parameter SUBGROUP=Congestion_Name controls the bar segment order alphabetically, as mentioned in the DOC. If you want your segments to be ordered otherwise, you will need to build a SAS format, such as a numeric ranking variable, based on CONGESTION_REVENUE, and display the variable value Congestion_Name as the "formatted" variable in your chart. Then apply your formatted value for variable CONGESTION_REVENUE for your SUBGROUP= parameter.