Bug: While set ChartClickSeries event, Zoom is broken

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Fang
Newbie
Newbie
Posts: 66
Joined: Wed Oct 13, 2004 4:00 am

Bug: While set ChartClickSeries event, Zoom is broken

Post by Fang » Thu Apr 06, 2006 5:16 pm

Hi,
Just drop a chart and a TColorGridSeries, make it random filled.

Add an empty line for ChartClickSeries event like the following,

void __fastcall TForm1::Chart1ClickSeries(TCustomChart *Sender,
TChartSeries *Series, int ValueIndex, TMouseButton Button,
TShiftState Shift, int X, int Y)
{
// abd
}

At runtime, you can't drag zoom or pan if you drag within the color grid plot, but you still can do it if you drag from the empty space near the plot.

Took me a while to figure out 'cause even you comment the lines in that event, the bug still persists. Not sure if it's the case for other 3D series, but at lease 2D ones are fine.

Fang
p.s version 7.06

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 Apr 07, 2006 8:42 am

Hi Fang,

This is as designed. This happens with all series styles if you try to make zoom by clicking on the series and having the OnClickSeries event assigned. This is because the OnClickSeries event is fired instead of the zoom.

Using something like this may help:

Code: Select all

void __fastcall TForm1::Chart1MouseMove(TObject *Sender, TShiftState Shift,
      int X, int Y)
{
        if (Series1->Clicked(X,Y)!=-1) Chart1->AllowZoom=false;
        else Chart1->AllowZoom=true;
}
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

Fang
Newbie
Newbie
Posts: 66
Joined: Wed Oct 13, 2004 4:00 am

Post by Fang » Fri Apr 07, 2006 1:33 pm

I still wonder why this is as designed. It does make sense for 2D series or any sereis doesn't cover most of the area.

For surface or color grid, the sereis is everywhere; zoom and clickseries should be designed as different thing, don't you think.

Because of this issue, OnClickSeries is almost useless if I want zoom any where. I have to put the implementation on the OnClick event. Not a big deal. but it'll be great these two can be seperated.

Thanks.
Fang

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

Post by Pep » Tue Apr 11, 2006 2:57 pm

Hi Fang,

yes, I understand what you say, but as you know, as this can be good for you and others it could affect a lot of customers bcos this has been designed as is from the beginning, so it could be dangerous to change it. However I think most of these situations can be solved by using the OnMouseDown, move or up events.

Fang
Newbie
Newbie
Posts: 66
Joined: Wed Oct 13, 2004 4:00 am

Post by Fang » Thu Apr 13, 2006 5:37 pm

ok

Post Reply