Edit this page

Axis Labels

Labels are displayed for each:

  • Chart axis to describe the category of values along the axis.  For example "Products", "Risk Factors", time periods or geographic areas.

  • Chart axis item to describe the specific value or category for that item.chart-undestanding-radchart-elements-axis-labels

Formatting Axis Labels

  • To format the chart axis label use the PlotArea..AxisLabel to access Appearance and TextBlock properties

  • To set the formatting for *all labels *on an axis use the PlotArea..Appearance LabelAppearance and TextAppearance properties.

  • To format a label for a specific chart axis item use the PlotArea..Items[].Appearance property.

Use the MinValue and MaxValue properties to specify the minimum and maximum values for the data to display. The MinValue property allows you to specify either negative or positive number as the minimum value. In the example below the MinValue = -50, MaxValue = 50 and Step = 10.

chart-undestanding-radchart-elements-axis-labels 001

The PlotArea..Appearance.ValueForma property automatically formats axis label values as Currency, Scientific, General, Number, Percent, ShortDate, ShortTime, LongDate, LongTime or None.

Positioning Axis Labels

You can specify the horizontal and vertical alignment of axis labels and axis item labels using the Appearance.Position property of the axis label or chart axis item respectively. Position has sub properties for AlignedPosition, Auto, X and Y.  

Use AlignedPosition to automatically place the label Right, Left, Top, Center, TopRight, TopLeft, BottomRight or BottomLeft

chart-undestanding-radchart-elements-axis-labels 002

Use the RotationAngle property to spin axis and axis item labels to any angle.  In the example below the XAxis.Appearance.LabelAppearance.RotationAngle is set to 45.

chart-undestanding-radchart-elements-axis-labels 003

By turning off the Position.Auto property and setting Position.AlignedPosition to None you can place the axis label any where in the plot area.  In the example below the PlotArea.YAxis.AxisLabel.Appearance.Position property is configured such that:

  • AlignedPosition =  None

  • Auto = False

  • X = 120

  • Y = 200

The YAxis.AxisLabel.Appearance.RotationAngle = 325.

note

This isn't a recommended or usual approach but serves to illustrate the flexibility of the object model.

Also in the example below, the PlotArea.XAxis.AutoScale is turned off so the PlotArea.XAxis.Items collection could be populated manually. Each ChartAxisItem has its TextBlock.Text property populated with the strings "Non-Smokers", "Social Smokers" and "Heavy Smokers".

chart-undestanding-radchart-elements-axes 003