Concatenate new points with older ones in a serie

TeeChart for ActiveX, COM and ASP
Post Reply
tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

Concatenate new points with older ones in a serie

Post by tdm » Thu Feb 10, 2005 2:53 pm

Hi !
I would like to know if it's possible to add new points to a serie without deleting the points which already exist in it.
As I have huge quantities of points to add to my serie, I currently use the AddArray function.
The problem is that if I add a set of points whith this function twice, the first set is deleted.
Any Idea ?
Best regards.

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

Post by Narcís » Thu Feb 10, 2005 4:06 pm

Hi tdm,

Yes, that's true. You should create a bigger array were you concatenate the "partial" arrays and add the result array to the chart like:

Code: Select all

Dim i, j As Integer
    Dim Arr1(100), Arr2(100), Arr3(200) As Integer
            
    For i = LBound(Arr1) To UBound(Arr1)
        Arr1(i) = Rnd(1000) * 1000
        Arr3(i) = Arr1(i)
    Next
    
    For j = LBound(Arr2) To UBound(Arr2)
        Arr2(j) = Rnd(1000) * 1000
        Arr3(i + j - 1) = Arr2(j)
    Next
    
    TChart1.Series(0).AddArray UBound(Arr3), Arr3
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

tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

Post by tdm » Fri Feb 11, 2005 8:15 am

Yeah sure.
But the problem is the number of points I work with.
If my series owns 2000000 points or more and If I want to add to this serie 2000000 or more points, if I follow your advice, I must read the 2000000 first points the serie already owns, put them in an array and then and my 2000000 new point in this array.
Then I just have to pass this array to the serie with the addarray method.

The problem of this method is the time of the reading of the points the serie already owns. Indeed, there is no method "getarray" which gives the data in the serie as two arrays X[] and Y[] as opposed to "addarray" which is used to add points.
I must do a loop and get the points one per one with the GetValue method of the two IValueList objects (X and Y value lists) derived from the Serie class.
This loop is too much time consuming.

Any idea or other advice ?
Thanks a lot.

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

Post by Narcís » Fri Feb 11, 2005 9:01 am

Hi tdm,

How many point do you want do you want to show your clients at any one time?

You might find it easier to load the points to be viewed dynamically at run-time from your arrays.
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

tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

Post by tdm » Fri Feb 11, 2005 9:28 am

Hi.
In fact the Chart is used to display curves of data acquisition : temperature, hygrometry, presure...
The data is acquired from an acquisition system and each channel has a different acquisition frequency. The maximum frequency is 1pt/min and the curves must be displayed over 6 months !!!
That is to say a serie can hold about 60min*24hours*31days*6months = 267840 points.

Other mode of the acquisition system is quick acquisition. If an event (user programmable, such as a verifying that the data acquired is beyond a certain value) occurs, the data acquisition frequency changes : the maximum frequency is 4000Hz (4000pt/sec).
The time of the acquisition is limited (max 1 hour) because of the volume of data acquired. The max number of points is there : 4000*60sec*60min = 7200000 !!!

The data acquired are downloaded from the acquisition system on the user's demand and are saved in a mysql database.
The user can let pass 5-6 months before downloading the new data...
The data already in the database are displayed in the chart as curves=f(time) and when the download of the new data is achieved, the user can refresh the chart if he wants to.
It's there that's my problem is (adding new points to a serie).

Is it OK ?

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

Post by Narcís » Fri Feb 11, 2005 10:05 am

Hi tdm,

Yes, I understand your case.
The data acquired are downloaded from the acquisition system on the user's demand and are saved in a mysql database.
The user can let pass 5-6 months before downloading the new data...
Have you thought using a DataSource then?

You can see how to do it at "Tutorial 8 - ADO Database access". Also an example of it is available at "C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual Basic\Visual Basic 5 & 6\ADO Databases" (default english installation path". You can also find some examples included in the TeeChart feature demo.
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

tdm
Newbie
Newbie
Posts: 22
Joined: Fri Oct 22, 2004 4:00 am
Location: mérignac, france
Contact:

Post by tdm » Fri Feb 11, 2005 10:21 am

Yeah we thought about.
I found it difficult to use because we are not running neitheir Visual Basic nor Visual C++. Our program is written under LabWindows CVI, from Nationnal Instruments.
I will read the tutorial you advised me and studdy the exemple and then I will repost my conclusions...
Thanks a lot for your help and usefull advices.
Best regards.

Post Reply