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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 1371 views
  • 0 likes
  • 3 in conversation