View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
mb mb is offline
external usenet poster
 
Posts: 4
Default creating dynamic chart from within VB6

I'm creating a chart within a Visual Basic 6 program which has 3 series.

The first two series are static, and represent minimum/maximum limits for
the third series, which is a diameter vs. offset graph.

The diameter vs. offset graph will grow as more measurements are taken at
increasing offsets, and I'm looking for a way to construct a
dynamically-expanding graph.

I've read some of the articles and website tutorials from past queries to
this newsgroup, and it sounds like it is pretty easy to do this directly
from Excel.

My question: is there some way to do the same thing from within VB6? I.e.
name a range and use keywords such as OFFSET and SERIES?

Currently, I'm adding the diameter vs. offset graph with code that looks
like this:

With objChart.SeriesCollection.NewSeries
.xValues = objSheet.Range(objSheet.Cells(5, 2), objSheet.Cells(5, cCols))
.Values = objSheet.Range(objSheet.Cells(6, 2), objSheet.Cells(6, cCols))
End With

But I don't want to add a new series everytime I have one more pair of
datapoints to plot.

I know the data series will never be greater than 255 entries, so is there
some way I can specify the entire range, and have it ignore zero entries,
but update when I add non-zero entries within the range?


thanks!

Michael