Autor Beitrag
Jakane
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 257



BeitragVerfasst: Di 10.03.15 11:46 
Hallo liebe Delphi-Helfer :)

Ich habe eine DB-Tabelle mit Fehlerhinweisen (Fehlerart, Zeitpunkt, Anwender ect.) und ein Programm mit dem ich diese Angaben auswerten und für ein TChart vorbereiten kann.

Ich habe eine Tabelle die angibt, welcher Wert auf welche Serie kommt: lbID
Da steht z.B. folgendes drin:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
   0
   1
   2
   3
   0
   1
   2
   3
   0
   1
   2
   3
   4


Mit folgender Formel füll ich mein Chart:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  for f := 0 to lbID.Items.Count - 1 do
  begin
    // Variable initialisieren
    iID := StrToInt(lbID.Items.Strings[f]);
    iCount := StrToInt(lbCount.Items.Strings[f]);
    sGruppe := lbGruppierung.Items.Strings[f];
    sDetail := lbDetails.Items.Strings[f];

    // Serie zeichnen
    Chart.Series[iID].Add(iCount, sGruppe);
  end;


Problem ist nun die 4 kommt nur einmal vor, und statt wie gewünscht den Inhalt auf die 4. Serie zu legen, legt er mir das auf die 0. Serie drauf, weil Serie 0 bis 3 keine 4. Ebene hat.
Da die ID nur in diesem Fall schön sortiert ist, ich aber die höhste ID kenne (4) wollte ich die Serien schon vorher anlegen und erst danach mit meiner Formal (die natürlich geändert werden muss) die vorhandenen Serien editieren.

Ich weiss nur nicht wie ich eine vorhandene Serie bearbeiten kann :(

Ich hoffe ich konnte mein Problem darstellen und jemand kann mir helfen :) Danke

_________________
Die Welt besteht aus Zahlen, also ist alles möglich.
[Delphi 5] - [Delphi XE5]
baumina
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 305
Erhaltene Danke: 61

Win 7
Delphi 10.2 Tokyo Enterprise
BeitragVerfasst: Di 10.03.15 11:51 
Ich kann noch nicht so ganz folgen. Was ist lbCount, lbGruppierung und lbDetails?
Jakane Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 257



BeitragVerfasst: Di 10.03.15 11:58 
Äh...
ListBoxen in denen nur die Anzahl oder Bezeichnungen drin steht.
Eigendlich nicht Fehlerrelevant

_________________
Die Welt besteht aus Zahlen, also ist alles möglich.
[Delphi 5] - [Delphi XE5]
baumina
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 305
Erhaltene Danke: 61

Win 7
Delphi 10.2 Tokyo Enterprise
BeitragVerfasst: Di 10.03.15 12:07 
Wie gesagt, keine Ahnung was du da tust, aber wenn du wissen willst, wie man einer vorhandenen Serie einen neuen Wert hinzufügt, verwendet man z.B. Serie.AddXY.

Zitat:
function AddXY(Const AXValue, AYValue: Double; Const ALabel: String; AColor: TColor): Integer; virtual;

Unit
TeEngine

Description
This function inserts a new point in the Series.
The new point has X and Y values.

The ALabel parameter is optional (can be empty '').
The AColor parameter is optional (can be clTeeColor).
The function returns the new point position in the Values list.

Series1.AddXY( 123, 456, 'Hello', clGreen );
Jakane Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 257



BeitragVerfasst: Di 10.03.15 14:16 
Mit AddXY fügt man auch nur einen neuen Wert hinzu.

Aber damit kam ich auf den Hinweis nach Functionen mit X oder Y zu suchen und kam auf: Series[x].YValue[y]

Die tut was ich will.

Trotzdem Danke

_________________
Die Welt besteht aus Zahlen, also ist alles möglich.
[Delphi 5] - [Delphi XE5]