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 work with the items in the ChartLegend using Series?

Platform: WinForms |
Control: Chart


The chart legend can be displayed by setting ShowLegend property to true. Using Chart control series we can customize its respective legend items. The instance of legend item can be created using ChartSeriesLegendItem class.

IconAlignment property is used to align the icons in legend. Symbol can be displayed when setting the ShowSymbol property to true. Legend Item can be hidden by setting Visible property to false.


// Creating an instance to ChartSeriesLegendItem Class

ChartSeriesLegendItem item1 = this.chartControl1.Series[0].LegendItem;

item1.Series.LegendItem.IconAlignment = LeftRightAlignment.Right;

// Disable shadow

item1.Series.LegendItem.ItemStyle.ShowShadow = false;

item1.Series.LegendItem.ItemStyle.TextColor = Color.Green;

// Setting Font

item1.Series.LegendItem.ItemStyle.Font = new Font("Verdana", 10f, FontStyle.Italic);

// Setting Symbol Properties

item1.Series.LegendItem.ShowSymbol = true;

item1.Series.LegendItem.Symbol.Color = Color.LightBlue;

item1.Series.LegendItem.Symbol.Shape = ChartSymbolShape.Hexagon;

item1.Series.LegendItem.Text = "MySeries";


' Creating an instance to ChartSeriesLegendItem Class

Dim item1 As ChartSeriesLegendItem = Me.ChartControl1.Series(0).LegendItem

item1.Series.LegendItem.IconAlignment = LeftRightAlignment.Right

' Disable shadow

item1.Series.LegendItem.ItemStyle.ShowShadow = False

item1.Series.LegendItem.ItemStyle.TextColor = Color.Green

' Setting Font

item1.Series.LegendItem.ItemStyle.Font = New Font("Verdana", 10.0F, FontStyle.Italic)

' Setting Symbol Properties

item1.Series.LegendItem.ShowSymbol = True

item1.Series.LegendItem.Symbol.Color = Color.LightBlue

item1.Series.LegendItem.Symbol.Shape = ChartSymbolShape.Hexagon

item1.Series.LegendItem.Text = "MySeries"

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