BookmarkSubscribeRSS Feed
GustavSandberg
Calcite | Level 5

Hello all,

 

my goal is to display my data in a bar chart with 2 bars.

 

I have the data in one category, from which I want to use 5 variables.4 of these (A, B, C, D) should be blocks in bar 1. And the 5th (X) should be bar 2.

For this I have created a custom category using these 5 variables.

In setting up the customized category I created one value group "Bar 1" where i placed the 4 variables (A, B, C, D) for Bar 1, and another value group for "Bar 2" where I placed the 5th variable (X).

 

When I use my custom category in a bar chart, I now have two bars. One with A, B, C, D and one with X.

 

My question is:

In Bar 1. Can I customize the order of which A, B, C, D are stacked in the bar?

They are now, from bottom to top, placed as A, B, C, D. I see that I can right-click the bar chart and change the order between decending and ascending. This only gives me two display-options: A, B, C, D and D, C, B, A.

 

What if I want to display them as B, D, A, C ?

I have tried to edit the custom category and change the order there, but nothing happens. 

 

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20

Show us your code please.

GustavSandberg
Calcite | Level 5

I have done this is Visual Analytics using no code. Just dragged and dropped a bar chart and assigned data to it.

PaigeMiller
Diamond | Level 26

How are you creating the bar charts? Show us the code (in a code box, click on the little running man icon and paste the code into the window that appears; do not provide the code as a screen capture)

--
Paige Miller
Madelyn_SAS
SAS Super FREQ

Which version are you using? And can you post an example of how  your chart appears now 

GustavSandberg
Calcite | Level 5

Hi, 

 

Current version is SAS VA V.03.05M0P111119.

 

This is what the bar chart looks like. In the bar to the left, I want to place the middle block on the bottom.

(I always want the same order of the blocks, no matter the size of the blocks for the chosen period.) 

 

barchart.png

 

 

Best regards,

Gustav

Madelyn_SAS
SAS Super FREQ

You said that you tried changing the order in your custom category. Have you tired creating a custom sort? 

GustavSandberg
Calcite | Level 5

hi,

 

yes, I have tried changing order in my custom category.

Trying to create a custom sort on my custom category only allows me to change order of the value groups, but not the variables inside the value groups.

 

However, a colleague of mine did solve it earlier today by doing a custom sort on the original category, on which the custom cateogry was based.

 

Best regards,

Gustav

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 1475 views
  • 0 likes
  • 4 in conversation