GridColumnTotal Class
A total calculated based on Grid column values.
Declaration
export class GridColumnTotal extends TypedSerializableModel
Remarks
The Grid dashboard item allows you to calculate totals against values displayed in the specified column and show these totals under the column. To create a total for the required column, do the following.
- Create the GridColumnTotal object and specify the type of summary function used to calculate a total using the GridColumnTotal.totalType property.
- Add the resulting GridColumnTotal object to the GridColumn.totals collection. Note that you can add any number of totals for each column.
You can calculate totals for all types of grid columns (GridColumn descendants), but each column type supports only a specified set of summary functions used to calculate totals. The table below lists the total types supported by different grid columns.
Column Type | Supported Total Types |
---|---|
Auto Avg Count Max Min Sum | |
Min Max Count | |
Count | |
Count |
Totals, except the Auto type, are calculated based on summary values. When the GridColumnTotal.totalType property is set to Auto, the total is calculated based on values of the corresponding data field from the underlying data source. In this case, the Measure.summaryType property value is taken into account to calculate the total. If the specified summaryType type is not matched with supported total types, the Count summary function is used.
Inheritance
constructor
Initializes a new instance of the GridColumnTotal
class.
Declaration
constructor(
modelJson?: any,
serializer?: DevExpress.Analytics.Utils.ModelSerializer
)
Parameters
Name | Type | Description |
---|---|---|
modelJson | any | A JSON object used for dashboard deserialization. Do not pass this parameter directly. |
serializer | ModelSerializer | An object used for dashboard deserialization. Do not pass this parameter directly. |
Properties
totalType Property
Specifies the summary function type used to calculate a total for the Grid column.
Declaration
totalType: ko.Observable<DevExpress.Dashboard.Model.GridColumnTotalType>
Property Value
Type | Description |
---|---|
Observable<GridColumnTotalType> | A string that specifies the total type. |
Remarks
You can calculate totals for all types of grid columns (GridColumn descendants), but each column type supports only a specified set of summary functions used to calculate totals. The table below lists the total types supported by different grid columns.
Column Type | Supported Total Types |
---|---|
Auto Avg Count Max Min Sum | |
Min Max Count | |
Count | |
Count |
Totals, except the Auto type, are calculated based on summary values. When the GridColumnTotal.totalType property is set to Auto, the total is calculated based on values of the corresponding data field from the underlying data source. In this case, the Measure.summaryType property value is taken into account to calculate the total. If the specified summaryType type is not matched with supported total types, the Count summary function is used.
Methods
getDisplayValue(totalType) Method
Declaration
static getDisplayValue(
totalType: string
): string
Parameters
Name | Type |
---|---|
totalType | string |
Returns
Type |
---|
string |
getInfo Method
For internal use.
Declaration
getInfo(): DevExpress.Analytics.Utils.ISerializationInfoArray
Returns
Type | Description |
---|---|
ISerializationInfoArray | An array of objects that provide serialization info. |
getLocalization(totalType) Method
Declaration
static getLocalization(
totalType: string
): string
Parameters
Name | Type |
---|---|
totalType | string |
Returns
Type |
---|
string |