Make a Light Chart Control
As I have already mentioned the RegisterData method, it would make sense to move onto that next. When calling the RegisterData method you will need to pass a two dimensional variant array. The array should look something like this:
Redim MyData(2, 20) As VariantMyData(0, 1) = 8
This sets the first point on the data series 0, to have a value of 8. You can use a loop to easily set up the array:
For i = 0 To 20MyData(0, i) = (Rnd 0.5) * 10 + INext I
This generates one data series with some 20 random values in it. You pass the array like this:
The RegisterData procedure does some clever things with the array, and stores it in the internal array variable.
You can easily manipulate different parts of the graph control using the properties built in. You can change the title and its font, using the default Font property to set the style for everything else (the legend and axis measurements). You can change the colour and description of a data series on the legend using the SetSeriesOptions procedure.
Well, apart from some extra code in the Write and Read Properties methods, the only code left is to actually draw the graph.
Page 5 of 7