dynamically create number of Tcharts in a vb form?

TeeChart for ActiveX, COM and ASP
Post Reply
tom
Newbie
Newbie
Posts: 2
Joined: Thu Jun 17, 2004 4:00 am

dynamically create number of Tcharts in a vb form?

Post by tom » Tue Aug 24, 2004 4:18 pm

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!

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Aug 24, 2004 4:45 pm

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
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

tom
Newbie
Newbie
Posts: 2
Joined: Thu Jun 17, 2004 4:00 am

Post by tom » Tue Aug 24, 2004 5:43 pm

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,

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Fri Aug 27, 2004 11:45 am

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.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply