Autor Beitrag
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 23.03.05 17:25 
Ich versteh noch nicht ganz, was das "Value" ist :gruebel:

AXMD
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: Mi 23.03.05 17:27 
Der maximale Wert bzw. die Projektion der Länge deines Zeigers auf die Achse.
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 23.03.05 17:48 
Hm... funktioniert irgendwie bei mir nicht; ich glaub, ich muss das mal komplett überarbeiten, wenn ich Zeit habe. Danke jedenfalls

AXMD
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 23.03.05 18:53 
Nehmen wir mal den gegebenen Fall her:

W:=456;
5 Unterteilungen
0 bis 5,85

So Teile ich zuerst mal 5,85 durch 5 --> 1,17
Nun ermittle ich den ganzzahligen 10er Log --> 0 (.068)
Dann rechnest Du den zehner-Log zurück auf 10^Int(Log) --> 1
Wenn die Anzahl der Unterteilungen (Int(5,85 / Scale)) > als die Anzahl der Unterteilungen ist, scalierst Du indem Du Scale (1) einfach verdoppelst.
Danach rechnest Du aus, wo auf der 456-Pixel-Strecke der Wert 1 und die anderen Scale-Werte (2, 3, 4, 5, ...) liegt.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 23.03.05 20:40 
@BenBE: Genau so ungefähr funktioniert die Autoskalierung beim Zoomen in meinem Programm TyMathPlotter :)
Achsenlänge mal Konstante, dann Log, abrunden, 10^ dann evtl. noch *2 oder /2.
So kriegt man immer schöne Unterteilungen in 1er, 10er, 100er Schritten, bzw. 2er, 20er 200er, bzw. 5, 50, oder 500er.
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Mi 23.03.05 22:19 
Vielen Dank, werd ich mir morgen mal zu Gemüte führen; heute schaff ich das nicht mehr ^^

AXMD
AXMD Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 26.03.05 10:47 
Gut, ich hab mir das heute morgen angesehen und muss zugeben, es hat nicht funktioniert. Zwei Möglichkeiten:

1.) Ich bin einfach zu dumm, das zu implementieren
2.) Ich hab irgendwo bei den Beschriftungen einen Bug drinnen - kann nämlich sein, dass ich die Achse zwar bis zum Ende der Zeichenfläche rechne, die Beschriftungen aber nur bis 10 Pixel davor. Ich muss mir das nochmal ansehen und sag euch gegebenenfalls Bescheid, falls ich nochmals Hilfe brauche ;)

Danke jedenfalls ;)
AXMD