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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

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