Your search did not match any results.

Charts - Side-by-Side Full-Stacked Bar

This demo shows the side-by-side full-stacked bar series that visualizes data as bars stacked by groups. This series type is useful when you compare point values as a part of the total group value.

The value axis is continuous and displays a range between 0 and 100%. The component converts point values to a percentage, and the height of the resulting column is equal to 100%.

www.wikipedia.org
Backend API
@(Html.DevExtreme().Chart() .ID("chart") .CommonSeriesSettings(s => s .ArgumentField("State") .Type(SeriesType.FullStackedBar) ) .Series(s => { s.Add().ValueField("Maleyoung").Name("Male: 0-14").Stack("Male"); s.Add().ValueField("Malemiddle").Name("Male: 15-64").Stack("Male"); s.Add().ValueField("Maleolder").Name("Male: 65 and older").Stack("Male"); s.Add().ValueField("Femaleyoung").Name("Female: 0-14").Stack("Female"); s.Add().ValueField("Femalemiddle").Name("Female: 15-64").Stack("Female"); s.Add().ValueField("Femaleolder").Name("Female: 65 and older").Stack("Female"); }) .Legend(l => l .VerticalAlignment(VerticalEdge.Bottom) .HorizontalAlignment(HorizontalAlignment.Center) ) .Title("Population: Age Structure") .Export(e => e.Enabled(true)) .Tooltip(t => t .Enabled(true) .CustomizeTooltip(@<text> function (arg) { return { text: arg.percentText + " - " + arg.valueText }; } </text>) ) .DataSource(new[] { new { State = "USA", Maleyoung = 29.956, Malemiddle = 90.354, Maleolder = 14.472, Femaleyoung = 28.597, Femalemiddle = 91.827, Femaleolder = 20.362 }, new { State = "Brazil", Maleyoung = 25.607, Malemiddle = 55.793, Maleolder = 3.727, Femaleyoung = 24.67, Femalemiddle = 57.598, Femaleolder = 5.462 }, new { State = "Russia", Maleyoung = 13.493, Malemiddle = 48.983, Maleolder = 5.802, Femaleyoung = 12.971, Femalemiddle = 52.14, Femaleolder = 12.61 }, new { State = "Japan", Maleyoung = 9.575, Malemiddle = 43.363, Maleolder = 9.024, Femaleyoung = 9.105, Femalemiddle = 42.98, Femaleolder = 12.501 }, new { State = "Mexico", Maleyoung = 17.306, Malemiddle = 30.223, Maleolder = 1.927, Femaleyoung = 16.632, Femalemiddle = 31.868, Femaleolder = 2.391 }, new { State = "Germany", Maleyoung = 6.679, Malemiddle = 28.638, Maleolder = 5.133, Femaleyoung = 6.333, Femalemiddle = 27.693, Femaleolder = 8.318 }, new { State = "United Kindom", Maleyoung = 5.816, Malemiddle = 19.622, Maleolder = 3.864, Femaleyoung = 5.519, Femalemiddle = 19.228, Femaleolder = 5.459 } }) )
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 SideBySideFullStackedBar() { return View(); } } }
#chart { height: 440px; }

Bind Chart to Data

The side-by-side full-stacked bar chart contains series with the same argument field. In this demo, the data source array consists of objects with the same field structure. Assign the state field to the argumentField property of the commonSeriesSettings object to specify the common argument for the series. Then, define the series array of objects. In each object, specify the valueField property and use the stack property to group the series in stacks depending on the stack property values.

Customize Side-By-Side Stacked Bar Chart

Customize Chart Legend

Use the verticalAlignment and horizontalAlignment properties of the legend object to specify the legend layout.

Configure Tooltips

To configure tooltips in the chart, use the tooltip object. To enable tooltips, assign true to the enabled property of this object. To customize a tooltip, assign a function to the customizeTooltip property. In this demo, the function returns the tooltip's text that shows the point's percent value and absolute value.

Export Chart

To allow users to export your side-by-side full-stacked bar chart into a PNG, JPEG, PDF, or SVG file, or print the chart, set the export.enabled property to true. Since the export functionality is enabled in this demo, you can click the hamburger button in the chart to invoke a drop-down menu with export and print commands.