RecalcMinMax

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Xia
Newbie
Newbie
Posts: 47
Joined: Tue Oct 16, 2007 12:00 am

RecalcMinMax

Post by Xia » Mon Jul 07, 2008 8:36 am

Hi,

How can I calculate min and max of the data series Y values manually? The user guide says that You can call manually to RecalcMinMax method to recalculate MinValue and MaxValue. But when I call this function as below
Series->YValues->RecalcMinMax();
The C++ Builder shows that RecalcMinMax() is not a member of TChartValueList.

Thanks.

Xia

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 Jul 07, 2008 8:46 am

Hi Xia,

You can do this:

Code: Select all

	double min = Series1->YValues->MinValue;
	double max = Series1->YValues->MaxValue;
or this:

Code: Select all

	double min = Series1->MinYValue();
	double max = Series1->MaxYValue();
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

Xia
Newbie
Newbie
Posts: 47
Joined: Tue Oct 16, 2007 12:00 am

Post by Xia » Mon Jul 07, 2008 9:14 am

Hi Narcis,

Thanks for your speedy reply.

I am writing a real-time program for long-term monitoring (several days or over 10 millions points). To speed up real-time plot, I have set YValues->Modified = false during monitoring, so the min and max values will not be calculated when adding new data points during real-time monitoring. When monitoring stops, I want to adjust the Y axis according to Min and Max Y Values. How can I calculate min and max values for the recorded data?

Is it worthwhile to set Modified=false during long-term real-time monitoring in order to save calculation time? If Modified=true, does it re-calculate for all recorded data points or just compare the current min and max values with the new data, when a new data is added to the series?

Thanks

Xia

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 Jul 07, 2008 9:30 am

Hi Xia,

Yes, you need to use Modified property as shown in the Real-time charting article here.

When Modified is set to true it recalculates ValueLists statistics considering all data points as they can have changed entirely.
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

Xia
Newbie
Newbie
Posts: 47
Joined: Tue Oct 16, 2007 12:00 am

Post by Xia » Mon Jul 07, 2008 10:22 am

Hi Narcis,

I read the Real-time charting article and I understand that you need to set Modified to true to recalculate min and max.

However, when Modified is set to true it recalculates statis for all data points as you said. This is ok for a small amount of data or when you just load from a data array and it calculates once. But I am using for real-time plot, this means that statistics will be recalculated for all recorded data everytime when a new data point is added and it could take a considerable amout of time when a large amount of data (over several millions) has already been recorded. This is why I want to disable the internal statistics calculation by setting Modified=false during real-time plotting, and then call a function to calculate statistics for all recorded data after real-time monitoring stops. Is there a function in data series to re-calculate statistics?

I tried Series->MinYValue(). It just returns the min Y value if calculated, but not re-calculate min Y value for the data series.

Thanks

Xia

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 Jul 07, 2008 10:31 am

Hi Xia,

Thanks for the information.

I'm afraid this is not possible: You'll have to manually calculate min and max values as you wish.
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

Post Reply