The Graph Control

As we've seen, the graph control allows us to display numerical data in a graph:


	_____________________________
          |                             |
          |                             |
          |            _____            |
          |           |     |           |
          |      _____|     |_____      |
          |_____|     |     |     |     |
          |     |     |     |     |_____|
          |     |     |     |     |     |
          |     |     |     |     |     |
          |_____|_____|_____|_____|_____|

To see what's possible with the graph control, let's begin by adding a graph control, Graph1, to a new Web page:

<HTML>
<HEAD>
<TITLE>Graph Control Page</TITLE>
</HEAD>
<BODY LANGUAGE = VBScript ONLOAD = "Page_Initialize">
<CENTER>
<H1>Graph Control Page</H1>
</CENTER>
<!- Graph>
<PRE>
Graph1:  <OBJECT CLASSID="clsid:0842d100-1e19-101b-9aaf-1a1626551e7c"  <--
             HEIGHT=300 WIDTH=300 ID=Graph1></OBJECT>
</PRE>
  .
  .
  .

Let's say that we have this data to plot:

Point   Value
1      50
2      60
3      30
4      40
5      60
6      70

We enter this data into the graph control by filling the GraphData property:

Sub Page_Initialize
    -->         Graph1.GraphData = 50
    -->         Graph1.GraphData = 60
    -->         Graph1.GraphData = 30
    -->         Graph1.GraphData = 40
    -->         Graph1.GraphData = 60
    -->         Graph1.GraphData = 70
                   .
                   .
                   .
        End Sub

Next, we select a graph type. (The default is the histogram type we saw in Figure 6.2.)

© 1996 by Steven Holzner. All rights reserved.