Horizontal Gauge Tickmarks

Overview

Tickmarks are the small marks used to represent a point on an axis scale, there are major and minor tickmarks, first used to indicate major step of an axis scale, second - minor step. You can control their appearance and position. To enable/disable tickmarks set enabled="True" or enabled = "false" to major_tickmarks or minor_tickmarks

Typical XML settings for the tickmarks are:

XML Syntax
Plain code
01 <axis>
02   <major_tickmark enabled="true" width="4" length="10" padding="0" align="Inside" shape="Trapezoid" />
03   <minor_tickmark enabled="true" width="2" length="5" padding="10" align="Outside" shape="Triangle" />
04 </axis>

to top

Tickmarks Parameters

The following attributes can be set for tickmarks:

Attribute Values Default Description
enabled true | false True Sets whether tickmarks are enabled or not
length Number Auto The length of tickmarks
width Number Auto The width of tickmarks
padding Number Auto The padding of tickmarks
align Inside | Outside | Center Center Sets the position of tickmarks
shape all marker types | Trapezoid | Pentagon | Rectangle | Triangle   Sets the shape of tickmarks

to top

Enabling/Disabling tickmarks

You may enable/disable major/minor tickmarks by editing the enabled attribute of the corresponding node:

XML Syntax
Plain code
01 <axis>
02   <major_tickmark enabled="false" />
03   <minor_tickmark enabled="false" />
04 </axis>

In this example we have disabled both major and minor tickmarks:

Live Sample:  Sample Horizontal Disabling tickmarks

to top

Positioning tickmarks

There are two nodes responsible for tickmarks' positioning. They are: align and padding. Let's look at some samples demonstrating the practical usage of these nodes.

Align attribute has three states: "Inside", "Outside" and "Center". In case of Horizontal Linear Gauges "Inside" means position of tickmarks above the scale, "Center" - inside the scale and "Outside" - under the scale. Padding attribute is set in percents and defines how far from the scale we move the tickmark. Padding can be represented in positive or negative values, which affects the direction of tickmark's movement. For "Center" and "Outside" states of align attribute positive values move the tickmark downwards, and negative - upwards. For the "Inside" state positive - upwards, negative - downwards.

By default the tickmarks are enabled and their position is set to "Inside", so if the corresponding nodes are missing, our gauge looks like this:

 

Live Sample:  Sample Horizontal Tickmarks Positioning 2

Let's imagine we want to create a gauge with tickmarks just below the upper border af the container. At first we need to set the proper padding. The default value for the padding attribute is "Inside", just above the upper border of the container. That is quite suitable for us. Now we need to move our tickmarks a wee bit lower. We need to use the negative values of padding for it (as well as the align is "Inside"). As well as the major tickmarks are bigger than the minor ones the padding will also be bigger. So we set "-6" padding for major tickmarks and "-3" padding for minor tickmarks. That's how it looks:

XML Syntax
Plain code
01 <axis>
02   <major_tickmark padding="-6" />
03   <minor_tickmark padding="-3" />
04 </axis>

 

Live Sample:  Sample Horizontal Tickmarks Positioning 1

to top

Changing tickmarks' visual appearance

And finally let's change our tickmarks' visual appearance. We have a whole arsenal of tools for it: width, length, shape. Their names speak for themselves. In addition, we may change the tickmarks' view with the help of subnodes: fill, hatch_fill, border, effects. Let's look at the following example. We change the major tickmarks's shape, color and set them above the scale. Minor tickmarks are disabled.

Live Sample:  Sample Horizontal Tickmarks Visual

to top