The SAS Output Delivery System and reporting techniques

How to add variable value on the chart

Reply
N/A
Posts: 0

How to add variable value on the chart

I'm using proc gplot to generate graphs by Item, location, x axis is time and y axis is amount, pretty basic graph.

And in the graph, I want to add a text box showing the value of "price" which is in my table, but I don't know how SAS could automatically create a text reflecting "price value" on each gragh.

Is it easy to do? or need to store the column of "price" into a macro variable?

Thank you so much in advance!
SAS Super FREQ
Posts: 8,743

Re: How to add variable value on the chart

Hi:
To add additional text to a SAS/GRAPH plot, you might need to consider using the ANNOTATE facility. Unless you put your price value into a TITLE or a FOOTNOTE, the ANNOTATE facility can place text onto a the graph image. These papers can give you some idea of how it works:
http://www.lexjansen.com/pharmasug/2007/tu/tu05.pdf
http://www.lexjansen.com/pharmasug/2006/handsonworkshops/hw03.pdf
http://www2.sas.com/proceedings/sugi31/239-31.pdf
http://www.lexjansen.com/pnwsug/2009/Atkinson,%20Mike%20-%20Customising%20SAS-GRAPH%20Charts%20with%...

cynthia
N/A
Posts: 0

Re: How to add variable value on the chart

Thank you very much! one more question on bar chart:

I wanna show three 3 years of data for different products. When I use Goptions to define 3 color of bars (interpol=needle), it keeps overwriting 3 bars (colors) into 1 bar (color), how to spread 3 bars out on X axis for different products?

Thanks!
SAS Super FREQ
Posts: 8,743

Re: How to add variable value on the chart

Hi:
The GPLOT documentation has an example of plotting 3 variables that you may find very useful:
http://support.sas.com/documentation/cdl/en/graphref/61884/HTML/default/gplvrbl2-ex.htm

cynthia
Ask a Question
Discussion stats
  • 3 replies
  • 356 views
  • 0 likes
  • 2 in conversation