Horizontal Gauge Labels Configuration
- Overview
- Labels Parameters
- Enabling/Disabling labels
- Positioning labels
- Formatting labels
- Showing first and last labels
- Rotating labels along the Scale
Overview
Axis Labels are labels that are drawn near major tickmarks. You can adjust their font size, font color, a wide range of other attributes and define their font family. Also you may choose from what side should the labels be displayed (align) and how far they should stand from the tickmarks (padding). It's your desire to decide whether labels will be rotated along the scale and define this rotation.
Typical XML settings for the labels are:
Labels Parameters
The following attributes can be set for labels:
| Attribute | Values | Default | Description |
|---|---|---|---|
| enabled | true | false | false | Sets whether labels are enabled or not |
| show_first | true | false | True | Whether the label of first tickmark is shown |
| rotate_circular | true | false | False | Defines whether labels are rotated along the scale. |
| auto_orientation | true | false | True | Determines whether labels can be rotated more than 90 degrees (or, in other words, whether they can be displayed upside down). |
| show_last | true | false | True | Whether the label of last tickmark is shown |
| padding | Number | Auto | The padding of labels |
| align | Inside | Outside | Center | Center | Sets the position of labels |
| text_align | Near | Center | Far | Center | Defines the distance between gauge and label text |
| rotation | Number | 0 | Sets the angle of label's rotation |
Enabling/Disabling labels
By default labels are enabled, but you can disable them this way:
The result is as follows:

Positioning Labels
There are four nodes responsible for text positioning. They are: align, text_align, padding and rotation. Let's look at some samples demonstrating the practical usage of these nodes.
In this sample we will use align and padding attributes. Align attribute has three states: "Inside", "Outside" and "Center". Padding attribute is set in percents and defines how far from the scale we move the text. Padding can be represented in positive or negative values, which affects the direction of text's movement. Let's use the following settings for labels:
The result is as follows:

The rotation attribute affects on the text rotation angle and is set in degrees:
So, we rotate our labels 45 degrees CCW:

Formatting Labels
The labels can be formatted using subnodes of label node: Font, Format and Background. Let's change the label format: add a postfix "mph" and add label background:

Showing first and last Labels
You can choose whether to show first/last label value or not. This is done in a simple way, by setting true or false to show_first/show_last attribute:
In this example we have disabled showing both first and last labels:

Rotating labels along the Scale
You can decide whether your labels will be rotated along the axis scale. auto_orientation attribute is responsible for it. By default it is off. Let's turn it on. We also enable auto_orientation to prevent labels to be shown upside down when they indicate values that are set to more than 180 degrees.
That's what we get:

