TMarkTools causes Access Violation Error if Series is empty
Posted: Wed Feb 08, 2012 2:49 pm
Hello
TeeChart2011.04.41118+BDS2006
with following project, whenever I move the mouse over the TChart, there will be access violation unless I disable the TMarkTools, or the series is not empty.
Steps:
1. Drop a TChart to the Form
2. Double click the Chart, and add an AreaSeries at design time
3. Double click the chart, and add a TMarkTool
4. in Form OnCreate event, have following code:
procedure TForm2.FormCreate(Sender: TObject);
var
AreaSeries: TAreaSeries;
begin
AreaSeries:=TAreaSeries.Create(Self);
AreaSeries.ParentChart :=Chart1;
AreaSeries.FillSampleValues(5);
AreaSeries.Marks.Visible :=False;
AreaSeries.LinePen.Visible :=False;
AreaSeries.AreaLinesPen.Visible := False;
AreaSeries.LinePen.Visible := False;
AreaSeries.MultiArea := maStacked;
end;
Run the application, and move the mouse, then you will have access violation error.
The reason for an empty series at step2 is that in the real situation, the series are linked to a source of TDataSet, who might be empty, where the problem is actually happened.
Detail please find in attachment. It contain the source code and also the exception call stack caught by Eurekalog.
TeeChart2011.04.41118+BDS2006
with following project, whenever I move the mouse over the TChart, there will be access violation unless I disable the TMarkTools, or the series is not empty.
Steps:
1. Drop a TChart to the Form
2. Double click the Chart, and add an AreaSeries at design time
3. Double click the chart, and add a TMarkTool
4. in Form OnCreate event, have following code:
procedure TForm2.FormCreate(Sender: TObject);
var
AreaSeries: TAreaSeries;
begin
AreaSeries:=TAreaSeries.Create(Self);
AreaSeries.ParentChart :=Chart1;
AreaSeries.FillSampleValues(5);
AreaSeries.Marks.Visible :=False;
AreaSeries.LinePen.Visible :=False;
AreaSeries.AreaLinesPen.Visible := False;
AreaSeries.LinePen.Visible := False;
AreaSeries.MultiArea := maStacked;
end;
Run the application, and move the mouse, then you will have access violation error.
The reason for an empty series at step2 is that in the real situation, the series are linked to a source of TDataSet, who might be empty, where the problem is actually happened.
Detail please find in attachment. It contain the source code and also the exception call stack caught by Eurekalog.