In This Article

Tick Marks and Labels

Tick marks and tick labels can be included and make it easier to visually determine the current value of a pointer.

Screenshot

A LinearGauge with various tick marks and tick labels

Tick Marks

Tick marks are indicators or shapes rendered at a given interval along a value range. Both the interval and the value range are defined on the associated LinearTickSet element. See the Tick Sets topic for more information.

There are three types of tick marks: Major, Minor, and Custom.

Major Tick Marks

Major tick marks are rendered at the MajorInterval specified on the associated LinearTickSet. By default, major tick marks are larger than minor tick marks.

Screenshot

A LinearGauge with the major tick marks highlighted

Major tick marks can be included by adding an instance of LinearTickMarkMajor to the LinearTickSet.Ticks collection. A single instance of LinearTickMarkMajor is typically used to render all of the major tick marks.

Which tick marks are rendered by an instance of LinearTickMarkMajor can be restricted using the following properties:

Property Description
EndValue Specifies the last (or largest) value that should be rendered by the element. Set to Double.NaN to specify that there is no end value.
MaximumTickVisibility Specifies when the tick mark for the maximum value should be rendered.
MinimumTickVisibility Specifies when the tick mark for the minimum value should be rendered.
SkipValues Specifies 0 or more specific values that should not be rendered.
StartValue Specifies the first (or smallest) value that should be rendered by the element. Set to Double.NaN to specify that there is no start value.
Tip

You can use multiple instances of LinearTickMarkMajor to show tick marks in a specific range using a unique look.

Using the images above as an example, one instance could be set to use a black background (as shown) and have an end value of 90. A second instance could be set to use a red background and have a start value of 100.

Minor Tick Marks

Minor tick marks are rendered at the MinorInterval specified on the associated LinearTickSet. Additionally, minor tick marks are not rendered when they fall on the major interval.

Screenshot

A LinearGauge with the minor tick marks highlighted

Minor tick marks can be included by adding an instance of LinearTickMarkMinor to the LinearTickSet.Ticks collection. A single instance of LinearTickMarkMinor is typically used to render all of the minor tick marks.

Which tick marks are rendered by an instance of LinearTickMarkMinor can be restricted using the following properties:

Property Description
EndValue Specifies the last (or largest) value that should be rendered by the element. Set to Double.NaN to specify that there is no end value.
SkipValues Specifies 0 or more specific values that should not be rendered.
StartValue Specifies the first (or smallest) value that should be rendered by the element. Set to Double.NaN to specify that there is no start value.
Tip

You can use multiple instances of LinearTickMarkMinor to show tick marks in a specific range using a unique look.

Using the images above as an example, one instance could be set to use a black background (as shown) and have an end value of 95. A second instance could be set to use a red background and have a start value of 105.

Custom Tick Marks

When the major and minor tick marks do not offer enough customization, custom tick marks maybe used. Custom tick marks can be placed at a specifc value (shown at value 98.6 in the images above) by setting the Value property. Just like the major and minor tick marks, the look of the custom tick marks can be fully customized.

Tick Labels

Tick labels are textual representation of a value rendered at a given interval along a value range. Both the interval and the value range are defined on the associated LinearTickSet element. See the Tick Sets topic for more information.

There are three types of tick labels: Major, Minor, and Custom.

Major Tick Labels

Major tick labels are rendered at the MajorInterval specified on the associated LinearTickSet.

Screenshot

A LinearGauge with the major tick labels highlighted

Major tick labels can be included by adding an instance of LinearTickLabelMajor to the LinearTickSet.Ticks collection. A single instance of LinearTickLabelMajor is typically used to render all of the major tick labels.

Which tick labels are rendered by an instance of LinearTickLabelMajor can be restricted using the following properties:

Property Description
EndValue Specifies the last (or largest) value that should be rendered by the element. Set to Double.NaN to specify that there is no end value.
MaximumTickVisibility Specifies when the tick label for the maximum value should be rendered.
MinimumTickVisibility Specifies when the tick label for the minimum value should be rendered.
SkipValues Specifies 0 or more specific values that should not be rendered.
StartValue Specifies the first (or smallest) value that should be rendered by the element. Set to Double.NaN to specify that there is no start value.
Tip

You can use multiple instances of LinearTickLabelMajor to show tick labels in a specific range using a unique look.

Using the images above as an example, one instance could be set to use a black foreground (as shown) and have an end value of 90. A second instance could be set to use a red foreground and have a start value of 100.

Minor Tick Labels

Minor tick labels are rendered at the MinorInterval specified on the associated LinearTickSet. Additionally, minor tick labels are not rendered when they fall on the major interval.

Screenshot

A LinearGauge with the minor tick labels highlighted

Minor tick labels can be included by adding an instance of LinearTickLabelMinor to the LinearTickSet.Ticks collection. A single instance of LinearTickLabelMinor is typically used to render all of the minor tick labels.

Which tick labels are rendered by an instance of LinearTickLabelMinor can be restricted using the following properties:

Property Description
EndValue Specifies the last (or largest) value that should be rendered by the element. Set to Double.NaN to specify that there is no end value.
SkipValues Specifies 0 or more specific values that should not be rendered.
StartValue Specifies the first (or smallest) value that should be rendered by the element. Set to Double.NaN to specify that there is no start value.
Tip

You can use multiple instances of LinearTickLabelMinor to show tick labels in a specific range using a unique look.

Using the images above as an example, one instance could be set to use a black foreground (as shown) and have an end value of 95. A second instance could be set to use a red foreground and have a start value of 105.

Custom Tick Labels

When the major and minor tick labels do not offer enough customization, custom tick labels maybe used. Custom tick labels can be placed at a specifc value (shown at value 98.6 in the images above) by setting the Value property. Additionally, the text displayed by the custom label can be specified using the Text property. Just like the major and minor tick labels, the look of the custom tick labes can be fully customized.

Rounding and Text Format

By default, the tick labels will round the associated value(s) to the nearest whole number and convert that to a string, which is displayed on the gauge. Both the method of rounding and the text format can be customized using the RoundMode and TextFormat properties, respectively.

The rounding used is specified using the RoundMode enumeration, which offers several rounding methods. See the PixelSnapper topic for more information on the various round modes.

The format is used to convert double values to a string using the String.Format method, which uses the associated value as the only input parameter (e.g. {0}).

Scale Placement

Tick marks and tick labels are positioned relative to the scale bar defined by the associated LinearScale element. By default, the ticks will be overlayed and centered on the scale bar. The placement of the ticks can be altered using the ScalePlacement and ScaleOffset properties.

There are three possible values for the ScalePlacement property:

Value Description
Inside Indicates that the tick will be placed below, when oriented horizontally, or to the left, when oriented vertically, of the scale bar. The outer edge of the tick will be aligned with the inner edge of the scale bar.
Outside Indicates that the tick will be placed above, when oriented horizontally, or to the right, when oriented vertically, of the scale bar. The inner edge of the tick will be aligned with the outer edge of the scale bar.
Overlay Indicates that the tick will be centered over (or on top) of the scale bar. The center line of the tick will be aligned with the center line of the scale bar.

In addition to the placement, the ScaleOffset can be used to further customize the location of the ticks.