Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #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

  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 6,582
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Dynamic Spreadsheets Django Excel Discussion (Misc queries) 4 May 30th 07 06:54 PM
Creating a dynamic asset allocation chart humble_t Charts and Charting in Excel 1 July 17th 06 02:41 PM
Creating a dynamic list Jarrod A Excel Worksheet Functions 1 November 18th 05 11:29 PM
Creating a dynamic chart Fysh Charts and Charting in Excel 9 December 15th 04 02:52 AM
Creating a dynamic list JarrodA Excel Worksheet Functions 3 October 30th 04 04:01 AM


All times are GMT +1. The time now is 01:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"