# Specifying the Major and Minor Ticks in Code

## Content



There are two types of ticks on the axis: major tick has a small line and corresponding label while the minor tick has only the line across the axis.

By default, the distance between ticks is calculated automatically.

To set a specific distance, use the [MajorUnit](/componentone/api/wpf/online-chart/dotnet-framework-api/C1.WPF.C1Chart.4.6.2/C1.WPF.C1Chart.Axis.MajorUnit.html) and [MinorUnit](/componentone/api/wpf/online-chart/dotnet-framework-api/C1.WPF.C1Chart.4.6.2/C1.WPF.C1Chart.Axis.MinorUnit.html) properties.

**Default Ticks**

The following image displays the default ticks:

![](https://cdn.mescius.io/document-site-files/images/9e1b6c55-78c5-4648-896a-23e777db9f27/images/graphics/tbhspecifyingmajoranadminorticksdefaultticks.png)

**Custom Ticks**

The following chart image uses the **MajorUnit** and **MinorUnit** properties to set the specific distance, for example:

```vbnet
c1Chart1.View.AxisY.MajorUnit = 5
c1Chart1.View.AxisY.MinorUnit = 1
```

```csharp
c1Chart1.View.AxisY.MajorUnit = 5;
c1Chart1.View.AxisY.MinorUnit = 1;
```

**Time Axis**

For time axis you can specify the **MajorUnit** and **MinorUnit** as a **TimeSpan** value:

```vbnet
c1Chart1.View.AxisY.MajorUnit = TimeSpan.FromHours(12)
```

```csharp
c1Chart1.View.AxisY.MajorUnit = TimeSpan.FromHours(12);
```

## See Also

[Grid Lines](/componentone/docs/wpf/online-chart/overview/ChartFeatures/Axis/GridLines)