BookmarkSubscribeRSS Feed
Pepsimax2
Calcite | Level 5

I am trying to add a reference line to each bar in SAS GTL. I know I have target= in barchartparm but I need to customize the line to dashed, which I can not find anyway to do that in barchartparm.

I tried scatterplot and symbolchar to overlay a "DASHED LINE" unicode but the issue is the unicode I used is not vertical centered. It cannot be placed right at the data point. I tried vertical offset to fix it then another issue is in the legend, the same symbol char was used but if I changed the size of the symbol in legend it resulted in so much space in the legend box then the figure became too long.

I wanna ask are there some other way to get around this? or some magical normal dashed line unicode that I can use? I searched so many some just gave me a empty box which I do not understand why.

Thank you so much for your help!

 

Here are the part of the code:

proc template;
define statgraph &st.&yr.&pp.TopBox;
BeginGraph / DesignWidth = &Height.in ;

symbolchar name=line char='2508'x /voffset= 0.39 ;
symbolchar name=linelengend char='2508'x /voffset= 0.3;

discreteattrmap name = "line";
Value "1" /markerattrs=(symbol=line color=black size = 0.8in);

enddiscreteattrmap;
discreteattrvar attrvar = drawline var = line attrmap = "line";


legenditem type = marker name= "XXXX" / label="XXXX"
markerattrs = (Symbol = linelengend Color = black Size = 0.4in);

Layout Overlay / XXXXX ;
/* Create Bars */
BarChartPARM x = XXXX y = XXXXX / Group = PlanColor
GROUPORDER= reversedata
GroupDisplay = Cluster
CLUSTERWIDTH = 0.5
Orient = vertical
DataSkin = &DataSkin.
/* DATALABEL = XXXX*/
/* DISCRETEOFFSET = -0.2*/
datalabelattrs=(size=10 weight=bold)
ERRORLOWER = Lower_CI
ERRORUPPER = Upper_CI
/* target = XXXX*/
;

ScatterPlot x = XXXXX y = XXXXX / Group = drawline
GROUPORDER = reversedata
GroupDisplay = Cluster
/* DATALABEL = XXXXX*/
;

DiscreteLegend "XXX" / Border = Yes
ValueAttrs = (Family = "Calibri" Color = Black Size = 10)
;

3 REPLIES 3
Jay54
Meteorite | Level 14

It is easier to help if you post your current code with sample data and output.  Also the SAS release number.

Pepsimax2
Calcite | Level 5

Just edited the post! Thank you

Jay54
Meteorite | Level 14

Please supply FULL code (with any macro variables values) and sample data so we can run your program to see what is going on.  Please include SAS release number.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1541 views
  • 0 likes
  • 2 in conversation