Version

Configuring Axis Titles

Purpose

This topic provides information on configuring the x-axis and y-axis titles in the XamFinancialChart control.

In this topic

This topic contains the following sections:

Property Settings

You can customize the look and feel of the XamFinancialChart control’s x-axis and y-axis titles in many different ways, such as applying different font styles, margins, and alignment. This can be achieved by utilizing the following properties:

Property Name Property Type Description

string

Determines the text to be used for the x-axis and y-axis title.

enumeration

Determines the horizontal alignment of the x-axis title and the vertical alignment of the y-axis title.

double

Determines the angle rotation for the x-axis and y-axis titles.

FontFamily

Determines the font family applied to the x-axis or y-axis title.

double

Determines the font size of the x-axis or y-axis title.

FontStretch

Determines the font stretch applied to the x-axis or y-axis title.

FontStyle

Determines the font styles to be applied to the x-axis or y-axis title.

FontWeight

Determines the font weight to be applied to the x-axis or y-axis title.

Brush

Determines the color of the text for the x-axis or y-axis title.

Thickness

Determines the margin to be applied to the x-axis or y-axis title.

double

Determines the opacity of the text of the x-axis or y-axis title.

Code Snippet

The following code examples show how to customize the titles on the x-axis and y-axis in the XamFinancialChart control.

In XAML:

<Grid x:Name="layoutRoot">
    <ig:XamFinancialChart ItemsSource="{Binding}"
        XAxisTitleFontSize="12"
        XAxisTitleMargin="10"
        XAxisTitle="Historical Date"
        XAxisTitleFontStyle="Italic"
        YAxisTitleFontSize="14"
        YAxisTitle="Share Price"
        YAxisTitleAngle="90"
        YAxisTitleForeground="Green" />
</Grid>

In C#:

var chart = new XamFinancialChart();
chart.ItemsSource = data;
chart.XAxisTitleFontSize = 12;
chart.XAxisTitleMargin = new Thickness(10);
chart.XAxisTitle = "Historical Date";
chart.XAxisTitleFontStyle = FontStyles.Italic;
chart.YAxisTitleFontSize = 14;
chart.YAxisTitle = "Share Price";
chart.YAxisTitleAngle = 90;
chart.YAxisTitleForeground = Brushes.Green;

layoutRoot.Children.Add(chart);

In Visual Basic

Dim chart = New XamFinancialChart()
chart.ItemsSource = data
chart.XAxisTitleFontSize = 12
chart.XAxisTitleMargin = New Thickness(10)
chart.XAxisTitle = "Historical Date"
chart.XAxisTitleFontStyle = FontStyles.Italic
chart.YAxisTitleFontSize = 14
chart.YAxisTitle = "Share Price"
chart.YAxisTitleAngle = 90
chart.YAxisTitleForeground = Brushes.Green

layoutRoot.Children.Add(chart)

The above code will result in a XamFinancialChart that looks like the following:

financialchart wpf axis titles.png
Topic Description

This topic provides conceptual information about the XamFinancialChart control including its main features, minimum requirements, and user functionality.

This topic explains how to bind data to the XamFinancialChart control.