Shopping cart Download trialFree Trial

Binding Individual Series

Teatime Chocolate BiscuitsZaanse koekenSir Rodney's SconesScottish LongbreadsChocoladeNuNuCa Nuß-Nougat-CremeValkoinen suklaaPavlovaMaxilakuGumbär GummibärchenSchoggi SchokoladeTarte au sucreSir Rodney's Marmalade01020304050607080PriceCategory: ConfectionsMin price: 9.20Max price: 81.00Average price: 25.16Northwind Traders
Data Settings
Labels Settings
Apply Changes

DevExpress MVC Chart allows its series to be bound to data in two ways:

  • All Series objects are manually added to the Series collection, and each series is independently bound to appropriate data members from a chart's datasource.
  • All Series objects are generated dynamically from a chart's data source based on template settings specified via the SeriesTemplate property.

This demo illustrates how to use the first approach when each series is bound to data.

In this demo you can choose the category that has the products that should be displayed on a chart (via the Filter By Category option), as well as specify sorting rules (Sort By and Sort Order options). In addition, you can toggle the visibility of series labels via the Show Labels option.

Note that at the top-left of the chart there is information about the selected category, its minimum, maximum and average prices, dynamically updated every time you choose another category. This is implemented using the BoundDataChanged event that is raised after a new filter is applied.

Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
The source code files for this demo are installed (by default) in the following directory:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxChartDemos