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 add multiple Chart Titles?

Platform: WinForms |
Control: Chart |
Published Date: April 30, 2011 |
Last Revised Date: July 10, 2014

 

Essential Chart supports displaying multiple chart titles. We can add multiple charts at design time and also at run time.

Titles can be added using Titles property under chart control. It opens a Titles Collection Editor where we can add, remove and customize the title.

The sample screen shot illustrates this.

Chart Titles can be added at run time using ChartTitle class.

C#

// Creating a new title

ChartTitle title1 = new ChartTitle();

title1.Text = "Marketing";

title1.Position = ChartDock.Bottom;

// Adding into Chart control

this.chartControl1.Titles.Add(title1);

VB

' Specifying Chart Title

Me.ChartControl1.Titles(0).ForeColor = Color.MidnightBlue

Dim title1 As ChartTitle = New ChartTitle()

title1.Text = "Marketing"

title1.Position = ChartDock.Bottom

' Adding into Chart Control

Me.ChartControl1.Titles.Add(title1)

Each title can be customizied individually by setting display settings. Border can be displayed by setting ShowBorder property as true.

C#

// Customizing Title

this.chartControl1.Titles[1].Alignment = ChartAlignment.Center;

this.chartControl1.Titles[1].BackColor = Color.AliceBlue;

this.chartControl1.Titles[1].ForeColor = Color.Crimson;

this.chartControl1.Titles[1].ShowBorder = true;

this.chartControl1.Titles[1].Border.ForeColor = Color.Green;

this.chartControl1.Titles[1].Border.DashStyle = DashStyle.Solid;

this.chartControl1.Titles[1].Border.Width = 1f;

this.chartControl1.Titles[1].Font = new Font("TimesNewRoman", 12.0f);

VB

' Customizing Title

Me.ChartControl1.Titles(1).Alignment = ChartAlignment.Center

Me.ChartControl1.Titles(1).BackColor = Color.AliceBlue

Me.ChartControl1.Titles(1).ForeColor = Color.Crimson

Me.ChartControl1.Titles(1).ShowBorder = True

Me.ChartControl1.Titles(1).Border.ForeColor = Color.Green

Me.ChartControl1.Titles(1).Border.DashStyle = DashStyle.Solid

Me.ChartControl1.Titles(1).Border.Width = 1.0F

Me.ChartControl1.Titles(1).Font = New Font("TimesNewRoman", 12.0F)

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.

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