Help us shape the 2021 DevExtreme Roadmap. Take our 5 minute survey.
Your search did not match any results.

Discrete Aggregation

The aggregation algorithm depends on the aggregateByCategory option. In this demo, this option is set to true and applies the "sum" aggregation method for the groups specified in the dataSource.

If aggregateByCategory is false, the specified aggregation method is not applied. The first series point is displayed instead.

U.S. Energy Information Administration (Oct 2019)
@(Html.DevExtreme().Chart() .ID("chart") .Title(t => t.Text("Production of Crude Oil").Subtitle("(in Barrels)")) .CommonSeriesSettings(s => { s.Aggregation(a => a.Enabled(true).Method(ChartSeriesAggregationMethod.Sum)) .ArgumentField("State") .ValueField("Value") .Type(SeriesType.Bar); }) .SeriesTemplate(t => t.NameField("Year")) .ArgumentAxis(a => a.AggregateByCategory(true)) .DataSource(Model) )
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.NETCore.Demos.Models; using DevExtreme.NETCore.Demos.Models.SampleData; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; namespace DevExtreme.NETCore.Demos.Controllers { public class ChartsController : Controller { public ActionResult DiscreteAggregation() { return View(SampleData.OilProductionByMonths); } } }
#chart { height: 440px; }