How to append new data to the existing series?

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

How to append new data to the existing series?

Post by David » Mon Dec 04, 2006 7:16 am

Hi,

I would like to use AddArray to append new data to the existing series. How to do that?

Thanks,
David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 04, 2006 9:52 am

Hi David,

Have you seen the example at All Features\Welcome!\Speeed in the features demo? They show how to use arrays with TeeChart. You'll find the features demo at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

Post by David » Mon Dec 04, 2006 10:19 am

Hi, Narcís,

I know how to use AddArray to add new data, but I don't know how to use it to append new data to existing old data. For example, if the series have 1000 data, how to append another 1000 data to the end of it using AddArray?

By the way, have you received my demo code about the code crash? Any news about it?

Thanks a lot.
David

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Dec 04, 2006 10:36 am

Hi David,
I know how to use AddArray to add new data, but I don't know how to use it to append new data to existing old data. For example, if the series have 1000 data, how to append another 1000 data to the end of it using AddArray?
I'm afraid there's no way to append data, you'll need to manually append the arrays and them to the series or may be better looping through the array and add points using AddXY.
By the way, have you received my demo code about the code crash? Any news about it?
Sorry for the delay. We are aware of that and reply ASAP.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

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

Post by David » Mon Dec 04, 2006 10:44 am

Thanks. Hopefully I can get updates ASAP.

TMECHAM
Newbie
Newbie
Posts: 20
Joined: Tue Aug 17, 2004 4:00 am

Re: How to append new data to the existing series?

Post by TMECHAM » Tue Oct 27, 2009 8:45 pm

Has anything been done on this issue to address appending array data to a series? I get blocks of records in to my application in real-time, and would like to see an AppendArray function in the ISeries interface. Currently, I have to use AddXY for every single value. Being able to append thousands of records at a time would speed things up a lot.

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to append new data to the existing series?

Post by Yeray » Wed Oct 28, 2009 9:57 am

Hi TMECHAM,

The series values are stored in an array so an AppendArray function would take the given array, append the array at series' Yvalues and use AddArray function, that simply assigns the given array to the YValues array. So implementing an AppendArray function would be fastest than preparing the final array yourself and using the AddArray function.
Anyway, I'll add this to the wish list to be implemented in future releases (TV52014513).

Code: Select all

Private Sub Form_Load()
  TChart1.Aspect.View3D = False

  TChart1.AddSeries scPoint
  
  Const size1 = 10
  Dim array1(size1) As Double
  Dim i As Integer
  For i = 0 To size1 - 1
    array1(i) = Rnd * 100
  Next i
  
  TChart1.Series(0).AddArray size1, array1
  
  Const size2 = 10
  Dim array2(size2) As Double
  For i = 0 To size2 - 1
    array2(i) = Rnd * 100
  Next i
  
  Dim tmparray(size1 + size2) As Double
  For i = 0 To size1 + size2 - 1
    If i < size1 Then
      tmparray(i) = TChart1.Series(0).YValues.Value(i)
    Else
      tmparray(i) = array2(i - size1)
    End If
  Next i
  
  TChart1.Series(0).AddArray size1 + size2, tmparray
End Sub
Also note that with XML, to append data is possible: http://www.teechart.net/support/viewtopic.php?t=3092
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply