Fill with color the zone between the graph and horizontal 0

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Fill with color the zone between the graph and horizontal 0

Post by Rodrigue » Tue May 03, 2005 3:54 pm

Hello,

How to fill with color the zone between the graph and horizontal "0" ?
I've done a picture to be more precis (green serie):
Image
http://www.xoogle.org/GRAPH-DIFF.gif

Note : I use Custom Axes...

Cordially,
Rodrigue

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

Post by Pep » Fri May 06, 2005 8:38 am

Hi Rodrigue,

you could use one ColorBand Tool for the left Axis (see Help for details).

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Thu May 12, 2005 11:32 am

Hello,

I don't understand why you ask me to use a ColorBand tool... It's just a rectangle, no :? ?
I've used a TAreaSerie to solve my problem but I've a lot of point to display (~30000). Is it a way to only draw the point necessary (like the DrawAllPoints property available in TFastLineSerie).

Thanks in advance!
Cordially,
Rodrigue

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Thu May 12, 2005 2:16 pm

Hi.

Yes, you can use area or even high-low series to fill the area. But you'll have to manually calculate reduction points and pass them to series. Perhaps you can even use the reduction algorithm we used in TDownSamplingFunction (see TeeChart demo to see it in action).
Marjan Slatinek,
http://www.steema.com

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Wed May 18, 2005 10:05 am

I'm using C++ Builder 6.

I try to to do this :

Code: Select all

TDownSamplingFunction* DS = new TDownSamplingFunction(Chart);
...
but TDownSamplingFunction is an unknow type.

Have an idea ? What file should I include ?

I don't find the example you've said. The find function in your example application doesn't work for me...

Cordially,
Rodrigue

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

Post by Narcís » Wed May 18, 2005 10:26 am

Hi Rodrigue,
Have an idea ? What file should I include ?
You should include TeeDownSampling.hpp.
I don't find the example you've said. The find function in your example application doesn't work for me...
Yes, you are right. It is a known problem and we will try to solve it for future releases.

Regarding the example I've seen it is not implemented in the BCB demo, however it's in the Delphi one which you can download here. You should browse All Features\Welcome!\ Functions\Extended\Reducing number of points.
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

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Wed May 18, 2005 1:38 pm

Thank you very much, it works!

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Wed May 18, 2005 3:05 pm

Hello,

I've yet an another problem : I don't find how to delete the object TDownSamplingFunction without generate an exeption !

Here is my code :

Code: Select all

   serie = new TAreaSeries((TChart *)Chart);
   DownSampling = new TDownSamplingFunction((TChart *)Chart);
   serie_temp = new TAreaSeries((TChart *)Chart);


   /*=============
   === Données ===
   =============*/

   serie_temp->FillSampleValues(30000);


   serie->SetFunction(DownSampling);

   DownSampling->Tolerance = 10;
   DownSampling->DownSampleMethod = dsAverage;       /*dsDouglas - the Douglas-Peucker simplification algorithm
                                                      dsMax - group of points are replaced with group maximum value
                                                      dsMax - group of points are replaced with group minimum value
                                                      dsMinMax - group of points are replaced with (two points!) group minimum AND
                                                      maximum value
                                                      dsAverage - group of points are replaced with group average value*/



   Chart->AddSeries(serie);
   serie->DataSource = serie_temp;


   serie->VertAxis = aLeftAxis;
   serie->HorizAxis = aBottomAxis;
And when I repaint an another serie or when the window is closed, the following code are executed :

Code: Select all

    //...
    if(DownSampling) delete DownSampling;
An exception is generated :? ! May be I'm doing something wrong ...


TIA

Cordially,
Rodrigue

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed May 18, 2005 3:42 pm

Hi.

I think you have to disconnect function from serie prior to deleting it (to avoid av later when serie values are recreated):

Code: Select all

serie->SetFunction(NULL);
delete DownSampling;
Marjan Slatinek,
http://www.steema.com

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Wed May 18, 2005 4:20 pm

I've try but it doesn't work !
CodeGuard error : Access in freed memory

Rodrigue
Newbie
Newbie
Posts: 23
Joined: Fri Jan 28, 2005 5:00 am
Location: Belgium

Post by Rodrigue » Thu May 19, 2005 9:53 am

Ok, I must delete TDownSamplingFunction object in first. And only after do setfunction(NULL).

When I zoom, I need a better resolution. I was thinking that put Tolerance to 1 will only display the "average pixel" (with DownSamplingMethod = dsAverage) on the screen independently of the factor of zoom :?
I've tried to put Tolerance=1 in the OnZoom Event but it doesn't work also :(

TIA,
Cordially,
Rodrigue

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

Post by Pep » Wed Jun 15, 2005 3:40 pm

Hi Rodrigue,
When I zoom, I need a better resolution. I was thinking that put Tolerance to 1 will only display the "average pixel" (with DownSamplingMethod = dsAverage) on the screen independently of the factor of zoom
I've tried to put Tolerance=1 in the OnZoom Event but it doesn't work also
I've tried to change the Tolerance in the OnZoom event here and it works fine. Could you please send me a simple sample directly to my mail (pep@steema.com) with which I can reproduce the problem ? Have you tried to call the CheckDataSource() method after the Tolerance has been modified ?

Post Reply