Skip to main content

TdxCustomGaugeControl.AddScale(TdxGaugeCustomScaleClass) Method

Adds the scale object of the specified type to the Gauge Control.

Declaration

function AddScale(AScaleClass: TdxGaugeCustomScaleClass): TdxGaugeCustomScale;

Parameters

Name Type
AScaleClass TdxGaugeCustomScaleClass

Returns

Type
TdxGaugeCustomScale

Remarks

Invoke this function to add either the custom or standard scale to the ExpressGauge control area at runtime. The AScaleClass parameter specifies a particular scale class, inherited from the TdxGaugeCustomScale class. The AddScale function returns the generic form of a particular scale object. If you need to access the scale’s type-specific properties, cast the returned object to the required scale type:

var
  ACircularScale TdxGaugeCircularScale; // Use this variable to address the circular scale-specific properties
//...
  ACircularScale := TdxGaugeCircularScale(dxGaugeControl1.AddScale(TdxGaugeCircularScale)); // Add a circular scale
// Accessing the circular scale-specific property
  ACircularScale.RadiusFactor := 0.4;

You can also invoke the AddScale function instead of using the specialized AddContainer function in order to create container scales:

var
  AContainer: TdxGaugeContainerScale;  // Use this variable to address the container scale-specific properties
//...
  AContainer := dxGaugeControl1.AddScale(TdxGaugeControlContainerScale) as TdxGaugeContainerScale;  // Create a container scale

Alternatively, you can use the use the Add method, implemented in the TdxGaugeScaleCollection to programmatically create a scale within the Gauge Control instance.

Note

Use the Clear and DeleteScale methods to remove scales (including containers) from the ExpressGauge control programmatically.

See Also