%let MTDAvg = 33.3;
proc sgplot data=mydata ;
vbarparm category=Day response=Sale1 / group=Dow barwidth=0.7 nooutline datalabel dataskin=pressed name="Daily";
series x=Day y=Sale2 / lineattrs=(color=grey pattern=solid thickness=1.5) name="Weekly" ;
series x=Day y=Sale3 / lineattrs=(color=red pattern=solid thickness=2) curvelabel='Avg:%cmpres(&MTDAvg)';
keylegend "Daily" / position=topright noborder autoitemsize;
xaxis display=(nolabel) offsetmax=0.08 labelattrs=(color=pab size=0.5);
yaxis grid min=10 max=55;
inset 'Avg:%cmpres(&MTDAvg)' / noborder position=topright;
run;
Use above code, inset
statement will place Avg:33.3
on the topright corner.
But curvelabel
cannot resolve macro variable and returns 'Avg:%cmpres(&MTDAvg)
at the end of series series x=Day y=Sale3
.