﻿ Axis Calculated Ticks
 .netCHARTING v6.0 Documentation Send comments on this topic. Axis Calculated Ticks
 Getting Started > General Tutorials > Axis Tutorials > Axis Ticks > Axis Calculated Ticks

Glossary Item Box

Introduction

Previous to version 3.2, to create an axis tick representing a value such as the average of the plotted data, the value had to be calculated, then, an axis tick was manually added to the axis. This process has now been simplified down to one simple line of code.

Calculated Axis Tick

The following code adds a calculated tick to an axis.

```[C#]
```[Visual Basic]

As you can see, this code does not specify any data to perform the calculation on. In this case, the data plotted on the axis is calculated.

Data Specific

A calculation based on only one series of the data shown on an axis is often desired. When this is the case, a single series or any number of series can be specified to base the calculation on.

The following code demonstrates specifying a series:

```[C#]
```[Visual Basic]
 To specify multiple series, place them into a series collection which can be specified as a method parameter.

Using a template

The resulting axis tick will show the calculated value, however, if additional formatting or textual modifications are required, a template can be specified. The '%Value' token in the template will be replaced with the resulting value. The following examples demonstrate template usage.

```[C#]
```[Visual Basic]

Calculated axis ticks can also be generated for shadow axes. Despite the data not being bound to the actual axis, a shadow axis will base it's calculations on the parent axis' data.

A common task could be to have an original axis show the scale, and a shadow axis on the other side of the chart can show the calculated axis ticks as shown below.

```[C#]
```[Visual Basic]