Legend in Windows Forms Pivot Chart

28 Apr 20211 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 ShowLegend property.

  • C#
  • this.pivotChart1.ShowLegend = true;
  • Me.pivotChart1.ShowLegend = True

    The legends having integral floating support can be placed anywhere in the chart area.

  • C#
  • 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.

  • C#
  • 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
    Position 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.