A newer version of this page is available.
Switch to the current version.
BootstrapChartAggregationSettings.OnCalculate Property
Specifies a client function performing custom aggregation. Applies only if the BootstrapChartAggregationSettings.Method property is set to "custom".
Namespace: DevExpress.Web.Bootstrap
Assembly: DevExpress.Web.Bootstrap.v18.2.dll
Declaration
[DefaultValue("")]
public string OnCalculate { get; set; }
<DefaultValue("")>
Public Property OnCalculate As String
Property Value
Type | Default | Description |
---|---|---|
String | A string that represents either the name of a JavaScript function or the entire JavaScript function code. |
Property Paths
You can access this nested property as listed below:
Show 31 property paths
Remarks
When implementing a custom aggregate function, use the aggregationInfo client-side object that is passed to it as the first argument. In addition, you can access the series object, which is passed to the function as the second argument.
The function below implements the median filter algorithm for custom aggregation:
<script type="text/javascript">
function aggregationMethod(aggregationInfo, series) {
if(aggregationInfo.data.length) {
return {
argument: aggregationInfo.intervalStart,
value: aggregationInfo.data[Math.floor(aggregationInfo.data.length / 2)].value
};
}
}
</script>
<dx:BootstrapChart runat="server" DataSourceUrl="dataSourceUrl">
<SeriesCollection>
<dx:BootstrapChartBarSeries>
<Aggregation OnCalculate="aggregationMethod" Method="Custom" Enabled="true" />
</dx:BootstrapChartBarSeries>
</SeriesCollection>
</dx:BootstrapChart>
See Also
Feedback