Hier mal mein Code, im Anhang ein Screenshot:
Prinzipiell das, was es machen soll, sieht bloß ekelig aus
Delphi-Quellcode:
FPoints : Array[0..144] of TPoint;
.
.
.
procedure THixHistoGraph.DrawGridScale;
var
XRangePixels, YRangePixels: Double;
Start: TPoint;
Radian, Interval: Double;
i : Integer;
begin
XRangePixels := (Width - GapLeft- GapRight) / (FXScale.ValGap);
YRangePixels := (Height - GapTop - GapBottom) / (FYScale.ValGap);
Start := Point(GapLeft, Height - GapBottom);
Radian := (FXScale.ValMin) * PI;
Interval := (FXScale.ValMax + FXScale.ValMin) * PI / 144;
for i:= 0 to High(FPoints) do
begin
FPoints[i].X := Start.X + round(Radian * xRangePixels / Pi);
FPoints[i].Y := Start.Y - round(sin(Radian) * yRangePixels);
Radian := Radian + Interval;
end;
Canvas.Pen.Color := cllime;
Canvas.Polyline(FPoints);
end;