# Axis Labels

Get started with MultiSelect, a WinForms control that makes selecting multiple objects from a list or a collection of selected items easy. See more in documentation here.

## Content

**Axis Labels** represent the major divisions along an axis. Labels on a category axis display category names, while labels on a value axis display numeric values.
**FlexChart** automatically generates axis labels from the chart data. When the available space is limited, **FlexChart** can hide labels to prevent overlap.
Use the following properties to configure axis labels:

* [LabelMax](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.LabelMax.html) specifies whether the maximum axis label is always displayed.
* [LabelMin](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.LabelMin.html) specifies whether the minimum axis label is always displayed.
* [Axis.RoundLimits](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.RoundLimits.html) adjusts the axis limits to align with the [MajorUnit](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.MajorUnit.html) interval.
* [Labels](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.Labels.html) controls label visibility.
* [LabelAlignment](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.LabelAlignment.html) positions labels relative to the tick marks.
* [Format ](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.Format.html)defines the label format.

The following code example configures **FlexChart** axis labels. It sets the label **format**, **alignment**, **interval**, and **maximum axis level**.

```csharp
//Specifies label position relative to its axis line
flexChart1.AxisX.LabelAlignment = AxisLabelAlignment.Top;
flexChart1.AxisY.Format = "#,##0,,";
//Displays max axis value
flexChart1.AxisY.LabelMax = true;
//Rounds off max axis value
flexChart1.AxisY.RoundLimits = true;                    
```

```vbnet
'Specifies label position relative to its axis line
Me.flexChart1.AxisX.LabelAlignment = AxisLabelAlignment.Top
Me.flexChart1.AxisY.Format = "#,##0,,"
'Displays max axis value
Me.flexChart1.AxisY.LabelMax = true
'Rounds off max axis value
Me.flexChart1.AxisY.RoundLimits = true                  
```

***

## Custom Format Axis Labels

In addition to the standard formats supported by the `Format` property, **FlexChart** supports custom axis-label formatting through the [Axis.Formatter](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.Formatter.html) property.
The `Formatter` property accepts a custom formatter that determines the label output.
The following image shows custom formatting applied to Y-axis labels.
![C1WinForms FlexChart - chart after applying formatter property](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/image-20260701.14d601.png)
The associated example defines a custom formatter named `CustomAxisLabelFormatter` and assigns it to the `Formatter` property of the Y-axis.

```auto
//using a custom formatter, to format the Axis labels
this.flexChart1.AxisY.Formatter = new CustomAxisLabelFormatter();
```

```auto
' using a custom formatter, to format the Axis labels
me.flexChart1.AxisY.Formatter = new CustomAxisLabelFormatter()
```

The following code example defines the **CustomAxisLabelFormatter** class for custom label formatting.

```auto
internal class CustomAxisLabelFormatter : ICustomFormatter
{
    public string Format(string format, object arg, IFormatProvider formatProvider)
    {
        //applying a custom format
        var formattedString = string.Format("{0:0,.#k}", arg);
        //returning the custom formatted string
        return formattedString;
    }
}
```

```auto
Friend Class CustomAxisLabelFormatter Inherits ICustomFormatter
 Public Function Format(ByVal format As String, ByVal arg As Object, ByVal formatProvider As IFormatProvider) As String
     Dim formattedString = String.Format("{0:0,.#k}", arg)
     Return formattedString
 End Function
End Class
```

***

## Overlapping Labels

Axis labels can overlap when the label text is long or when the chart displays many labels in a limited area.
Use the [Axis.OverlappingLabels](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.OverlappingLabels.html) property to configure how FlexChart handles overlapping labels. The property accepts values from the `OverlappingLabels` enumeration.
The default value, `Auto`, hides overlapping labels when the available space is limited. Other options support **displaying**, **trimming**, or **wrapping** the labels.
The following images show the available overlapping-label behaviors:

| **OverlappingLabel.Auto** |
| --------------------- |
| ![C1WinForms FlexChart - chart after applying overlapping property "Auto mode"](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-auto.png) |
| **OverlappingLabel.Show** |
| ![C1WinForms FlexChart - chart after applying overlapping property "Show mode"](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-show.png) |
| **OverlappingLabel.Trim** |
| ![C1WinForms FlexChart - chart after applying overlapping property "Trim mode"](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-trim.png) |
| **OverlappingLabel.Wrap** |
| ![C1WinForms FlexChart - chart after applying overlapping property "Warp mode"](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-wrap.png) |

```csharp
//Wrap the label text if it exceeds the available width
    this.flexChart1.AxisX.OverlappingLabels = OverlappingLabels.WordWrap;
```

```vbnet
' Wrap the label text if it exceeds the available width
    me.flexChart1.AxisX.OverlappingLabels = OverlappingLabels.WordWrap                   
```

***

## Rotate Axis Labels

**FlexChart** supports vertical and angled axis labels.

### Display Vertical Labels

Set the [Axis.Style.VerticalText](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.ChartStyle.VerticalText.html) property to `true` to display axis labels vertically instead of using the default horizontal orientation.
The following image shows vertically oriented X-axis labels:
![C1WinForms FlexChart - chart after applying verticalText property ](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabel-orientation.png)

```csharp
//set the orientation of labels
this.flexChart1.AxisX.Style.VerticalText = true;
this.flexChart1.AxisY.Style.VerticalText = false;
```

```vbnet
' set the orientation of labels
me.flexChart1.AxisX.Style.VerticalText = true
me.flexChart1.AxisY.Style.VerticalText = false
```

### Set the Label Angle

Use the [LabelAngle](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.LabelAngle.html) property to rotate axis labels relative to the axis line. The property accepts values from `-90` through `90` degrees and rotates the labels counterclockwise.
The following image shows axis labels rotated by an angle:
![C1WinForms FlexChart - chart after applying LabelAngle property](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-rotate.png)

```csharp
//Rotate the labels counter-clockwise by 70 degrees
    this.flexChart1.AxisX.LabelAngle = 70;
```

```vbnet
'Rotate the labels counter-clockwise by 70 degrees
    me.flexChart1.AxisX.LabelAngle = 70                  
```

***

## Staggered Axis Labels

Set [StaggeredLines](/componentone/api/win/online-flexchart/dotnet-api/C1.Win.FlexChart.10/C1.Win.Chart.Axis.StaggeredLines.html) to a value greater than `1` to specify the number of rows used for the labels.
The following image shows axis labels displayed across two staggered rows:
![C1WinForms FlexChart - chart after applying StaggeredLines property](https://cdn.mescius.io/document-site-files/images/13ef049a-dbc7-444f-94c2-9a9cd1c2f895/images/axislabeloverlapping-stagger.png)

```csharp
//Display the axis labels in staggered lines
    this.flexChart1.AxisX.StaggeredLines = 2;
```

```vbnet
'Display the axis labels in staggered lines
    me.flexChart1.AxisX.StaggeredLines = 2                  
```