User (Legacy) Posted December 23, 1999 Report Share Posted December 23, 1999 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. Steve 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.OpenDataEx COD_VALUES, 2, COD_UNCHANGE 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 news:DE0379D14694D211B4CE00609770710D0456F5@sftfx-221.wamnet.net... > Using build 4.0.14.0 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 NSeries), > 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 it > 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 design-time > (in this example, that would be 20). > > Thoughts? > > smn > Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.