Version

Chart Title and Subtitle

Topic Overview

Purpose

This topic provides information on using the chart title and subtitle feature of the UltraDataChart™ chart control.

Required background

The following topic is a prerequisite to understanding this topic:

Topic Purpose

The UltraDataChart requires a data object model to be mapped to the control’s DataContext property. This article will provide a simple data object model but you can create your own and use it with this sample code instead.

Chart Title and Subtitle

Overview

The title and subtitle feature of the UltraDataChart control allows you to add information to the top section of the chart control.

When adding a title or subtitle to the chart control, the content of the chart automatically resizes allowing for the title and subtitle information.

Preview

The following screenshot is a preview of the chart control with a title and subtitle set.

xamDataChart Chart Title 01.png

Title and Subtitle

In order to add a title and subtitle to the chart control there is a set of properties added to the UltraDataChart .

Property Name Property Type Description

String

Defines the title of the chart.

String

Defines the subtitle of the chart.

Styling the Title and Subtitle

There are properties provided that allows you to style the text color, the text font style and the text font size of the titles and subtitles.

Property Name Property Type Description

Brush

Title’s text color.

FontFamily

Title’s font name.

double

Title’s font size.

FontStyle

Title’s font style such as italic.

HorizontalAlignment

Title’s horizontal alignment.

Padding

Title’s margin.

Brush

Subtitle’s text color.

FontFamily

Subtitle’s font name.

double

Subtitle’s font size.

FontStyle

Subtitle’s font style such as italic.

HorizontalAlignment

Subtitle’s horizontal alignment.

Padding

Subtitle’s margin.

Example

The following code example shows how to set title and subtitle properties on the chart control:

The screenshot demonstrates how the chart control, with the title and subtitle, looks as a result of the above code snippet.

xamDataChart Chart Title 02.png

Related Content

The following topic provides additional information related to this topic:

Topic Purpose

Information on how to start using the UltraDataChart control.