Chart Title in Windows Forms Chart
3 Sep 2020 / 3 minutes to read
//Default title chartControl1.Title.Text = "Essential Chart"; this.chartControl1.Title.Font = new System.Drawing.Font("Candara", 9F, System.Drawing.FontStyle.Bold);
'Default title chartControl1.Title.Text = "Essential Chart" chartControl1.Title.Font = New System.Drawing.Font("Candara", 9F, System.Drawing.FontStyle.Bold)
The above default chart title is simply the first in the list of titles that can be specified for the Chart.
- Multiple custom Chart Titles can be added to Chart.Titles Collection.
- Supports numerous docking styles (Floating, Left, Right, Bottom or Top) for each title.
- Each of the custom Titles can be aligned to any position as required.
Below listed properties will help you to modify the positioning of the Chart Title.
Specifies the position relative to the chart at which to render the chart title panel.
When docked to a side, this property specifies how the title panel should be aligned with respect to the chart boundaries.
Specifies the docking behavior of the title.
Title Look and Feel
In code, you can add more titles to this list as follows.
//Default title (the first entry in the Titles list) chartControl1.Title.Text = "Essential Chart"; // Add the title to the Chart control's Titles collection. ChartTitle title = new Syncfusion.Windows.Forms.Chart.ChartTitle(); title.Text = "Custom Chart Title"; this.chartControl1.Titles.Add(title);
'Default title (the first entry in the Titles list) chartControl1.Title.Text = "Essential Chart" ' Add the title to the Chart control's Titles collection. Dim title As New Syncfusion.Windows.Forms.Chart.ChartTitle title.Text = "Custom Chart Title" Me.ChartControl1.Titles.Add(title)
Multiline Chart Title
You can now wrap the Chart titles and display them as multiline text. Set multiline title text in ChartTitle.Text property through designer as follows. Press ENTER key to begin a new line. Press CTRL+ENTER to set the text entered.