ISpeedometerTickInfo.Proportion

Syntax

Proportion: Double;

Description

The Proportion property determines the ratio of height to width of the tick mark.

NOTE. Depending on the selected form of tick marks, this property determines the ratio of various form elements. For details see the description of specific forms of the SpeedometerTickShapes enumerable type.

Example

Executing the example requires a form with the Button1 button and the SpeedometerBox component named SpeedometerBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

s: ISpeedometer;

v: ISpeedometerView;

ScaleView: ISpeedometerScaleView;

MajTick, MinTick: ISpeedometerTickInfo;

Begin

s := SpeedometerBox1.Speedometer;

v := s.View;

s.BeginUpdate;

ScaleView := v.ScaleViews.Item(0);

MajTick := ScaleView.MajorTickInfo;

MinTick := ScaleView.MinorTickInfo;

//Main

MajTick.Color := GxColor.FromName("Green");

MajTick.Height := 3;

MajTick.Proportion := 0.2;

MajTick.Shape := SpeedometerTickShapes.Rombus;

//Additional

MinTick.Color := GxColor.FromName("Red");

MinTick.Height := 2;

MinTick.Proportion := 0.3;

MinTick.Shape := SpeedometerTickShapes.Rect;

s.EndUpdate;

End Sub Button1OnClick;

After executing the example, on clicking the button, the formatting of major and minor scale tick marks of the speedometer displayed in the SpeedometerBox1 component is changed. Major tick marks are displayed as green diamonds, the diamond side is 3 millimeters, the diamond diagonals ratio is 0.2. Minor tick marks are displayed as red rectangles, the height of rectangle is 2 millimeters, the width and height ratio is 0.3.

See also:

ISpeedometerTickInfo