Skip to main content

XRPivotGrid.CustomChartDataSourceData Event

Occurs when a XRPivotGrid control prepares data to be displayed in a XRChart control.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v23.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

public event EventHandler<PivotCustomChartDataSourceDataEventArgs> CustomChartDataSourceData

Event Data

The CustomChartDataSourceData event's data class is DevExpress.XtraReports.UI.PivotGrid.PivotCustomChartDataSourceDataEventArgs.

Remarks

This event allows you to customize data prepared by the XRPivotGrid to display it in the XRChart control.

The event parameter’s ItemType property allows you to determine the type of the PivotGrid item currently being processed. To get item information, use the CellInfo or FieldValueInfo property, depending on whether the current item is a cell or field value. The ItemDataMember property returns the type of a chart data member that will represent the current PivotGrid item. To specify a value to be displayed in a ChartControl, use the Value property.

The following code specifies custom text for the Extended Price column field value.

using DevExpress.XtraPivotGrid;
//...

private void xrPivotGrid1_CustomChartDataSourceData(object sender, DevExpress.XtraReports.UI.PivotGrid.PivotCustomChartDataSourceDataEventArgs e) {
    if (e.ItemType == PivotChartItemType.ColumnItem) {
        if (e.FieldValueInfo.Field == fieldExtendedPrice)
            e.Value = "Total Price";
    }
}

To learn more, see PivotGridControl.CustomChartDataSourceData.

See Also