TAChart: Fix TDataPointMarksClickTool crashing when series is empty.

This commit is contained in:
wp_xyz 2022-11-28 19:14:48 +01:00
parent 84f716a2ff
commit bb65b8022c

View File

@ -2027,10 +2027,10 @@ begin
for i := 0 to FChart.SeriesCount-1 do
begin
if not (FChart.Series[i] is TBasicChartSeries) then
if not (FChart.Series[i] is TBasicPointSeries) then
continue;
ser := TBasicPointSeries(FChart.Series[i]);
if ser.Active and ser.IsPointInLabel(FChart.Drawer, APoint, FPointIndex, FYIndex) then
if ser.Active and (ser.Count > 0) and ser.IsPointInLabel(FChart.Drawer, APoint, FPointIndex, FYIndex) then
begin
FSeries := ser;
FXIndex := 0; // to do: fix X index