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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add multiple Chart Titles?

 

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)

Article ID: Published Date: Last Revised Date: Platform: Control:
66 04/30/2011 07/10/2014 WinForms Chart
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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