BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Schwami
Calcite | Level 5

Hi all, 

 

As example: 

I would like to chart the values of A B C D E on a clustered bar chart by region.

But I would like to combine the bars of B and C to a stacked bar chart, with the different variables still visible.

This is an easy task in other BI tools I've worked with but I can't seem to figure it out in VA 7.4.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Should your chart look like this?

va_measureClusterStack.png

If yes, then you can use the Custom Graph Builder, add two bar charts on top of each other change the group style of the second chart to stack, edit the measure for the two bar charts to allow for multiple data assignments. You also want to adjust discrete offset and maybe bar spacing.

 

Give it a go.

View solution in original post

7 REPLIES 7
BrunoMueller
SAS Super FREQ

Should your chart look like this?

va_measureClusterStack.png

If yes, then you can use the Custom Graph Builder, add two bar charts on top of each other change the group style of the second chart to stack, edit the measure for the two bar charts to allow for multiple data assignments. You also want to adjust discrete offset and maybe bar spacing.

 

Give it a go.

Schwami
Calcite | Level 5

Thanks for your assistance!

 

This was indeed what I was looking for. 

elkinsbe
Obsidian | Level 7

I'm looking to build the same *except* I need both bars to be stacked. -- I'm working in ver. 7.4 and it doesn't seem to be possible... Anyone have any ideas for me??? Thanks in advance!!

BrunoMueller
SAS Super FREQ

As mentioned you can use the Custom Graph Builder to define your own graph type, this will allow to do what you want.

 

But it also depends on how your data is structured.

 

So providing sample data and a mockup of your graph would help.

elkinsbe
Obsidian | Level 7

Thank you so much for your reply! -- Yes, I'm using the custom graph builder to drag in two bar graphs and setting them both to stacked vertical.

Ultimately, I wish to make a visualization that depicts the grocery expenditures by department by month YOY of two persons on the same graph (hence the two stacked bar charts).

 

So, we can look at the visualization and say person A spent more $s in the Dairy dept than person B in the month of June '18.

 

Cannot figure out how to do this. Thanks in advance for your assistance,'

Ben

Robert_T
Fluorite | Level 6

Hello elkinsbe, Believe the previous reply was correct. You can use custom graph builder to achieve the desired results. Adjust the settings of Bar Chart 1 and Bar Chart 2 separately, remove a Discrete Legend, and add a Group Shared Role to the bar charts.

 

  1. In the Custom Graph Builder, drag two bar charts over one another on the canvas
  2. To format and shift the bars:
    • Go to the Properties tab, select Bar Chart 2 from the drop down menu
      • Adjust the Grouping style to Stack
      • Adjust the Bar spacing to 60%
      • Adjust the Discrete offset to -20%
    • Go to the Properties tab, select Bar Chart 1 from the drop down menu
      • Adjust the Grouping style to Stack
      • Adjust the Bar spacing to 60%
      • Adjust the Discrete offset to +20%
  3. To ensure that groups appear as the same color on each bar:
    • Go to the Properties tab, select A1 from the drop down menu
      • Adjust Overlaid plot colors to All graphs start with the same color
  4. Since groups will be shared across both bar charts, prevent them from being displayed twice:
    • Go to the Properties tab, select Discrete Legend from the drop down menu
      • Remove the check mark from Bar Chart 1
  5. Since it is a time series, the category of the X Axis should be self explanatory, so you can remove the label
    • Go to the Properties tab, select X Axis from the drop down menu
      • Remove the check mark from Show axis label
  6. To set up the the Groups, which will be the stacks colors of the bars
    • Go to the Role Definitions tab
    • Add a Group Role to Bar Chart 2
    • Add a Group Role to Bar Chart 1
    • Use the drop down arrow next to the Bar Chart 1 Group to Create Shared Role With Another Role, Bart Chart 2 Group, select Ok to any defaults.
    • The Group between each bar chart should now be the same Shared Role
  7. Save, and add the chart to your report
  8. After assigning the roles to your chart, it should look something like this.

SAS VA - Custom Bar Chart - Stacked and Clustered.png

elkinsbe
Obsidian | Level 7

Robert T: Thank you so much for your response. Yes, now as your explanation was so clear and included exact instructions I understand how to make this informative double stacked bar chart...further, after re-reading I see the previous response provided a path forward.

Cheers to you for a detailed explanation.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 5216 views
  • 3 likes
  • 4 in conversation