Help using Base SAS procedures

how to display the number on the top of the bar in a bar-line chart.

Reply
N/A
Posts: 1

how to display the number on the top of the bar in a bar-line chart.

codes as below:

data a;

input year gdp cost;

cards;

1985   9016     192

1990   18668   290

1995   60794   637

2000   99215   1208

2005   183868  2475

2010   401512  5321

2014   636463  8082

2015   681015  8890

;

run;

proc sgplot data=a ;

vbar year/response=gdp ;

vline year/response=cost y2axis;

keylegend / location=inside;

run;

but I don't know how to display the number like  this.捕获.PNG

who can help me ? thanks.

Trusted Advisor
Posts: 2,113

Re: how to display the number on the top of the bar in a bar-line chart.

Although you may want to do that, it is generally considered poor form for a graphic.  The numbers on the top distort the visual image (and impact) of the graphic.  Better to put the numbers below or in a separate table.  If you must do it (sometimes the boss insists!), this Google search will provide examples

bar chart numbers above site:sas.com

Ask a Question
Discussion stats
  • 1 reply
  • 160 views
  • 0 likes
  • 2 in conversation