The requested page is not available for the requested platform. You are viewing the content for Default platform.

XRPivotGrid.CustomChartDataSourceData Event

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

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v19.2.dll

Declaration

public event EventHandler<PivotCustomChartDataSourceDataEventArgs> CustomChartDataSourceData
Public Event CustomChartDataSourceData As EventHandler(Of PivotCustomChartDataSourceDataEventArgs)

Event Data

The CustomChartDataSourceData event handler receives an argument of the DevExpress.XtraReports.UI.PivotGrid.PivotCustomChartDataSourceDataEventArgs type.

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