Page 1 of 1

dynamically create number of Tcharts in a vb form?

Posted: Tue Aug 24, 2004 4:18 pm
by 8125905
Hi,

I want to create some tcharts in a Visual Basic form dynamically based on iparameter passed on. I mean to create 1, 3, or whatever number of charts in a single form at runtime.
Could someone please tell me if it is possible? If yes, could you please send me some code example?

Thanks in advance!

Posted: Tue Aug 24, 2004 4:45 pm
by Chris
Hi --

Try:

Code: Select all

Private Sub Form_Load()
With TChart1
    For i = 0 To 10
        .AddSeries scLine
        .Series(i).FillSampleValues 10
    Next i
End With
End Sub

Posted: Tue Aug 24, 2004 5:43 pm
by 8125905
Thanks for your response. But it is not what I wanted. In your code, the series of TChart1 are added dynamically not TChart. I want add multiple TCharts dynamically. Any idea?

Thanks,

Posted: Fri Aug 27, 2004 11:45 am
by Chris
Hi ...
Thanks for your response. But it is not what I wanted. In your code, the series of TChart1 are added dynamically not TChart. I want add multiple TCharts dynamically. Any idea?
The technique is exactly the same as the one used for adding any kind of control to a vb form at runtime; it is well documented and should be easy to find with a Google search.