Legend in Windows Forms Pivot Chart
28 Apr 2021 / 1 minute to read
By default, the pivot chart displays a legend with information on each series that has been plotted on the chart. The legend is a color code that helps to differentiate between chart items, and it has labels beside each color to indicate that it applies to information from series 1, series 2, and so on. The legend is made visible in the pivot chart by using the
this.pivotChart1.ShowLegend = true;
Me.pivotChart1.ShowLegend = True
The legends having integral floating support can be placed anywhere in the chart area.
this.pivotChart1.LegendPosition = Syncfusion.Windows.Forms.Chart.ChartDock.Floating;
Me.pivotChart1.LegendPosition = Syncfusion.Windows.Forms.Chart.ChartDock.Floating
The legend alignment can be marked within the chart area by using the LegendAlignment enumeration.
this.pivotChart1.LegendAlignment = Syncfusion.Windows.Forms.Chart.ChartAlignment.Center;
Me.pivotChart1.LegendAlignment = Syncfusion.Windows.Forms.Chart.ChartAlignment.Center
The legend positioning can be affected in the following ways.
|Chart Legend Properties||Description|
Specifies the position relative to chart where to render the legend.
* Top-above the chart
* Left-left of the chart
* Right-right of the chart
* Bottom-below the chart
Floating: Legend is not docked to any specific location(default setting).
|LegendAlignment||Specifies how the legend should be aligned with respect to the chart boundaries When it is docked to a side.|