Page 1 of 1

Fill with color the zone between the graph and horizontal 0

Posted: Tue May 03, 2005 3:54 pm
by 9340780
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

Posted: Fri May 06, 2005 8:38 am
by Pep
Hi Rodrigue,

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

Posted: Thu May 12, 2005 11:32 am
by 9340780
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

Posted: Thu May 12, 2005 2:16 pm
by Marjan
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).

Posted: Wed May 18, 2005 10:05 am
by 9340780
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

Posted: Wed May 18, 2005 10:26 am
by narcis
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.

Posted: Wed May 18, 2005 1:38 pm
by 9340780
Thank you very much, it works!

Posted: Wed May 18, 2005 3:05 pm
by 9340780
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

Posted: Wed May 18, 2005 3:42 pm
by Marjan
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;

Posted: Wed May 18, 2005 4:20 pm
by 9340780
I've try but it doesn't work !
CodeGuard error : Access in freed memory

Posted: Thu May 19, 2005 9:53 am
by 9340780
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

Posted: Wed Jun 15, 2005 3:40 pm
by Pep
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 ?