Is it possible to dynamically resize the chart?

TeeChart for ActiveX, COM and ASP
Post Reply
David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Is it possible to dynamically resize the chart?

Post by David » Fri Mar 24, 2006 2:15 am

Hi,

When I include the chart in a form view, I hope it can be dynamically resized when the window size changes. Is it possible to do that? Thank you very much!

David

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Mar 31, 2006 7:51 am

Hi David,

you can use similar code to the below :

Code: Select all

Private Sub Form_Load()
With TChart1
    .AddSeries scLine
    .Series(0).FillSampleValues 20
End With
ResizeChart
End Sub

Private Sub Form_Resize()
ResizeChart
End Sub

Private Sub ResizeChart()
With TChart1
    .Top = 0
    .Left = 0
    .Height = Me.ScaleHeight
    .Width = Me.ScaleWidth
    .Repaint
End With
End Sub

David
Advanced
Posts: 203
Joined: Tue Nov 08, 2005 5:00 am

Post by David » Fri Apr 21, 2006 7:26 am

Hi, Pep,

Got it. Thank you very much!

David

Post Reply