There is a TAChart with a huge amount of series: TLineSeries.
Today I addes an OHLC series.
On mouse over I read "invalid type cast". Not surprising, because I refer to TLineSeries and nothing else.
How can I work around?
Ideal would be to have BOTH of the series in my hint: the values of the active line series and that of the OHTLC as well.
procedure TFrame_cot_dis.Tool_HintHint(ATool: TDataPointHintTool;
const APoint: TPoint; var AHint: String);
var ser: TLineSeries;
idx: Integer;
yidx: Integer;
ttl: String;
s: string;
begin
with TDatapointHintTool(ATool) do begin
ser := Series as TLineSeries;
idx := PointIndex;
yidx := YIndex;
end;
if ser <> nil then begin
if yidx > 0 then
ttl := TLineSeries(ser).Styles.Styles[yidx].Text
else begin
ttl := ser.Title;
s := Zeit.StringDoubleWirdString(FloatToStr(ser.GetXValue(idx)));
AHint := ttl +': '+ FloatToStrF(ser.GetYValue(idx), ffFixed, 4, 0)+ ' (' + s + ')';
end
end else AHint := '';
end;