PivotGridExtension.GetDataObject(PivotGridSettings, Object) Method
Generates a chart data source from regular data.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v24.1.dll
NuGet Package: DevExpress.Web.Mvc5
Declaration
public static object GetDataObject(
PivotGridSettings pivotGridSettings,
object dataSource
)
Parameters
Name | Type | Description |
---|---|---|
pivotGridSettings | PivotGridSettings | A PivotGridSettings object that specifies pivot grid settings that define how to generate a chart data source. |
dataSource | Object | A PivotGrid data source. |
Returns
Type | Description |
---|---|
Object | A chart data source. |
Remarks
Use the static GetDataObject method in the controller to create a model for a Chart extension and pass it to the corresponding view.
The GetDataObject method internally creates a PivotGrid extension based on the provided settings, binds it to the specified data source and returns a chart data source provided by the created PivotGrid.
To create a chart data source from OLAP data, use another overload of the GetDataObject method that takes an olapConnectionString parameter. To generate a chart data source from data when the Pivot Grid operates in server mode, use the PivotGridExtension.GetEFDataObject or PivotGridExtension.GetLINQDataObject methods, depending on the data provider type.
You can use the PivotGridSettings.BeforeGetDataObject property to apply custom settings to the PivotGrid before a Chart data source is generated but after the PivotGrid’s callback state is applied.