![]() |
Probleme mit TChart
Nabend...
mal ne kleine frage zu tchart... ist zwar ein bissl schwierig zu erklären, desshalb hab ich nen bild angehängt => ![]() also man sieht in der unteren Leiste die Zahlen von 0 - 30 (arbeite mit seriesX.Add() ) so... nun soll da aber 1 - 31 stehen. weiß jemand, was ich da umstellen muss? MFG |
Re: Probleme mit TChart
Zeig mal etwas Code.
|
Re: Probleme mit TChart
Ist jetzt dummerweise nicht kommentiert...
Delphi-Quellcode:
var statistiken: Tstatistiken; statsini: Tinifile; implementation uses Unit1; {$R *.dfm} function Tstatistiken.GetToken(aString, SepChar: string; TokenNum: Byte): string; var Token: string; StrLen: Byte; Num: Byte; EndofToken: Byte; begin StrLen := Length(aString); Num := 1; EndofToken := StrLen; while ((Num <= TokenNum) and (EndofToken <> 0)) do begin EndofToken := Pos(SepChar, aString); if EndofToken <> 0 then begin Token := Copy(aString, 1, EndofToken - 1); Delete(aString, 1, EndofToken); Inc(Num); end else Token := aString; end; if Num >= TokenNum then Result := Token else Result := ''; end; function tnd : Integer; var rec: Integer; begin rec := strtoint(Trim(form1.GetToken(datetostr(now),'.',1))); rec := rec * 1; result := rec; end; function tnm : Integer; var rec: Integer; begin rec := strtoint(Trim(form1.GetToken(datetostr(now),'.',2))); rec := rec * 1; result := rec; end; function tny : Integer; var rec: Integer; begin rec := strtoint(Trim(form1.GetToken(datetostr(now),'.',3))); rec := rec * 1; result := rec; end; procedure Tstatistiken.FormCreate(Sender: TObject); begin statsini:=TIniFile.create(ExtractFilePath(ParamStr(0))+'/stats/login.dat'); end; procedure Tstatistiken.Button4Click(Sender: TObject); var I, I2: Integer; sstring: array[1..3] of String; begin sstring[1] := '.'+inttostr(tnm)+'.'+inttostr(tny); case tnm of 1: begin sstring[2] := '.12.'+inttostr(tny-1); sstring[3] := '.11.'+inttostr(tny-1); end; 2: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny-1); sstring[3] := '.11.'+inttostr(tny-1); end; 3: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny-1); sstring[3] := '.12.'+inttostr(tny-1); end; 4: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 5: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 6: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 7: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 8: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 9: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 10: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 11: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; 12: begin sstring[2] := '.'+inttostr(tnm-1)+'.'+inttostr(tny); sstring[3] := '.'+inttostr(tnm-2)+'.'+inttostr(tny); end; end; for I := 1 to 3 do begin for I2 := 1 to 31 do begin TLineSeries(findcomponent('Series'+inttostr(I))).Add(statsini.ReadInteger(inttostr(I2)+sstring[I], 'userlogin', 0)); end; end; end; end. |
Re: Probleme mit TChart
Hallo
verwende statt .add .addxy, da kannst du auch die x-Werte setzen Mfg Frank |
Re: Probleme mit TChart
danke, werd ich mal probieren
EDIT: :wall: :wall: :wall: :wall: :wall: :wall: :wall: Sry.. ich war so blöd und hab nicht auf die weiteren parameter von .Add() geachtet... da kann man den namen des Wertes eintragen also auch 1..2..3.. usw... |
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:48 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz