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.v20.2.dll

Declaration

[DefaultValue("")]
public string OnCalculate { get; set; }
<DefaultValue("")>
Public Property OnCalculate As String

Property Value

Type Default Description
String

String.Empty

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
Object Type Path to OnCalculate
BootstrapChartAreaSeries
.Aggregation.OnCalculate
BootstrapChartAreaSeriesBase
.Aggregation.OnCalculate
BootstrapChartBarSeries
.Aggregation.OnCalculate
BootstrapChartBarSeriesBase
.Aggregation.OnCalculate
BootstrapChartBubbleSeries
.Aggregation.OnCalculate
BootstrapChartCandleStickSeries
.Aggregation.OnCalculate
BootstrapChartCommonSeries
.Aggregation.OnCalculate
BootstrapChartFinancialSeriesBase
.Aggregation.OnCalculate
BootstrapChartFullStackedAreaSeries
.Aggregation.OnCalculate
BootstrapChartFullStackedBarSeries
.Aggregation.OnCalculate
BootstrapChartFullStackedLineSeries
.Aggregation.OnCalculate
BootstrapChartFullStackedSplineAreaSeries
.Aggregation.OnCalculate
BootstrapChartFullStackedSplineSeries
.Aggregation.OnCalculate
BootstrapChartLineSeries
.Aggregation.OnCalculate
BootstrapChartPointSeriesBase
.Aggregation.OnCalculate
BootstrapChartRangeAreaSeries
.Aggregation.OnCalculate
BootstrapChartRangeBarSeries
.Aggregation.OnCalculate
BootstrapChartRangeSeriesBase
.Aggregation.OnCalculate
BootstrapChartScatterSeries
.Aggregation.OnCalculate
BootstrapChartSeries
.Aggregation.OnCalculate
BootstrapChartSeriesBase
.Aggregation.OnCalculate
BootstrapChartSplineAreaSeries
.Aggregation.OnCalculate
BootstrapChartSplineSeries
.Aggregation.OnCalculate
BootstrapChartStackedAreaSeries
.Aggregation.OnCalculate
BootstrapChartStackedBarSeries
.Aggregation.OnCalculate
BootstrapChartStackedLineSeries
.Aggregation.OnCalculate
BootstrapChartStackedSplineAreaSeries
.Aggregation.OnCalculate
BootstrapChartStackedSplineSeries
.Aggregation.OnCalculate
BootstrapChartStepAreaSeries
.Aggregation.OnCalculate
BootstrapChartStepLineSeries
.Aggregation.OnCalculate
BootstrapChartStockSeries
.Aggregation.OnCalculate

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