Skip to main content
A newer version of this page is available. .

Chart Titles Overview

  • 3 minutes to read

This document describes how chart titles can be created and customized, and illustrates their general functionality.

Overview

Chart titles are used to accompany your chart with text headers and explanations. You can display an unlimited number of titles within a single chart.

Note

If a chart title’s length exceeds the size of the chart, you can force the title’s text to be wrapped in multiple lines from the AlignedTitle.WordWrap property.

In addition, chart titles provide HTML support, allowing you to apply HTML formatting to your chart’s titles using standard HTML tags.

ChartTitles

To learn more on HTML support, refer to the HTML Text Formatting topic.

The section below describes how to create chart titles at design time.

Creation

To access a chart’s titles collection at design time, do the following.

  • Select the chart control, and in the Properties window, locate the WebChartControl.Titles property.
  • Click the title’s ellipsis button.

    ClickTitlesEllipsisButton

  • The Chart Title Collection Editor will appear.

    ChartTitleCollectionEditor

In this dialog, use the Add button to create chart titles.

After a title is created, you can customize its appearance and behavior.

Customization

To customize a chart title, use the following properties.

  • The title’s text is determined by the Title.Text property. You can format a chart’s title with standard HTML tags. To see a list of HTML tags, refer to HTML Text Formatting.
  • The appearance of a title’s text can be customized from the TitleBase.Font, TitleBase.Antialiasing and TitleBase.TextColor properties. Note that the color defined by a title’s HTML <color> tags have priority over the title’s TitleBase.TextColor property setting.
  • The placement of titles within a chart is determined by their AlignedTitle.Alignment and DockableTitle.Dock properties.
  • To define the spacing around a title (in pixels), define its DockableTitle.Indent property.
  • To enable automatic word wrapping for lengthy chart titles, use the AlignedTitle.WordWrap property.

    After you enable word wrapping, the AlignedTitle.MaxLineCount property comes into effect. This property allows you to determine the limit for new lines appearing when a title’s text is wrapped. Note that if a title’s length exceeds this limit, the last line of text will be cut off by an ellipsis.

    ChartTitles_2c

    If required, you can increase the AlignedTitle.MaxLineCount property value so that the entire text will fit. However, if the number of lines is increased, the chart’s diagram size will decrease as a result.

    ChartTitles_2b

  • To hide a title while maintaining it in the collection, disable its TitleBase.Visible property.
See Also