- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
All,
I'm trying to add data labels into a stacked bar graph.
Part of my data looks like this:
Category | Per | EVENT_DT |
ATTPerc | 67.16% | 25/09/2017 |
AHoldPerc | 12.29% | 25/09/2017 |
ACWPerc | 20.55% | 25/09/2017 |
ATTPerc | 68.25% | 26/09/2017 |
AHoldPerc | 12.18% | 26/09/2017 |
ACWPerc | 19.57% | 26/09/2017 |
ATTPerc | 68.11% | 27/09/2017 |
AHoldPerc | 12.57% | 27/09/2017 |
ACWPerc | 19.32% | 27/09/2017 |
ATTPerc | 67.87% | 28/09/2017 |
AHoldPerc | 11.28% | 28/09/2017 |
ACWPerc | 20.84% | 28/09/2017 |
ATTPerc | 69.01% | 29/09/2017 |
AHoldPerc | 12.09% | 29/09/2017 |
ACWPerc | 18.90% | 29/09/2017 |
ATTPerc | 67.98% | 2/10/2017 |
AHoldPerc | 11.91% | 2/10/2017 |
ACWPerc | 20.12% | 2/10/2017 |
proc sgplot data=work.AHT_OTH_PercCalc;
vbar EVENT_DT / response=Per Group=Category datalabel seglabel ;
YAXIS max=1 Label="Percentage" Values=(.1 to 1 by .05);
run;
I have tried datalabel seglabel however only the datalabel is showing in the chart.
How can I get the datalabels to show?
All help appreciated.
Cheers
Dean
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dean,
With SAS9.4TS1M2, this is the output I get using your data and program.
If you add the "seglabelattrs=(size=8)" instructions, what is the result?
Cheers,
Damo
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @DME790
Are you trying to display the value of the PER variable?
As per the documentation, SEGLABEL should do the trick but it is new with SAS 9.4M2.
Which version are you using?
If you try to use Sample 55866 (Use the SEGLABEL option to label bar segments in a bar chart, what is the result?)
Cheers,
Damo
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Damo,
I can run Sample 55866 and it shows the segment results
I have got seglabel in the code however it doesn't display the segment values in the bars.
I am using 9.4 m2
proc sgplot data=work.AHT_OTH_PercCalc;
vbar EVENT_DT / response=Per Group=Category stat=SUM datalabel seglabel ;
YAXIS max=1 Label="Percentage" Values=(.1 to 1 by .05);
run;
It shows the datalabel at the top of the bars but not the segments.
Cheers
Dean
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dean,
With SAS9.4TS1M2, this is the output I get using your data and program.
If you add the "seglabelattrs=(size=8)" instructions, what is the result?
Cheers,
Damo
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Damo,
It is now showing the per values. Not sue what happened as I haven't changed any code - feel silly now.
Thanks for all the support.
Cheers
Dean