procedure TBoxplot.zeichnen(Boxplot : real);
var i, xWert, index: integer;
eineLaengeneinheit : Double;
getHeight : array[0..9] of integer;
getWidth : array[0..3] of integer;
begin
if Length(FZahlen) > 0 then begin
xWert := 50;
index := trunc(Boxplot);
eineLaengeneinheit := (FSize[1]-120) / (FZahlen[index][High(FZahlen[index])] - FZahlen[index][0]);
getHeight[0] := round(FSize[0] * 0.31919 + FHeight * Boxplot);
getHeight[1] := round(FSize[0] * 0.13214 + FHeight * Boxplot);
getHeight[2] := round(FSize[0] * 0.18379 + FHeight * Boxplot);
getHeight[3] := round(FSize[0] * 0.04839 + FHeight * Boxplot);
getHeight[4] := round(FSize[0] * 0.09839 + FHeight * Boxplot);
getHeight[5] := round(FSize[0] * 0.21839 + FHeight * Boxplot);
getHeight[6] := round(FSize[0] * 0.15839 + FHeight * Boxplot);
getHeight[7] := round(FSize[0] * 0.26839 + FHeight * Boxplot);
getHeight[8] := round(FSize[0] * 0.28839 + FHeight * Boxplot);
getHeight[9] := round(FSize[0] * 0.27742 + FHeight * Boxplot);
getWidth[0] := round(xWert + (FQuartils[index][0] - FZahlen[index][0]) * eineLaengenEinheit);
getWidth[1] := round(xWert + (FMedian[index] - FZahlen[index][0]) * eineLaengenEinheit);
getWidth[2] := round(xWert-1 + (FQuartils[index][1] - FZahlen[index][0]) * eineLaengenEinheit);
// Name des Boxplots
FPaintBox.Canvas.TextOut(xWert-20, getHeight[3]-20, FNamen[index] + ':');
// Einteilung/Markierung
// Minimum
FPaintBox.Canvas.TextOut(xWert-5, getHeight[0], FloatToStr(FZahlen[index][0]));
drawLine(clRed, xWert, getHeight[1], xWert, getHeight[2]);
// Maximum
FPaintBox.Canvas.TextOut(FWidth-5, getHeight[0], FloatToStr(FZahlen[index][High(FZahlen[index])]));
drawLine(clRed, FWidth, getHeight[1], FWidth, getHeight[2]);
// unteres Quartil
FPaintBox.Canvas.TextOut(getWidth[0]-5, getHeight[3], FloatToStr(FQuartils[index][0]));
drawLine(clRed, getWidth[0], getHeight[4], getWidth[0], getHeight[5]);
// FMedian[index]
FPaintBox.Canvas.TextOut(getWidth[1]-5, getHeight[3], FloatToStr(FMedian[index]));
drawLine(clRed, getWidth[1], getHeight[4], getWidth[1], getHeight[5]);
// oberes Quartil
FPaintBox.Canvas.TextOut(getWidth[2]-5, getHeight[3], FloatToStr(FQuartils[index][1]));
drawLine(clRed, getWidth[2], getHeight[4], getWidth[2], getHeight[5]);
//Boxplot an sich
drawLine(clBlack, xWert, getHeight[6], getWidth[0], getHeight[6]);
drawLine(clBlack, getWidth[0], getHeight[4], getWidth[2], getHeight[4]);
drawLine(clBlack, getWidth[0], getHeight[5], getWidth[2], getHeight[5]);
drawLine(clBlack, getWidth[2], getHeight[6], FWidth, getHeight[6]);
//Skala
for i := 0 to round(FZahlen[index][High(FZahlen[index])]-FZahlen[index][0]) do begin
getWidth[3] := round(xWert + i * eineLaengenEinheit);
drawLine(clBlack, getWidth[3], getHeight[7], getWidth[3], getHeight[8]);
end;
drawLine(clBlack, xWert, getHeight[9], FWidth, getHeight[9]);
end;
end;