Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartControl.PivotChartingCustomizeLegend Event

Occurs before automatic settings are applied to the legend‘s layout properties.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.2.UI.dll

NuGet Package: DevExpress.Win.Charts

#Declaration

public event CustomizeLegendEventHandler PivotChartingCustomizeLegend

#Event Data

The PivotChartingCustomizeLegend event's data class is CustomizeLegendEventArgs. The following properties provide information specific to this event:

Property Description
Legend Gets the chart’s legend.
MaxHorizontalPercentage Specifies the legend‘s maximum horizontal percentage.
MaxVerticalPercentage Specifies the legend‘s maximum vertical percentage.

#Remarks

When a familiar data source (such as the PivotGridControl) is assigned to the chart’s ChartControl.DataSource property, and the PivotGridDataSourceOptions.AutoLayoutSettingsEnabled property is turned on, the LegendBase.MaxHorizontalPercentage and LegendBase.MaxVerticalPercentage properties are defined automatically, and cannot be customized at design time.

Handle the PivotChartingCustomizeLegend event to manually adjust these options (via the CustomizeLegendEventArgs.MaxHorizontalPercentage and CustomizeLegendEventArgs.MaxVerticalPercentage properties). To access the legend, use the CustomizeLegendEventArgs.Legend property.

For more information, see Pivot Charting (Integration with a Pivot Grid Control).

See Also