BookmarkSubscribeRSS Feed
Siriustar
Calcite | Level 5

Hello, everyone,

I have ran into trouble for some time, when I tried to create some bar charts..

First, I would like to create a side by side bar chart with proc template,

However, due to my sas version (9.2 TS2M0), I can not use the option "Discreteoffset"... then how can I create side by side bar charts with proc template?

... I can only get overlaid charts!!

Second, I want to add the statitics to the bar.. Still I couldn't use the "Barlabel" option...then I don't know how I can add labels to the bar....

Sample Data:

Data figure18;

  Input Province $ Percent1 Percent2;

  Cards;

  BC 16.427 15.995

  AB 15.461    14.470

  YT 15.279    14.616

  MB 16.980    10.014

  CAN 13.987 11.714

  ;

Run;

Proc Template;

  Define Statgraph barchart;

  Begingraph;

    Layout Overlay ;

      Barchart X=Province Y=Percent1 / Barlabel=True Discreteoffset=-0.2;

      Barchart X=Province Y=Percent2 / Barlabel=True Discreteoffset= 0.2;

    Endlayout;

  Endgraph;

End;

Run;

2 REPLIES 2
Siriustar
Calcite | Level 5

Thank you alot in advance for any suggestions!!!!!

Jay54
Meteorite | Level 14

With SAS9.2, you can use the SGPANEL procedure to create side-by-side grouped bar charts.  See 3rd graph in this blog article: Cluster Groups

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1772 views
  • 0 likes
  • 2 in conversation