BookmarkSubscribeRSS Feed
hjy50
Calcite | Level 5

Dear all,

 

While creating waterfall plot, I can get below output:

PIC1.png

But I tried to change the xaxis to show as dose group but failed. I tried to add a format for 1-29 and use format statement in PROC SGRENDER, but the output will automatically add the percentages within a dose group into one bar…

 

proc sgrender data=all template=barchart;
format ord SUBJ.;
run;

PIC2.png

 

 

i also tried to use tickvalueformat option in PROC TEMPLATE xaxisopts, but the values are not changed at all.

 

xaxisopts=(offsetmin=0.05 offsetmax=0.05 
linearopts=(viewmin=0 viewmax=30 tickvaluesequence=(start=1 end=29 increment=1)
tickvalueformat=SUBJ.))

 

 

 

Please help on this!!!

6 REPLIES 6
ballardw
Super User

1) example data

2) entire template code , there is lots of interaction between bits of the template and single lines are not sufficient to diagnose

3) attempted format code

 

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

 

hjy50
Calcite | Level 5
thanks for reply!
Let me ask in another way, how can we add format for discrete axis?
ballardw
Super User

@hjy50 wrote:
thanks for reply!
Let me ask in another way, how can we add format for discrete axis?

Let me ask another way;

 

Since the AXIS contents can depend on the LAYOUT options, what does your template code look like.

 

Also it is not clear what the actual values of your axis variable may be as your graph may have already been applying a default format for the variable. So we cannot assume that the actual values of your VARIABLE are 1, 2, 3. That assumption may be why your xaxis options are not working. So the DATA used for graphing also bears on the result.

Things work differently for BARCHART and BARCHARTPARM plots as well, or other plot statements that can be made to behave similar to barchart such as NEEDLEPLOT or VECTORPLT.

And finally, the actual definition of the Format attempted to be used may become critical.

 

Reeza
Super User
We don't know what your code looks like or what you're trying to get as output. Please include that information in your update as well.
hjy50
Calcite | Level 5

thanks for reply!
Let me ask in another way, how can we add format for discrete axis?

Reeza
Super User
Apply a format to your variable, but as you've mentioned if you're grouping your data the data will get grouped as well. I'm not sure you can separate the two.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 1007 views
  • 0 likes
  • 3 in conversation