- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello all
I've created the bar chart below, and I wonder if it is possible to let the bar chart show be both the frequency and the percentage ?
code"
PROC SGPLOT DATA = sashelp.cars;
VBAR type /group=origin;
RUN;
"
function output:
wanted output examples
thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC SGPLOT DATA = sashelp.cars nocycleattrs;
VBAR type /group=origin;
VBAR type /group=origin y2axis stat=percent ;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
if it is possible to do it per type that would be great. 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
i think in order for it to work with the percentage per type we need to write the value inside each colored portion cause otherwise the percent access needs a different bar as the percentage scale changes along the type
I found a way of adding the percent (out of total) in color like this but this losses the information of what each section of the bar represent (origin data in my example).
I wish I can keep write the percentage (and adjust it to pertype) value in the boxes instead of the frequency.
code :
PROC SGPLOT DATA = sashelp.cars;
VBAR type /group=origin COLORSTAT=PCT SEGLABEL;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
PROC SGPLOT DATA = sashelp.cars nocycleattrs;
VBAR type /group=origin;
VBAR type /group=origin y2axis stat=percent ;
RUN;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
y2axis
that is just a great option.
thank you .