BarChart for ASP.NET WebForms
Rotating the Axis Label
Task-Based Help > Axis Tasks > Rotating the Axis Label

This topic shows how to rotate the axis label at design time and programmatically using the Rotation property.

To set the y-axis labels at design time:

  1. In design time, select the BarChart control and navigate to its properties window.
  2. Expand the Axis->Y->Labels->AxisLabelStyle nodes and set the Rotation property to 60.

To set the y-axis labels programmatically:

To programmatically rotate the Y-axis annotation to a 60 degree angle so it appears slanted toward the use the following code:

To write code in Visual Basic

Visual Basic
Copy Code
BarChart.Axis.Y.Labels.AxisLabelStyle.Rotation = 60

To write code in C#

Copy Code
BarChart.Axis.Y.Labels.AxisLabelStyle.Rotation = 60;

This topic illustrates the following:

The following image shows the Y-Axis labels rotated to a 60 degree angle:

See Also