Data visualization with SAS programming

Gchart Bar Width

Reply
N/A
Posts: 0

Gchart Bar Width

I would like to increase the width of the bars.
bu1 has two categories and question has 4 categories (8 bars).
I've tried changing the width and space, but I keep getting this warning:
WARNING: There was not enough room to use the specified width of 10 for the bars.

Does anyone know how to get around this problem and increase the width of the bars?

proc gchart data=bar1 anno=my_anno1;
hbar bu1 / discrete
nostats
type=sum sumvar=catpct
group=question
subgroup=qs
autoref clipref cref=graycc
maxis=axis1
raxis=axis2
width=10
legend=legend1
coutline=black
/*space=15*/
SAS Employee
Posts: 980

Re: Gchart Bar Width

This one's hard to answer exactly, without having the data to experiment with, but here are a couple of ideas ...

Perhaps you could make the entire chart taller (such as using "goptions ypixels=1000"), which would give more room for wider bars.

Perhaps try changing the device (there might be slight differences in bar spacing between dev=gif and dev=png, and there will certainly be differences with dev=actximg and dev=javaimg).

And if the values along the bottom/response axis of your hbar chart have a format applied, and if that format 'pads' on a lot of extra space on the left (such as if you're using the "comma20." format, when your numbers only need 4 or 5 digits), then you might try using a smaller format to free up some space to be used by wider bars in the bar chart.

These are just some ideas - not really sure if any of them will be your "silver bullet" though! Smiley Happy Message was edited by: Robert Allison @ SAS
Ask a Question
Discussion stats
  • 1 reply
  • 404 views
  • 0 likes
  • 2 in conversation