I have this problem with the crosshair that is bugging me.
I know what is happening but not how to solve it. Tried many things but even AI did not give the answer i needed.
Example: in a chart are 6 lines and with the [Ctrl]+mousemove the crosshair wil give the datapoint below the crosshair. This works as expected and when the crosshair is not close enough tot he lines it disappears: as expected.
Then new lines are loaded in the same chart after deleting the previous with
if (aChart.SeriesCount > 0) then
for i := aChart.SeriesCount - 1 downto 0 do
if (aChart.Series[i] is TChartSeries) then
TChartSeries(aChart.Series[i]).Free;
Which works perfectly well.
UNLESS: the crosshair was visible when deleting and loading new lines. Then it trows an listindex error in the function
function TListChartSource.GetItem(AIndex: Integer): PChartDataItem;
begin
Result := PChartDataItem(FData.Items[AIndex]);
end;
of the TASources unit.
I can understand why it does this: the previous chart series are gone and new are in place. But how teach the crosshair not to display and reset itself?
As said I tried a lot (Enable/disable/hide).
Please find my program in the attachment. It it only the essentials but still big.
Start program – goto tab ‘injections’ – press [ctrl]+mousemove and set crosshair. – goto to tab ‘alingment’ and witness the problem.
Please what should i do to solve the crosshair?