Version

Configuring Axis Labels

The UltraCategoryChart control allows you full control over configuring, formatting and styling the labels displayed on your chart. By default, you do not need to explicitly set the labels. The Category Chart will use the first appropriate string property that it finds within the data you provided and will use that for the labels.

In this topic

This topic contains the following sections:

Label Settings

In the UltraCategoryChart control, you can change the rotation angle, margin, horizontal/vertical alignment, opacity, padding and visibility, of the x-axis and y-axis labels using the following properties:

Styling

The look and feel of the category chart’s x-axis and y-axis labels can be styled in many aspects, the main of which are applying different font styles such as font type, font size and font weight to the labels. This can be achieved through the following properties:

Format

Code Snippet

The following code example shows how to format and style labels on the x-axis using date formatting and other style properties:

In C#:

chart1.XAxisLabel = "{Date:MM/dd}";
chart1.XAxisLabelFontSize = 16;
chart1.XAxisLabelLeftMargin = 14;
chart1.XAxisLabelTextColor = new SolidColorBrush(Color.Red);
chart1.XAxisLabelTextStyle = FontStyle.Bold;

In Visual Basic:

chart1.XAxisLabel = "{Date:MM/dd}"
chart1.XAxisLabelFontSize = 16
chart1.XAxisLabelLeftMargin = 14
chart1.XAxisLabelTextColor = New SolidColorBrush(Color.Red)
chart1.XAxisLabelTextStyle = FontStyle.Bold

The following screenshot demonstrates the UltraCategoryChart control with the x-axis label formatted and styled.

categorychart axis labels 01.png

Related Content

Topic Purpose

This article explains how to bind data to the Category Chart control.

This article will get you up and running with the Category Chart control.