Hello,
I noticed a bug which occurs also in TeeChartOffice. I'm using TeeChart Pro 8.0.1.10787
Description : When 2 series are exactly at the same position, and one series is not visible, clicking on the Series sometimes calls OnSeriesClicked with the invisible Series.
How to do the bug in TeeChartOffice :
- create 2 FastLineSeries with the same points (Series1 and Series2)
- uncheck Series2 (set series.pen.visible to false)
- right-click on the Series1 which is still visible, change the color and you'll notice it's the Series2 which gets the new color
My opinion : I didn't check the source code of TChart, but I guess a test is missing when searching the series which is clicked.
Regards
[BUG] OnSeriesClick called with the wrong Series
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bertrod,
This doesn't seem a bug to me. You can reproduce what you report using the code snippet below. However, it works fine commenting in the line that makes the pen not visible and comment out the line that makes the series not visible. Making a series' pen not visible is not the way to hide a series.
This doesn't seem a bug to me. You can reproduce what you report using the code snippet below. However, it works fine commenting in the line that makes the pen not visible and comment out the line that makes the series not visible. Making a series' pen not visible is not the way to hide a series.
Code: Select all
procedure TForm1.Series1Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Chart1.Title.Text.Add('Series1Clicked');
end;
procedure TForm1.Series2Click(Sender: TChartSeries; ValueIndex: Integer;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
Chart1.Title.Text.Add('Series2Clicked');
end;
procedure TForm1.FormCreate(Sender: TObject);
var SecondSeries: TChartSeries;
begin
Series1.FillSampleValues();
SecondSeries:=CloneChartSeries(Series1);
Series1.OnClick:=Series1Click;
SecondSeries.OnClick:=Series2Click;
Chart1.Legend.CheckBoxes:=true;
(SecondSeries as TLineSeries).LinePen.Visible:=false;
//SecondSeries.Visible:=false;
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Ok, then what is pen.visible useful for ? I'm hiding series with pen.visible because I sometimes need to hide a serie, but not its axis.narcis wrote:Making a series' pen not visible is not the way to hide a series.
I think it can be "considered as a bug", because this behaviour occurs only when you click on a visible series. So how would you explain that the Series2 is not clickable, but is called when clicking on another visible series which is exactly the same position ? Sounds a bit strange.
However, I could manage my problem by checking if pen.visible = false in the OnSeriesClicked; and if it is the case, I just search the chart for the first visible series at that position and it works fine.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bertrod,
I find series pen not visible useful in 3D charts where the brush is visible and makes sense hiding the pen.
I find series pen not visible useful in 3D charts where the brush is visible and makes sense hiding the pen.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |