series.aggregateString|Function
(default: "max")
The aggregate function to apply for date series.
This function is used when a category (an year, month, etc.) contains two or more points. The function return value is displayed instead of the individual points.
The supported values are:
- "avg" - the average of all values for the date period.
- "count" - the number of values for the date period.
- "max" - the highest value for the date period.
- "min" - the lowest value for the date period.
- "sum" - the sum of all values for the date period. Defaults to 0 if no data points are defined.
- "sumOrNull" - the sum of all values for the date period. Defaults to
null
if no data points are defined. - "first" - the first value
- function(values, series, dataItems, category) - user-defined aggregate function. Returns single value or data item.
- object - (compound aggregate)Applicable to "candlestick" and ohlc "series". Specifies the aggregate for each data item field.
Example
<div id="sparkline"></div>
<script>
$("#sparkline").kendoSparkline({
categoryAxis: {
type: "date",
categories: [
new Date("2023/01/01"),
new Date("2023/01/01"),
new Date("2023/01/02"),
new Date("2023/01/02")
]
},
series: [{
aggregate: "avg",
data: [10, 15, 8, 12]
}]
});
</script>
In this article