SGPLOT Procedure

Example 11: Creating a High-Low Chart

Features:

HIGHLOW statement

Sample library member: SGPLHILO
This example shows the high, low, and closing stock prices for a company during the year 2005.

Output

High-low chart example

Program

title "Stock High, Low, and Close"; 
proc sgplot data=sashelp.stocks;
  where Date >= '01JAN2005'd and stock='IBM';
  highlow x=date high=high low=low 
    / close=close;
run;
title;

Program Description

Create the high-low chart.The HIGH, LOW, and CLOSE variables are used in the HIGHLOW statement. In addition, the plot subsets the data by year and by company.
title "Stock High, Low, and Close"; 
proc sgplot data=sashelp.stocks;
  where Date >= '01JAN2005'd and stock='IBM';
  highlow x=date high=high low=low 
    / close=close;
run;
title;