There are some threads of mine with this topic and there is a demo, how it may work.
And it works - assumed that I do not have more than one kind of series.
Usually I have as main point of interest a candlestick chart, which means a TopenhighlowcloseSeries. (To this chart I add more series later at design time, mostly TLineSeries).
To this TAChart I add a ChartTool and there a TDataPointHint tool. There
I add an OnHInt-Event, which my look like this. Nothing special, just taken the code of the TAAchart help / demo.
with TDatapointHintTool(ATool) do begin
ser := Series as TChartSeries;
punkt := PointIndex;
end;
if ser <> nil
then AHint := DateToStr(ser.GetXValue(punkt)) +' ' + FloatToStr(ser.GetYValue(punkt))
else AHint := '';
This works fine, - until I add a second kind of series as TLineSeries or TBarSeries.
The first run-attempt may work fine as well.
But sooner or later, the troubles are that hard, that first my project does not compile any more and later my whole operating system says good-bye to me. Long lists of error-messages pop up (I posted them already, but do not think, they are useful).
These error-messages persist even if I close Lazarus and restart it.
A restart of my Win 7 VM helps as only solution.
Then I can re-start Lazarus, go to my TAChart and remove the property setting "tools" pointing at the tool containing the TPointHintTool.
Then my operating system and project is stable again.
This is the ONLY thing, which helps. To put the whole content of the On-Hint event into commentary does not help any more.
This does not happen in only one of my charts, but in the meanwhile of three, which work completely differently.
These charts are fed by a database and I am not good at databases and cannot extract it (and I must not do it).
Yes, you need a demo, but I cannot provide. I know, this is not a good thing.
So here comes my question to the plenum:
Does anybody use a (firebird-)database with Candelstick charts AND (!!) several further types of dataseries (as TLineSeries) together with it? And the ChartHintTool works fine for him?