Page 1 of 1

Bug: While set ChartClickSeries event, Zoom is broken

Posted: Thu Apr 06, 2006 5:16 pm
by 9234539
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

Posted: Fri Apr 07, 2006 8:42 am
by narcis
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;
}

Posted: Fri Apr 07, 2006 1:33 pm
by 9234539
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

Posted: Tue Apr 11, 2006 2:57 pm
by Pep
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.

Posted: Thu Apr 13, 2006 5:37 pm
by 9234539
ok