Jump to content
Software FX Community

Re: Real-Time charts

User (Legacy)

Recommended Posts

Yes, NSeries is the total number of series.  If you examine it under the 

scenario I mentioned (setting NSeries to 20 in design time and back to 2

again) you'll see that NSeries stays at 20 - a good indication that the

component has pre-allocated 20 and not returned to 2.

Deleting and reinserting the component has no effect - I've already done it.

Note also that I'm inserting a series into a real-time chart - they're won't

be any history for the series, just new data going forward.

SteveT <stephent@compassadv.com> wrote in message


Is the nSeries the Total number of series? If you had 1 series and wanted

to add 1 more nSeries would now be 2.

The following bit of code works for me in Access2k. Sometimes before I go

"over the edge", I delete the control and reinsert it. Seems to help.


Private Sub Form_Load()

'set chart with 1 series

ChartFX1.OpenDataEx COD_VALUES, 1, 5

ChartFX1.Series(0).Yvalue(0) = 30

ChartFX1.Series(0).Yvalue(1) = 76

ChartFX1.Series(0).Yvalue(2) = 43.5

ChartFX1.Series(0).Yvalue(3) = 90.75

ChartFX1.Series(0).Yvalue(4) = 12.5

ChartFX1.CloseData COD_VALUES

End Sub

Private Sub cmdAdd_Click()

'add another series to existing chart


ChartFX1.Series(1).Yvalue(0) = 40

ChartFX1.Series(1).Yvalue(1) = 86

ChartFX1.Series(1).Yvalue(2) = 53.5

ChartFX1.Series(1).Yvalue(3) = 100.75

ChartFX1.Series(1).Yvalue(4) = 22.5

ChartFX1.CloseData COD_VALUES

End Sub

smn <snevins@emdev.com> wrote in message


> Using build with VB6 to generate real-time charts. I'm trying to

> add a series at run-time, using the code mentioned in the thread on 8/30:


> cfx.OpenDataEx COD_VALUES, nSeries, COD_UNCHANGE

> cfx.CloseData COD_VALUES


> <nSeries> = the new series number


> The total number of series does not change (examined via property


> and when I try to add a data point to that series I get the "invalid

> property array index" error.


> However....if at design time I set NSeries to, say, 20, run it, then set


> back to, say, 2, I can use the above code to add a series at run-time -

> providing I don't exceed the maximum number I've ever entered at


> (in this example, that would be 20).


> Thoughts?


> smn


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...