BookmarkSubscribeRSS Feed
DavidPhillips2
Rhodochrosite | Level 12

I have a gchart with slightly long category strings.  SAS 9.2 chops my category text off, see picture below (I cut off part of the graph in the print screen):  Is there a way to make the text smaller or give more space for the maxis.  I looked into ways of resizing the image however resizing the image gives problems:

I either lose my needed subgroup (when using statgraph)

I lose my inner statistic when resizing using: goptions reset=all  device=png hsize=6in vsize=6in; (however this method does resize the image)


AxisCutOff.png


title1 ls=1.5 "2014 Residency Comparison";

  axis1 label=none;

  axis2 label=none  width=10;

  axis3 label=none;

  legend1 label =none;

  proc gchart data=RES_PCENT;

  hbar stud_or_deg_level / discrete type=sum sumvar=category_pct inside=subpct nostats noframe

  subgroup=residency_desc

  gaxis=axis1 maxis=axis2 raxis=axis3

  legend = legend1

  html=htmlvar;

  run;

5 REPLIES 5
DavidPhillips2
Rhodochrosite | Level 12

Width parameter is not needed.

There appears to be a cap for the number of characters displayed. Even if I enlarge the graph (without changing the device) the text is capped at a set number of characters.  I am looking into how to change this cap setting.

Sujata
Calcite | Level 5

Hi David, Did you get any  solution on above mentioned truncation issue? I am also facing same problem.

GraphGuy
Meteorite | Level 14

The bar labels in your screen-capture appear to be "center truncated" (letters from the middle of the string are replaced with '...')? If this is the case, then I suspect you're using device=java or device=activex?

 

I would recommend using device=png instead (java & activex do not support the full SAS/Graph functionality in many cases).

 

In SAS 9.2, dev=png gchart was enhanced, and the length limit for bar labels was increased from 32 characters to 256 characters (if I recall correctly). 

Sujata
Calcite | Level 5

Thanks Robert .. It works for me but now when I use device =PNG tooltip values for bars are not displaying on mouse over.

GraphGuy
Meteorite | Level 14

With png, you'll need to use gchart's "html=" option, and prepare a variable in your dataset to contain html tags for what you want in the hover-text (and alternatively href drilldowns). This is a little bit of extra work, but adds a *lot* of flexibility! Here's an example that might get you started:

 

http://robslink.com/SAS/democd23/bar_info.htm

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1873 views
  • 0 likes
  • 3 in conversation