PivotGridExtension.GetDataObject(PivotGridSettings, Object) Method
Generates a chart data source from regular data.
Namespace: DevExpress.Web.Mvc
Assembly: DevExpress.Web.Mvc5.v26.1.dll
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 Pivot Grid extension based on the specified settings, binds it to the specified data source, and returns the chart data source generated by that Pivot Grid.
To create a chart data source from OLAP data, use a GetDataObject method overload that accepts an olapConnectionString parameter. When the Pivot Grid uses server mode, use the PivotGridExtension.GetEFDataObject or PivotGridExtension.GetLINQDataObject method, 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.