Page 1 of 1
TAreaSeries
Posted: Wed May 17, 2006 2:15 pm
by 9345063
I have a TAreaSeries.
With Stairs:=True the method Clicked(X,Y) doesn't work properly.
Thanks.
Posted: Wed May 17, 2006 2:22 pm
by narcis
Hi Alessandro,
It works fine for me here using TeeChart Pro v7.07 and this code:
Code: Select all
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var index: Integer;
begin
index:=Series1.Clicked(X,Y);
if index<>-1 then Chart1.Title.Text[0]:=IntToStr(index);
end;
procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Chart1.Title.Text[0]:=IntToStr(ValueIndex);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
Series1.Stairs:=true;
end;
Which TeeChart version are you using? If the problem persists, could you please send us an example we can run "as-is" to reproduce the problem here?
Thanks in advance.
Posted: Wed May 17, 2006 2:47 pm
by 9345063
I use TeeChart Pro v7.07. Where can I send you an example?
Thanks.
Posted: Wed May 17, 2006 3:01 pm
by narcis
Hi Alessandro,
Sorry, I forgot to post that.
You can post your files at news://
www.steema.net/steema.public.attachments newsgroup.
Thanks in advance.
Posted: Thu May 18, 2006 10:09 am
by narcis
Hi Alessandro,
Thanks for the example.
It works fine for me here using v7.07. Please notice that for an area to be drawn you need 2 points, that's why in your example, which has 5 points, Series1.Clicked(X,Y) only returns values from 0 to 3.
Posted: Thu May 18, 2006 1:39 pm
by 9345063
Hi,
I am goig to send you another example.
Please try to move your mouse over the red series....
Thanks.
Posted: Thu May 18, 2006 1:51 pm
by 9345063
I have a problem sending you the attachment. Please can you modify the example as follows:
1) Clone the AreaSeries
2) Change the color of the new AreaSeries to blue and set Stairs:=False.
3) now you have two serieses: the first one is red with Stairs=True, the other one is blue with Stairs=False.
4) Try to move the mouse over the red series.
Thanks.
Posted: Thu May 18, 2006 2:30 pm
by narcis
Hi Alessandro,
I've done that but all series indexes are still correct. Could you please try sending the example directly to me or make it available via
http://www.yousendit.com?
Thanks in advance.
Posted: Fri May 19, 2006 7:29 am
by narcis
Hi Alessandro,
We could finally reproduce the problem here. It can be sumarized with this code:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.View3D:=false;
Series1.Add(700);
Series1.Add(1000);
Series1.Add(500);
Series1.Add(1000);
Series1.Add(300);
Series1.Stairs:=true;
end;
procedure TForm1.Chart1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var index: Integer;
begin
index:=Series1.Clicked(X,Y);
if index<>-1 then Chart1.Title.Text[0]:=IntToStr(index)
else Chart1.Title.Text[0]:='No Series';
end;
Moving the mouse around the top of each area section makes Clicked method return wrong values. This is a bug which I've added to our defect list (TV52011421) to be fixed for future releases.