@wp:
I added your demo and it looked great. All I dreamed about. The TPageControl looks better than everything I made.
This demo I put on a new frame in my project and tried to add my data - my whole operating system (Win 7) was shot.
So I started again from the beginning.
The problem are IMHO not the input data, but a type confusion.
The data look fine, they are drawn fine and they are written into a RichMemo fine.
So I took my backup with the most acceptable working version and try to put my question differently:
There is a chart with TSeriesOpenHighLowClose working fine:
Drawing fine, HintToolFine, "MouseOver" writes the figures fine.
Then I add 2 new series to my chart, still fine.
This changes - - , when I populate the first series by
K_Volume.AddXY(IBQuery_Zeichne.FieldByName('FK_JDATUM').AsDateTime, IBQuery_Zeichne.FieldByName('volume').AsInteger);
I think the error must be here, in the event of the TChartTool (see below).
In this event the type of the added TLineSeries causes a mess. IMHO
Expected is a TSeriesOpenHighLowClose and suddenly there is an additional TLineSeries.
On putting the TLineSeries population line into commentary, the problem is gone.
// Mouse-over bewirkt die Ausgabe der Kurse im Memo
procedure TFrame_Zeichne.AusgabeHint(ATool: TDataPointHintTool; const APoint: TPoint; var AHint: String);
var ser: TOpenHighLowCloseSeries;
punkt: Integer;
o, h, l, c: double;
tmp: integer; // aus Delpi
s: String;
d: double;
dat: TDate;
begin
Memo_AusgabeKerze.Clear; // die Ausgabe soll immer nur eine Kerze zeigen
with TDatapointHintTool(ATool) do begin // was das tut, weiß ich nicht genau. Es ist aus der Vorlage und vermutl. wichtig
ser := ATool.Series as TOpenHighLowCloseSeries;
punkt := PointIndex;
end;
if ser <> nil then begin
With Ser do begin
O:=YValues[punkt, YIndexOpen];
H:=YValues[punkt, YIndexHigh];
L:=YValues[punkt, YIndexLow];
c:=YValues[punkt, YIndexClose];
dat:=ser.GetXValue(punkt);
s:=Zeit.FORMATIERE_DATUM_nur_Wochentag_KURZ(Dat);
s := DateToStr(Dat) + ', ' + s + #13#10; // + #13#10;
s := s + 'open=' + FloatToStrF(O,ffFixed,4,4) + #13#10;
s := s + 'high=' + FloatToStrF(h,ffFixed,4,4) + #13#10;
s := s + 'low=' + FloatToStrF(L,ffFixed,4,4) + #13#10;
s := s + 'close=' + FloatToStrF(C,ffFixed,4,4) + #13#10;
d:=H - L;
s := s + 'range=' + FloatToStrF(d,ffFixed,4,4) + #13#10; // letzte Zahl=Kommastellen
Memo_AusgabeKerze.Lines.Add(s);
end;
end;
Label_BigCandle.Caption:= s; // auf Label
Series_BigCKontr.Clear; // USD hier nicht, weil 2 mal DB dazu nötig
Series_BigCKontr.AddXOHLC(dat, o, h, l, c); // erzeugt große Kerze
// else AHint := '';
end;