I'm running 9.3
My ODS PDF gbarline chart is stretching the symbol so that a dot becomes a large elipse. The thing is, this is happening inconsistently as charts further within my program are appearing with the symbols shaped as expected. I'm struggling to identify & debug the culprit, suggestions please?
Apologies - I can't replicate the issue with a demonstration program and I can't use my production data/chart in this forum.
Thanks
ods graphics on ;
goptions device= jpeg border ;
goptions htext=4 ftext="arial";
* Bar legend ;
legend1 position=(middle left outside) origin=(,4.8)cm across=1 shape=bar(0.15,0.15)cm
label=(position=(top ) j=l "VOLUME");
* Line plot legend ;
legend2 position=(middle left outside) origin=(,1.8)cm across=1 repeat=2
label=(position=(top) j=l "VALUE") value=(height=3) ;
axis1 value=(height=2.8) order=(&bar_order.) label=none;
axis3 label=none ;
symbol1 value=dot c=black h=4;
symbol2 value=star c=black h=4;
symbol3 value=square c=black h=4;
symbol4 value=diamond c=black h=4;
pattern1 c=biyg;
pattern2 c=bio;
* CHART - PDF;
ods region width=10cm height=2cm x=1.2cm y=8cm;
ods text = "^{style[font_face='calibri' fontsize=2.5 just=left fontweight=bold] demotext}";
ods region width=18cm height=7cm x=1.35cm y=8.5cm;
proc gbarline data=work.a_dataset;
title ' ' ;
format vol val percent8.0 ;
bar MONTH / discrete sumvar=VOLUME subgroup=PRODUCT legend=legend1 axis=axis3 maxis=axis1 clipref autoref missing ;
plot / sumvar=Share_PRODUCT legend=legend2 axis=axis3 ;
plot / sumvar=Share_SUB_PROD;
run;
Mixing traditional SAS graphics procedures such as GChart, GPlot and GBarline and ODS graphics, SGPlot, SGPanel or SGRender, might be part of the cause as the options controlling generated graphs size may mean that the options you think are in effect for a portion of your program may not be.
For instance to control the size of a chart generated by GBarline you may need to set Goptions of Hsize and Vsize to your expected display size. You could get distortion if the graph is generated in one aspect ration (vertical to horizontal) due to goption defaults and then displayed in your document with a different ratio due to trying to display within a specific region.
Goptions do not impact SG procedures. ODS Graphics has no impact on SAS/GRAPH procedures. While there is a ODS REGION statement, I did not see any SG procedures in the code.
In general, the SG procedures will do a better job of maintaining the aspect of the graphs for the region sizes.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.