adding additional borders around datalabel in proc sgplot

Reply
New Contributor
Posts: 3

adding additional borders around datalabel in proc sgplot

Hi There,

I would like to find out if anyone knows how to add additional borders to the datalabel in a proc sgplot. Currently i have a programme that outputs graphs to powerpoint, and the datalabelpos=bottom, this works well, however for ease of reading i would like to add additional vertical borders to the datalabel, and i have yet to find a solution to this. I have attached the images of how the graphs currently look, and how i would like them to look.

Kind Regards.

Attachment
Attachment
Grand Advisor
Posts: 10,210

Re: adding additional borders around datalabel in proc sgplot

Can you post Code to generate current graph, especially if it were to use a SAS supplied dataset?

SAS version you are using? Many options are changing with each release.

New Contributor
Posts: 3

Re: adding additional borders around datalabel in proc sgplot

Hi Ballardw,

Apologies for the lack of information.

I am using SAS Base 9.4 and the code below creates the graph and output.

proc template;

define style styles.mossgradient;

parent=styles.powerpointlight;

scheme "SAS 9.4 Template" /

     heading_font = ("Segoe UI Light, <MTsans-serif>, <sans-serif>" , 40 pt)

     body_font = ("Segoe UI Light, <MTsans-serif>, <sans-serif>" , 20 pt);

     class bodydate /vjust=bottom just=left width=50%;

     class pageno   /vjust=bottom just=right width=50%;

  

end;

quit;

ods _all_ close;

Title " " ;

ods powerpoint file = "C:\Temp\SAS_94_ODS_Graph.pptx" style=mossgradient;

proc sgplot data =sashelp.cars pad= (left=12% right = 13.1%);

     title 'This is where the title goes.';

     vbar   

DriveTrain

/      response = Horsepower

                   group = origin

                   groupdisplay = cluster

                   grouporder = DATA

                    datalabel = horsepower

                    datalabelattrs=(family = 'Calibri' size = 8 pt)

                    datalabelpos=bottom

                    barwidth=0.6;

                    xaxis display = (nolabel);

                    yaxis grid label = 'Yaxis label';

                 

                    keylegend / location=outside position = bottom title = "";

  

     footnote 'The ODS Destination for Powerpoint';

run;

ods _all_ close;

once you run the code above you may have an idea of what it is i am looking for, thanks.

Kind Regards

Grand Advisor
Posts: 10,210

Re: adding additional borders around datalabel in proc sgplot

I'll not be able to run the code until I can get 9.4. Which is likely to take awhile.

This example may help: 35132 - Bar chart with a data table below the graph

And sometimes lines may be determined by your style. Compare output using the journal style and default for example.

Respected Advisor
Posts: 3,775

Re: adding additional borders around datalabel in proc sgplot

Why don't you have a look at SGANNO for drawing the lines.

Or perhaps even better the AXISTABLE statement new in 9.4.

Ask a Question
Discussion stats
  • 4 replies
  • 241 views
  • 1 like
  • 3 in conversation