%macro create_trend_line(entity,x,y,width,height,chart_title,axis_label); %_f_define_region(&x,&y,&width,&height); proc sql noprint; select distinct Yr_nb into:year1- from trend_lines_ctrl_srt where Entity="&entity."; quit; proc sql; create table trend_data as select Yr_nb, Mo_Name, Ctrl_MBR from trend_lines_ctrl_srt where Entity = "&entity." order by Yr_nb, case Mo_Name when 'JAN' then 1 when 'FEB' then 2 when 'MAR' then 3 when 'APRIL' then 4 when 'MAY' then 5 when 'JUN' then 6 when 'JULY' then 7 when 'AUG' then 8 when 'SEP' then 9 when 'OCT' then 10 when 'NOV' then 11 when 'DEC' then 12 else 13 end; quit; footnote; proc sgplot data=trend_data noautolegend; styleattrs datacolors=(red blue black); series x=Mo_Name y=Ctrl_MBR / group=Yr_nb lineattrs=(thickness=2); xaxis label="Month" type=discrete; yaxis label="MBR Rate"; title "&chart_title"; keylegend / title="Years" position=bottom; run; title; %mend create_trend_line; I created this macro to generate trendline for years in the dataset, but unable to define custom colors.
... View more