Autor Beitrag
Stecky2000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 51



BeitragVerfasst: Do 19.03.09 11:04 
HI,

ggf. könnt Ihr mir helfen.
Ich habe eine Chart das mit verschiedenen Daten gefüllt wird, das Maximum der notwendigen Skalierung also nicht vorhersehbar.

Wenn ich die Option LeftAxis.AutomaticMaximum auf True setze, dann funktioniert das zwar, aber es gefällt mir nicht.

Ich erkläre: mir gefällt nicht, das bei einem Höchstwer von z. B. 9,2, das automatische Maximum ebenfalls genau 9,2 ist und somit die Linie im Chart oben "voll Anklatsch" ist.

Ich habe einen Showmessage Dialog eingebaut und konnte LeftAxis.Maximum abfragen, da kam als Ergebnis jene 9,2. Also hab ich folgenden versucht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
Chart1.LeftAxis.AutomaticMaximum := True;
Chart mit Daten füllen
Wert := LeftAxis.Maximum + 5;
Chart1.LeftAxis.AutomaticMaximum := False;
Chart1.LeftAxis.Maximum := Wert;


In der Chart Komponente ist direkt als Maximum 650 eingegeben.

Und nach meinem Code zeigt das Chart ebenfalls 650 an statt der von mir erwateten 9,2 + 5!!!

Gibt es denn keine Methode, den vom Automatismus ermittelten Wert zu verarbeiten und wieder ein zu setzen?

Wenn ich statt der Automatik direkt
ausblenden Delphi-Quelltext
1:
Chart1.LeftAxis.Maximum := 15;					

eingebe, skaliert er ja auch direkt auf 15.

Ich hoffe Ihr köönt mir helfen.
Stecky2000 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 51



BeitragVerfasst: Sa 21.03.09 19:12 
Hat denn wirklich keiner eine Ahnung?

Bitte, bitte, bitte......
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit
D7, BDS 2006, RAD Studio 2009+C++, Delphi XE2, XE3, VS 2010 Prof.
BeitragVerfasst: Sa 21.03.09 19:38 
Hallo Stecky2000,

der Wert ist ja schon gezeichnet.

Ich würde mal versuchen statt:

ausblenden Delphi-Quelltext
1:
Chart1.LeftAxis.Maximum := Wert;					

ausblenden Delphi-Quelltext
1:
Chart1.LeftAxis.Maximum:= Chart1.LeftAxis.Maximum+5;					

zu versuchen.

Bis bald Chemiker
Stecky2000 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 51



BeitragVerfasst: Sa 21.03.09 20:00 
Danke, aber das habe ich und es ging nicht.

Indem Augenblick, in dem ich LeftAxis.AutomaticMaximum auf False setze, nimmt LeftAxis.Maximum den Wert der in der Komponente unter Maximun eingegebenen Wert an und da ist minimum eine 0 eingetragen.

D. h., die Anweisung

ausblenden Delphi-Quelltext
1:
Chart1.LeftAxis.Maximum:= Chart1.LeftAxis.Maximum+5;					


führt bei einem tatsächlichem Maximumwert von 800 nicht zu 800 + 5 = 805 sondern
zu (bei 0 in Komponete eingegebenem Maximum Wert) 0 + 5 = 5, bzw.
zu (bei 650 in Komponete eingegebenem Maximum Wert) 650 + 5 = 655 !

Was ich daran nicht verstehe ist, dass Bei noch eingeschaltetem AutomaticMaximum,
mit Showmessage tatsächlich 800 als Maximum ausgegeben wird, was ich in eine Variable schreibe,
eine Zeile weiter deaktiviere ich das AutomaticMaximum und die variable zeigt auf ein mal 650!?

Wie auch immer, ich habe es jetzt gelöst ;-)))

Ich habe es so gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
For i := 0 to 5 do
   If MaxWert1 < Chart1.Series[i].MaxYValue then
      MaxWert1 := Chart1.Series[i].MaxYValue;

Chart1.LeftAxis.Maximum := MaxWert1 + 20;


Trotzdem Danke, vielleicht kann das ja mal jemand brauchen.
Wenn man es weis ist es ja peanuts. ;-)
Chemiker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 194
Erhaltene Danke: 14

XP, Vista 32 Bit, Vista 64 Bit, Win 7 64 Bit
D7, BDS 2006, RAD Studio 2009+C++, Delphi XE2, XE3, VS 2010 Prof.
BeitragVerfasst: Sa 21.03.09 20:22 
Hallo Stecky2000,

ich verwende es zwar mit einer anderen Achse, um die Anzahl der Punkte zu reduzieren, aber bei mir funktionierst.

ausblenden Delphi-Quelltext
1:
2:
3:
DBMessChart.BottomAxis.Automatic:= FALSE;
DBMessChart.BottomAxis.Maximum:= FDBSeries3.XValues.Last;
DBMessChart.BottomAxis.Minimum:= DBMessChart.BottomAxis.Maximum -400;

Bis bald Chemiker
Stecky2000 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 51



BeitragVerfasst: So 22.03.09 23:03 
@Chemiker

Du machst doch das gleiche was ich gemacht habe.

Du beziehst einen Wert aus

DBMessChart.BottomAxis.Maximum den Du vorher von FDBSeries3.XValues.Last rein geschrieben hast.
Ich tue la letztendlich das gleiche, nur dass ich über 6 Series fahre.

Was nicht funktioniert, ist aus ".Maximum " einen Wert zu ziehen, den vorher die Funktion ".AutomaticMaximum" rein geschrieben hat.

Zumindest ist mir das nicht gelungen.