Data visualization with SAS programming

Missing labels on only 1 vbar3d chart using ODS RTF

Reply
Occasional Contributor
Posts: 10

Missing labels on only 1 vbar3d chart using ODS RTF

Hello,

Yesterday, I wrote a program in Base SAS and output different charts using PROC GCHART...

The first chart output to ODS RTF perfectly; however, the second chart did NOT... (see attached output)

Also, all labels appear in the WORK.GSEG.GCHART folder...

Any thoughts/suggestions/missing elements/blatant errors???  Caveat, I am VERY new at using SAS/GRAPH... So, I'm sure there is something I don't realize about VBAR3D

-Jsquared

Attachment
Grand Advisor
Posts: 9,682

Re: Missing labels on only 1 vbar3d chart using ODS RTF

Proc Gchart (and Gplot and some of the other G procedures) have the ability to create more than one chart type per procedure call. The procedure ends with a QUIT; statement. Since the procedure had not completed when encountering the RTF Close then the correct output wasn't sent to the ODS RTF destination.

HINT: note that except for title and no labels the second chart is the same as the first so PERCENT wasn't actually run.

Occasional Contributor
Posts: 10

Re: Missing labels on only 1 vbar3d chart using ODS RTF

Great info!  Thank you very much for a quick response.  Would you mind showing me the proper way to write this in Base SAS so that my RTF output will be correct?

Grand Advisor
Posts: 9,682

Re: Missing labels on only 1 vbar3d chart using ODS RTF

Add Quit; after the second Run; should be all you need.

You could also have only one Proc Gchart statement with the two plots within the procedure call. That is how Gchart creates additional charts with different variables, statistics etc.

Occasional Contributor
Posts: 10

Re: Missing labels on only 1 vbar3d chart using ODS RTF

Tried it...same result.

I think the issue has to do with the bar width as it relates to the default font size for PROC GCHART - VBAR3D...  I don't think it has enough room to put the percent value over the top of the bars...

Any programming thoughts from that angle?

Grand Advisor
Posts: 9,682

Re: Missing labels on only 1 vbar3d chart using ODS RTF

I usually don't let Gchart do the summaries because of odd behaviors. If I have my variable I can assign a format and such for appearance control of displayed text.

If it looks like you are getting a percent result, the left axis should change appearance, then working with options such as WIDTH to make wider bars, and possibly making the whole graph wider (Axis control to rotate vertical axis text for example) might give more space to display  the value.

Post a Question
Discussion Stats
  • 5 replies
  • 341 views
  • 0 likes
  • 2 in conversation