StatConfiguration
Description
A StatConfiguration is an interface that exposes properties to allow the configuration of aggregates for grouped dataItems. A StatConfiguration is meant to be used in conjunction with StatDefinition / PartialStatDefinition.
Properties
|
Property |
Type |
Description |
|---|---|---|
|
statDefinitionKey |
string |
The |
|
formatterKey? |
string |
The formatter key to identify the formatter to use to format the resulting stat. |
|
label? |
string |
The text label to use to display beside the stat result. |
|
labelPosition? |
The position of the label, either to the left or the right of the stat result. |
|
|
viewerKey? |
string |
The viewer key to identify the viewer to use to view the resulting stat. |
A StatConfiguration can be provided to a GroupConfiguration through its stats property, an array of StatConfiguration.
Example
Define a minimum stat for field "goals" when grouped on field "goals".
const statDefinitions = {
minGoalsStat: { type: "min", field: "goals" }
};
const groupConfigurations = {
goals: {
stats: [{ statDefinitionKey: "minGoalsStat", label: "min = ", labelPosition: "left"}]
}
};
const options = { experimental: { statDefinitions }, groupConfigurations };
const datagrid = new Xceed.DataGrid("containerId", options);
The "minGoalsStat" StatDefinition identifier must be used with the statDefinitionKey of a StatConfiguration in a GroupConfiguration to calculate the minimum stat of field "goals" for dataItems when grouped by "goals". A label "min = ", will be positionned on the left of the stat result. The StatDefinitionCollection and GroupConfigurationCollection must be set in the DataGridOptions.