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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to manipulate Chart Legend?

Platform: WinForms |
Control: Chart


The chart legend can be displayed by setting ShowLegend property as true. ShowItemsShadow is used to display shadow. BackInterior property specifies the gradient style and background style of the legend. DockingFree property allows us to dock the legend anywhere in the chart area.


// Displays Legend

this.chartControl1.ShowLegend = true;

this.chartControl1.Legend.BackInterior = new BrushInfo(GradientStyle.ForwardDiagonal, Color.White, Color.LightBlue);

// Setting Border Properties

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

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

this.chartControl1.Legend.Border.Width = 2;

this.chartControl1.Legend.DockingFree = true;

this.chartControl1.Legend.ShowItemsShadow = false;

this.chartControl1.Legend.ShowSymbol = false;

// Setting Text Properties

this.chartControl1.Legend.Text = "MyLegend";

this.chartControl1.Legend.TextColor = Color.Brown;

this.chartControl1.Legend.Font = new Font("Verdana", 8f, FontStyle.Bold);


' Displays Legend

Me.ChartControl1.ShowLegend = True

Me.ChartControl1.Legend.BackInterior = New BrushInfo(GradientStyle.ForwardDiagonal, System.Drawing.Color.White, System.Drawing.Color.LightBlue)

' Setting Border Properties

Me.ChartControl1.Legend.Border.ForeColor = System.Drawing.Color.Red

Me.ChartControl1.Legend.Border.DashStyle = DashStyle.Dot

Me.ChartControl1.Legend.Border.Width = 2

Me.ChartControl1.Legend.DockingFree = True

Me.ChartControl1.Legend.ShowItemsShadow = False

Me.ChartControl1.Legend.ShowSymbol = False

' Setting Text Properties

Me.ChartControl1.Legend.Text = "MyLegend"

Me.ChartControl1.Legend.TextColor = Color.Brown

Me.ChartControl1.Legend.Font = New Font("Verdana", 8.0F, FontStyle.Bold)

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
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

Live Chat Icon For mobile