BookmarkSubscribeRSS Feed
JCGuillemin
Calcite | Level 5

Bonjour

I have to maintain a SAS program in order to 'always' have in the GBARLINE graphic a specific ref line. Unfortunately it seems that this ref line can only be displayed when its value is within the range of the values of the chart response axis.

I want to use this ref line  display as a threshold limit, so I need to have it on the graph whatever the values of the response axis are. 

Does anyone have an idea how to code the GBARLINE in order to solve this issue?

 

Thanks a lot for your help

 

Jean-Christophe

3 REPLIES 3
ballardw
Super User

Without at least the code for your current GBARLINE it is real hard to make suggestions.

Better would be to include some example data that causes the refline to be outside the range of the data and not display.

 

One suspects that the solution is going to involve using your data and some code to write an AXIS that works with your data and your reference line value(s) but how to do that is dependent on what you have.

 

Also GBARLINE is a bit old as a procedure. You may want to consider migrating to Proc SGPLOT. The NOCLIP option on the REFLINE statement would extend the axis to contain the reference value(s) automatically. Exact options to use with Sgplot would depend on what you are currently attempting with GBARLINE.

JCGuillemin
Calcite | Level 5

Hello ballardw, 

Thanks for your feedback. Here is an extract of the sas program, focusing only on the GBARLINE instruction: 

goption htext=0.7;
proc GBARLINE data=b ;
format Hmips 4. Trafic beau. ;
bar date / name="&Sit.02000"
sumvar=Hmips
type=sum
cframe=&color_frame
lref=2
cref=red
ref=&seuilconso
caxis=black
ctext=black
minor=1
coutline=black
cref=red
ctext=black
space=0
raxis=axis1
maxis=axis2
midpoints="&datd"d to "&datf"d by day
subgroup=Tranname
legend=legend1
;
label trafic='Number'
Hmips ='CPU';
plot / sumvar= Trafic raxis=axis3 caxis=blue ctext=blue minor=1
;
run;

 

The seuilconso variable is coming from an external table, thus it can be easily changed without having to modify the source code. 

Here is an example of the kind of graph I am looking for : 

JCGuillemin_0-1703063277592.png

The seuilconso variable is the threshold line (red dots), an d I need to have it displayed whatever the values of the 'CPU' axis are. For information, when the CPU value is higher that this threshold limit, a mail is automatically generated to inform the user that we may have an issue. 

I hope it's a litlle bit clearer now.

Thanks again for your help 

best regards

JC

ballardw
Super User

The only time I would expect the reference line not to appear with your description is when the reference is much greater than the values allowed by your response axis, which appears to be in your Axis3 definition. So you will need to show the code for Axis3 and then we can look at ways to change that to allow the reference line. It may be that the easiest approach in the long run is to modify the code that creates the actual value of &Seuilconso to also create an "nice" value for the upper limit of the Axis statement to use in a Values option.

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