Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.charting
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.charting
|
|||
|
|||
creating dynamic chart from within VB6
Instead of referencing a new series, reference the existing series:
With objChart.SeriesCollection(3) .xValues = objSheet.Range(objSheet.Cells(5, 2), objSheet.Cells(5, cCols)) .Values = objSheet.Range(objSheet.Cells(6, 2), objSheet.Cells(6, cCols)) End With or With objChart.SeriesCollection("My Data Series") .xValues = objSheet.Range(objSheet.Cells(5, 2), objSheet.Cells(5, cCols)) .Values = objSheet.Range(objSheet.Cells(6, 2), objSheet.Cells(6, cCols)) End With - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "mb" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating Dynamic Spreadsheets | Excel Discussion (Misc queries) | |||
Creating a dynamic asset allocation chart | Charts and Charting in Excel | |||
Creating a dynamic list | Excel Worksheet Functions | |||
Creating a dynamic chart | Charts and Charting in Excel | |||
Creating a dynamic list | Excel Worksheet Functions |