Version

Assign Chart Titles

The Chart control contains four different chart titles that are easily configured through properties. These titles are accessible through the TitleTop , TitleRight , TitleBottom , and TitleLeft properties of the chart.

The following is a list of properties that affect the appearance of each title:

  • Extent  — specifies the complete height (TitleTop, TitleBottom) or width (TitleLeft, TitleRight) allocated for the title, including margins.

  • Font  — The font used for the title.

  • ClipText  — Whether or not the title should be clipped if it exceeds its boundaries.

Note
Note

The ClipText property does not affect titles when the Orientation property is set to Custom.

  • Flip  — Whether or not to flip the label 180 degrees. The Flip property only affects titles when the Orientation property is set to Custom.

  • OrientationAngle  — The angle of title text. The OrientationAngle property only affects titles when the Orientation property is set to Custom.

  • ReverseText  — Whether or not to reverse the order of characters in the title.

Note
Note

Note : Since this is an object of type System.Drawing.Font, font properties such as "Bold" are read-only; they cannot be switched at run time, as in the properties grid. To change any System.Drawing.Font object at run-time, create a new instance of a Font:

In Visual Basic:

Private Sub AssignChartTitles_Load(ByVal sender As System.Object, _
  ByVal e As System.EventArgs) Handles MyBase.Load
	Me.UltraChart1.TitleTop.Text = "Infragistics Help Sample"
	Me.UltraChart1.TitleTop.Font = New Font("Arial", 12, FontStyle.Bold _
	  Or FontStyle.Underline, GraphicsUnit.Point)
End Sub

In C#:

private void AssignChartTitles_Load(object sender, EventArgs e)
{
	this.ultraChart1.TitleTop.Text = "Infragistics Help Sample";
	this.ultraChart1.TitleTop.Font = new Font("Arial", 12, FontStyle.Bold
	  | FontStyle.Underline, GraphicsUnit.Point);
}
  • FontColor  — The color of the font used for the title.

  • FontSizeBestFit  — Determines whether or not Chart will automatically select the font size based on the length of the Title Text and the space available.

  • HorizontalAlign  — Specifies the location of the title text within its horizontal bounds.

  • Location  — This property supports the Chart Core infrastructure and is intended for internal purposes only. Chart titles cannot be relocated using the Location property.

  • Margins  — The space within the Extent of each Title where text cannot appear; only empty space can occupy the Margins area. Margins can be used to locate the Title with more flexibility than the HorizontalAlign and VerticalAlign properties. Margins may be set to positive or negative values.

  • Orientation  — This property supports the Chart Core infrastructure and is intended for internal purposes only. Chart titles are not affected by setting the Orientation property.

  • Text  — A string value to display as the title of the chart.

  • Visible  — Toggles whether or not the title will be drawn on the chart.

  • WrapText  — Determines whether or not the title text will be wrapped onto multiple lines if necessary.

The following image depicts some effects that can be achieved using Title appearance properties.

Shows a 2D Column Chart with some customization done using the Title Appearance properties.

For more flexible positioning and customization for text on the chart, consider using an annotation or a custom layer. See the Annotations and Layers sections for more information.

Shows a 2D Column Chart using a Annotation to make a watermark on the chart.