Page 1 of 1

TeeChart ActiveX v5.0.7 possible memory leak ?

Posted: Wed Apr 14, 2004 4:12 pm
by 5890889
Hi,

I use the last ActiveX v 5.0.7 with database as input value for series.
All work fine to show values, etc....

But my application use a timer to refresh data from database. The only way found is to Refresh Adodc recordset and set again to series DataSource.

TableAccess.Refresh

Me.TChart1.Series(0).DataSource = TableAccess.Recordset
Me.TChart1.Series(0).ValueLists.Items(0).ValueSource = "Field1"
Me.TChart1.Series(0).ValueLists.Items(1).ValueSource = "Field2"
...

But this method add memory leak. How can i do ?

I have tryed many method, but the only working method is to set the recordset again.

thanks
Fosset

By the way... I use Delphi VCL version and to solve zoom bug in DblClick on graph I use Chart.Abort, but in VB how I can ?

Posted: Thu Apr 15, 2004 9:20 am
by Chris
Hi --
But this method add memory leak. How can i do ?

I have tryed many method, but the only working method is to set the recordset again.
OK. Two alternatives:
1) Try refreshing your ADO recordset and then calling ISeries.RefreshSeries.
2) Try refreshing your ADO recordset then call code similar to:

Code: Select all

  .Series(0).Clear
  Record.MoveFirst
  While Record.EOF = False
    S = Record.Fields(4).Value
    .Series(0).AddXY Record.Fields(3).Value, Record.Fields(2).Value, S, clTeeColor
    .Series(1).AddXY Record.Fields(3).Value, Record.Fields(0).Value * 10000, Record.Fields(1).Value, clTeeColor
    
    Record.MoveNext
  Wend
By the way... I use Delphi VCL version and to solve zoom bug in DblClick on graph I use Chart.Abort, but in VB how I can ?
You could try something similar to:

Code: Select all

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

Private Sub TChart1_OnDblClick()
MsgBox "Hi"
TChart1.Zoom.Enable = False
End Sub

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If TChart1.Zoom.Enable = False Then
    TChart1.Zoom.Enable = True
End If
End Sub

Posted: Fri Apr 16, 2004 12:55 pm
by 5890889
thanks, your help is great and useful, all is working now.

thanks again.