We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to manipulate Chart Title?

Platform: WinForms |
Control: Chart |
Published Date: April 30, 2011 |
Last Revised Date: June 25, 2019

 

Chart Title can be customized using Properties window at design time and also programmatically at run time. Through Properties window we can modify its properties using Titles Property under ChartControl object.

The Title can be customized programmatically. The Text, Background and Foreground colors are also be modified. The following code snippet illustrates this. We can also enable or disable chart title.

C#

// Specifying Chart Title

this.chartControl1.Title.Text = "My Chart";

this.chartControl1.Title.Alignment = ChartAlignment.Center;

this.chartControl1.Title.Position = ChartDock.Bottom;

this.chartControl1.Title.Enabled = true;

this.chartControl1.Title.Visible = true;

// Specifying Color

this.chartControl1.Title.BackColor = Color.Lavender;

this.chartControl1.Title.ForeColor = Color.Green;

this.chartControl1.Title.Font = new Font("Arial", 14.0f);

VB

' Specifying Chart Title

Me.ChartControl1.Title.Text = "My Chart"

Me.ChartControl1.Title.Alignment = ChartAlignment.Center

Me.ChartControl1.Title.Position = ChartDock.Bottom

Me.ChartControl1.Title.Enabled = True

Me.ChartControl1.Title.Visible = True

' Specifying Color

Me.ChartControl1.Title.BackColor = Color.Lavender

Me.ChartControl1.Title.ForeColor = Color.Green

Me.ChartControl1.Title.Font = new Font("Arial", 14.0f)

To display the border of the Title ShowBorder property is used. Border's Color, Style,Width can also be modified.

C#

// Specifying Border Properties

this.chartControl1.Title.ShowBorder = true;

this.chartControl1.Title.Border.ForeColor = Color.Red;

this.chartControl1.Title.Border.DashStyle = DashStyle.Dot;

this.chartControl1.Title.Border.Width = 2f;

VB

' Specifying Border Properties

Me.ChartControl1.Title.ShowBorder = true

Me.ChartControl1.Title.Border.ForeColor = Color.Red

Me.ChartControl1.Title.Border.DashStyle = DashStyle.Dot

Me.ChartControl1.Title.Border.Width = 2f

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon