Disabling Zoom on a chart in C++ Builder

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
billyt
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Disabling Zoom on a chart in C++ Builder

Post by billyt » Mon Dec 15, 2003 5:59 am

I've tried to disable the zooming function in both Borland C++ builder 6 and Delphi 5. Works in Delphi but not in C++

Code fragment where I am disabling it is pretty simple:

TeePlotChart->Zoom->Allow = false;

Can't see any reason why this shouldn't work. Have build a very simple test application with only a chart and a couple of lines of code (the one above for instance) to make sure no other side effects are causing the problem

Sound familiar to anyone ??

Bill
[/code]

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

Post by Marjan » Mon Dec 15, 2003 8:23 am

Hi, Bill.

Which TeeChart version are you using ? Does it work if you disable it at design time (via chart editor) ? Also, I've tried the following code (BCB6, TC 6.01) and it worked fine:

Code: Select all

Chart1->Zoom->Allow = false;
Marjan Slatinek,
http://www.steema.com

billyt
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Post by billyt » Tue Dec 16, 2003 5:41 am

Hi Marjan

I'm using BCB6 and TC6.01. I have attached the complete code fragment from my test application. It has a form with a Tee Chart, and two buttons. Button1 sets up a fast line series and button two sets the allow Zoom to false.

What I'm trying to do is stop the rubber banding of a section of the screen and subsequent zoom to that region from working when the user is panning the graph with the hand. I would expect setting the Zoom->allow to false to achieve this, but after doing this, I'm still able to rubber band it and zoom.

Interestingly, if I set the same property (Zoom->Allow = false) at design time, it does stop the zoom from working !!!!

Setting it at run time seems to have no effect in BCB.


void __fastcall TForm1::Button1Click(TObject *Sender)
{
TFastLineSeries *tmpFastLineSeries;

TeePlotChart->Legend->LegendStyle = lsSeries;
tmpFastLineSeries = new TFastLineSeries(this);
TeePlotChart->AddSeries(tmpFastLineSeries);
tmpFastLineSeries->FillSampleValues(30);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
TeePlotChart->Zoom->Allow = false;
}[/code]

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

Post by Pep » Tue Dec 16, 2003 12:10 pm

Hi Bill,

have you tried using :
TeePlotChart->AllowZoom = false;
instead of :
TeePlotChart->Zoom->Allow = false;

Josep Lluis Jorge
http://support.steema.com

billyt
Newbie
Newbie
Posts: 6
Joined: Fri Nov 15, 2002 12:00 am

Post by billyt » Wed Dec 17, 2003 2:47 am

Ahha:

That seems to work !. In the help, is says this is an old propery and it should not be used. Doesn't always pay to read the manual !

Thanks

Bill

Post Reply