Your search did not match any results.

Charts - Side-by-Side Bar

This demo shows the standard bar series type that displays rectangular bars side by side. The side by side bar series help you compare values across different categories. Follow the steps below to create and configure the bar chart.

www.wikipedia.org
Backend API
@(Html.DevExtreme().Chart() .ID("chart") .CommonSeriesSettings(s => s .ArgumentField("State") .Type(SeriesType.Bar) .HoverMode(ChartSeriesHoverMode.AllArgumentPoints) .SelectionMode(ChartSeriesSelectionMode.AllArgumentPoints) .Label(l => l .Visible(true) .Format(f => f .Type(Format.FixedPoint) .Precision(0) ) ) ) .Series(s => { s.Add().ValueField("Year2018").Name("2018"); s.Add().ValueField("Year2017").Name("2017"); s.Add().ValueField("Year2016").Name("2016"); }) .Title("Gross State Product within the Great Lakes Region") .Legend(l => l .VerticalAlignment(VerticalEdge.Bottom) .HorizontalAlignment(HorizontalAlignment.Center) ) .Export(e => e.Enabled(true)) .OnPointClick(@<text> function(e) { e.target.select(); } </text>) .DataSource(new[] { new { State = "Illinois", Year2016 = 803, Year2017 = 823, Year2018 = 863 }, new { State = "Indiana", Year2016 = 316, Year2017 = 332, Year2018 = 332 }, new { State = "Michigan", Year2016 = 452, Year2017 = 459, Year2018 = 470 }, new { State = "Ohio", Year2016 = 621, Year2017 = 642, Year2018 = 675 }, new { State = "Wisconsin", Year2016 = 290, Year2017 = 294, Year2018 = 301 } }) )
using DevExtreme.AspNet.Data; using DevExtreme.AspNet.Mvc; using DevExtreme.MVC.Demos.Models.SampleData; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Web.Mvc; namespace DevExtreme.MVC.Demos.Controllers { public class ChartsController : Controller { public ActionResult SideBySideBar() { return View(); } } }
#chart { height: 440px; }

Bind to Data

In this demo, series is bound to data directly. See the Bind Series to Data article for information. The "state" field name is assigned to the argumentField property of the commonSeriesSettings object since the bar chart contains series with the same argument field.

Specify Common Series Settings

To configure settings for all series in the chart, use the commonSeriesSettings object.

You can configure the following series settings:

Customize Side by Side Chart

Use the verticalAlignment and horizontalAlignment properties of the legend object to specify the legend position in the chart.

You can also handle a series point selection in the pointClick event.

To allow a user to export your bar chart into the PNG, JPEG, and SVG file or print the chart, set the export.enabled property to true. In this demo, the exporting is enabled and you can click the "Exporting/Printing" button in the side by side bar chart. This button invokes a drop-down menu with export and print commands.