Chapter Contents

Previous

Next
SAS/AF Software: Class Dictionary

Using Subsets of Data in a Chart Control

To create subsets of the data for a Chart control, you can:

Because you can query a reference line for its position, you can create an application that creates data subsets interactively. In this application, the user can drag the reference lines to encompass the data range of interest. You can then query each line to determine its position, and generate a graph that uses those position values as the minimum and maximum values in the analysis.

For example, assume you have added two reference lines to a control named chart1, and that you stored their ID's in the variables refLine1 and refLine2. The following code queries the lines for their values and sets the data source for a histogram whose lowest data value is the value from line refLine1, and whose highest value is the value from line refLine2:

lowVal=0;
highVal=0;
chart1._getReferenceLineValue(refLine1, lowVal);
chart1._getReferenceLineValue(refLine2, highVal);
/* open a data set and use the reference-line */
/* values as the low and high values          */
dsid=open('sasuser.mydata');
   rc=where(dsid, 'x>lowVal','and x<highVal');
/* assume hist1 is an existing Histogram control */
hist1.dataSource='datasetid';
hist1.dataSetID=dsid;


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.