Stacked column in ASP.NET CORE Charts Component

8 Apr 202524 minutes to read

Stacked column

To render a stacked column series in your chart, you need to follow a few steps to configure it correctly. Here’s a concise guide on how to do this:

  • Set the series type: Define the series type as StackingColumn in your chart configuration. This indicates that the data should be represented as a stacked column chart, where each column consists of multiple segments stacked on top of each other.
<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" width="2" yName="y" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" width="2" yName="y1" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" width="2" yName="y2" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" width="2" yName="y3" type="StackingColumn">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Binding data with series

You can bind data to the chart using the dataSource property within the series configuration. This allows you to connect a JSON dataset or remote data to your chart. To display the data correctly, map the fields from the data to the chart series xName and yName properties.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" width="2" yName="y" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" width="2" yName="y1" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" width="2" yName="y2" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" width="2" yName="y3" type="StackingColumn">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Series customization

The following properties can be used to customize the stacked column series.

Fill

The fill property determines the color applied to the series.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn" fill="#ff4251">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn" fill="#4C4C4C">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn" fill="#794F1B">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn" fill="#1a9a6f">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

The fill property can be used to apply a gradient color to the stacked column series. By configuring this property with gradient values, you can create a visually appealing effect in which the color transitions smoothly from one shade to another.

<svg style="width:1px; height:1px">
            <defs>
                <linearGradient id="gradient1">
                    <stop offset="0%" style="stop-color:coral;stop-opacity:5" />
                    <stop offset="50%" style="stop-color:mediumseagreen;stop-opacity:5" />
                </linearGradient>
            </defs>
</svg>

<svg style="width:1px; height:1px">
    <defs>
        <linearGradient id="gradient2">
            <stop offset="0%" style="stop-color:darkred;stop-opacity:5" />
            <stop offset="50%" style="stop-color:darkorange;stop-opacity:5" />
        </linearGradient>
    </defs>
</svg>

<svg style="width:1px; height:1px">
    <defs>
        <linearGradient id="gradient3">
            <stop offset="0%" style="stop-color:darkmagenta;stop-opacity:5" />
            <stop offset="50%" style="stop-color:darkcyan;stop-opacity:5" />
        </linearGradient>
    </defs>
</svg>

<svg style="width:1px; height:1px">
    <defs>
        <linearGradient id="gradient4">
            <stop offset="0%" style="stop-color:darkviolet;stop-opacity:5" />
            <stop offset="50%" style="stop-color:darkgoldenrod;stop-opacity:5" />
        </linearGradient>
    </defs>
</svg>

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn" fill="url(#gradient1)">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn" fill="url(#gradient2)">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn" fill="url(#gradient3)">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn" fill="url(#gradient4)">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Opacity

The opacity property specifies the transparency level of the fill. Adjusting this property allows you to control how opaque or transparent the fill color of the series appears.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" opacity="0.7" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" opacity="0.7" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" opacity="0.7" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" opacity="0.7" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Border

Use the border property to customize the width, color and dasharray of the series border.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn">
            <e-series-border width="3" color="#ff4251" dashArray="5,5"></e-series-border>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn">
            <e-series-border width="3" color="#4C4C4C" dashArray="5,5"></e-series-border>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn">
            <e-series-border width="3" color="#794F1B" dashArray="5,5"></e-series-border>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn">
            <e-series-border width="3" color="#1a9a6f" dashArray="5,5"></e-series-border>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            ChartBorder border = new ChartBorder();
            border.Width = 2;
            border.Color = "green";
            border.DashArray = "5,5";
            ViewBag.border = border;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Stacking group

Use the stackingGroup property to group stacked columns and 100% stacked columns. Columns with the same group name are stacked on top of each other.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" width="2" stackingGroup="UKAndGermany" yName="y" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" width="2" stackingGroup="UKAndGermany" yName="y1" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" width="2" stackingGroup="FranceAndItaly" yName="y2" type="StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" width="2" stackingGroup="FranceAndItaly" yName="y3" type="StackingColumn">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Cylindrical stacked column chart

To render a cylindrical stacked column chart, set the columnFacet property to Cylinder in the chart series. This property transforms the regular stacked columns into cylindrical shapes, enhancing the visual representation of the data.

<ejs-chart id="container">
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" interval="1"
        title=Years></e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Sales in Billions" minimum="0" maximum="700" interval="100" labelFormat="{value}B">
    </e-chart-primaryyaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" xName="x" yName="y" name="UK"
            columnFacet="@Syncfusion.EJ2.Charts.ShapeType.Cylinder"
            type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" xName="x" yName="y1" name="Germany"
            columnFacet="@Syncfusion.EJ2.Charts.ShapeType.Cylinder"
            type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" xName="x" yName="y2" name="France"
            columnFacet="@Syncfusion.EJ2.Charts.ShapeType.Cylinder"
            type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" xName="x" yName="y3" name="Italy"
            columnFacet="@Syncfusion.EJ2.Charts.ShapeType.Cylinder"
            type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
{
    List<CylindricalChartData> chartData = new List<CylindricalChartData>
    {
        new CylindricalChartData { x= "2014", y= 111.1, y1= 76.9,  y2= 66.1,  y3= 34.1 },
        new CylindricalChartData { x= "2015", y= 127.3, y1= 99.5,  y2= 79.3,  y3= 38.2 },
        new CylindricalChartData { x= "2016", y= 143.4, y1= 121.7, y2= 91.3,  y3= 44.0 },
        new CylindricalChartData { x= "2017", y= 159.9, y1= 142.5, y2= 102.4, y3= 51.6 },
        new CylindricalChartData { x= "2018", y= 175.4, y1= 166.7, y2= 112.9, y3= 61.9 },
        new CylindricalChartData { x= "2019", y= 189.0, y1= 182.9, y2= 122.4, y3= 71.5 },
        new CylindricalChartData { x= "2020", y= 202.7, y1= 197.3, y2= 120.9, y3= 82.0 }
    };
    ViewBag.dataSource = chartData;
    return View();
}
public class CylindricalChartData
{
    public string x;
    public double y;
    public double y1;
    public double y2;
    public double y3;
}

Empty points

Data points with null or undefined values are considered empty. Empty data points are ignored and not plotted on the chart.

Mode

Use the mode property to define how empty or missing data points are handled in the series. The default mode for empty points is Gap.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average"></e-series-emptypointsettings>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
{
    List<StackedLineChartData> chartData = new List<StackedLineChartData>
        {
            new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
            new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
            new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
            new StackedLineChartData { x= "Clothes", y= null, y1= 30, y2= 60, y3= 180 },
            new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
            new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
            new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
            new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= null, y3= 75 },
            new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
            new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
            new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
            new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
        };
        ViewBag.dataSource = chartData;
        ChartEmptyPointSettings chartEmptyPointSettings = new ChartEmptyPointSettings();
        chartEmptyPointSettings.Mode = EmptyPointMode.Average;
        ViewBag.emptyPoint = chartEmptyPointSettings;
        return View();
}


public class StackedLineChartData
{
    public string x;
    public double? y;
    public double y1;
    public double? y2;
    public double y3;
}

Fill

Use the fill property to customize the fill color of empty points in the series.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average" fill="red"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average" fill="red"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average" fill="red"></e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average" fill="red"></e-series-emptypointsettings>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
{
    List<StackedLineChartData> chartData = new List<StackedLineChartData>
    {
        new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
        new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
        new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
        new StackedLineChartData { x= "Clothes", y= null, y1= 30, y2= 60, y3= 180 },
        new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
        new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
        new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
        new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= null, y3= 75 },
        new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
        new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
        new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
        new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
    };
    ViewBag.dataSource = chartData;
    ChartEmptyPointSettings chartEmptyPointSettings = new ChartEmptyPointSettings();
    chartEmptyPointSettings.Mode = EmptyPointMode.Average;
    chartEmptyPointSettings.Fill = "red";
    ViewBag.emptyPoint = chartEmptyPointSettings;
        ChartMarkerSettings marker = new ChartMarkerSettings();
        marker.Visible = true;
        marker.Width = 7;
        marker.Height = 7;
        marker.IsFilled = true;
        ViewBag.marker = marker;
        return View();
}


public class StackedLineChartData
{
    public string x;
    public double? y;
    public double y1;
    public double? y2;
    public double y3;
}

Border

Use the border property to customize the width and color of the border for empty points.

<ejs-chart id="container" title="Family Expense for Month">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average">
                <e-emptypointsettings-border width="2" color="green"></e-emptypointsettings-border>
            </e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average">
                <e-emptypointsettings-border width="2" color="green"></e-emptypointsettings-border>
            </e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average">
                <e-emptypointsettings-border width="2" color="green"></e-emptypointsettings-border>
            </e-series-emptypointsettings>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
            <e-series-emptypointsettings mode="Syncfusion.EJ2.Charts.EmptyPointMode.Average">
                <e-emptypointsettings-border width="2" color="green"></e-emptypointsettings-border>
            </e-series-emptypointsettings>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
{
    List<StackedLineChartData> chartData = new List<StackedLineChartData>
        {
            new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
            new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
            new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
            new StackedLineChartData { x= "Clothes", y= null, y1= 30, y2= 60, y3= 180 },
            new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
            new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
            new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
            new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= null, y3= 75 },
            new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
            new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
            new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
            new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
        };
        ViewBag.dataSource = chartData;
        ChartEmptyPointSettings chartEmptyPointSettings = new ChartEmptyPointSettings();
        chartEmptyPointSettings.Mode = EmptyPointMode.Average;
        chartEmptyPointSettings.Border.Width = 2;
        chartEmptyPointSettings.Border.Color = "green";
        ViewBag.emptyPoint = chartEmptyPointSettings;
        ChartMarkerSettings marker = new ChartMarkerSettings();
        marker.Visible = true;
        marker.Width = 7;
        marker.Height = 7;
        marker.IsFilled = true;
        ViewBag.marker = marker;
        return View();
}


public class StackedLineChartData
{
    public string x;
    public double? y;
    public double y1;
    public double? y2;
    public double y3;
}

Stack labels

The stack labels in stacked charts display cumulative total values for stack segments directly using data labels. If a stacked point has negative values, the stack labels are displayed below the point.

<ejs-chart id="container" title="Mobile Game Market by Country">
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Years" interval="1">
    </e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Sales in Billions" minimum="0" maximum="700" interval="100" labelFormat="{value}B">
    </e-chart-primaryyaxis>
    <e-chart-stacklabels visible="true"></e-chart-stacklabels>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="UK" xName="X" yName="Y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Germany" xName="X" yName="Y1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="France" xName="X" yName="Y2" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Italy" xName="X" yName="Y3" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedColumnChartData> chartData = new List<StackedColumnChartData>
            {
                new StackedColumnChartData { X = "2014", Y = 111.1, Y1 = 76.9,  Y2 = 66.1,  Y3 = 34.1 },
                new StackedColumnChartData { X = "2015", Y = 127.3, Y1 = 99.5,  Y2 = 79.3,  Y3 = 38.2 },
                new StackedColumnChartData { X = "2016", Y = 143.4, Y1 = 121.7, Y2 = 91.3,  Y3 = 44.0 },
                new StackedColumnChartData { X = "2017", Y = 159.9, Y1 = 142.5, Y2 = 102.4, Y3 = 51.6 },
                new StackedColumnChartData { X = "2018", Y = 175.4, Y1 = 166.7, Y2 = 112.9, Y3 = 61.9 },
                new StackedColumnChartData { X = "2019", Y = 189.0, Y1 = 182.9, Y2 = 122.4, Y3 = 71.5 },
                new StackedColumnChartData { X = "2020", Y = 202.7, Y1 = 197.3, Y2 = 120.9, Y3 = 82.0 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedColumnChartData
        {
            public string X;
            public double Y;
            public double Y1;
            public double Y2;
            public double Y3;
        }

Stack labels customization

Stack labels have various properties for customization to enhance the visual based on your requirements:

  • Visible - Specifies whether stack labels are visible. Setting to true will display the labels. Default is false.
  • Fill - Defines the background color of the stack labels. Accepts valid CSS color strings (hex, RGBA, etc.). Default is transparent.
  • Format - Formats the text displayed in the stack labels. Supports placeholders like {value}. Default is null.
  • Angle - Specifies the rotation angle for stack labels in degrees. Default is 0.
  • Rx - Defines the rounded corner radius along the X-axis (horizontal direction) for the stack label background. Default is 5.
  • Ry - Defines the rounded corner radius along the Y-axis (vertical direction) for the stack label background. Default is 5.
  • Margin - Configures the margin around the stack label (left, right, top, and bottom).
  • Border - Configures the appearance of the stack label’s border.
  • Font - Customizes the stack label text, including font size, color, style, weight, and family.
<ejs-chart id="container" title="Mobile Game Market by Country">
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Years" interval="1">
    </e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Sales in Billions" minimum="0" maximum="700" interval="100" labelFormat="{value}B">
    </e-chart-primaryyaxis>
    <e-chart-stacklabels visible="true" fill="rgba(0, 123, 255, 0.5)" format="{value}" angle="45" rx="10" ry="10">
    </e-chart-stacklabels>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="UK" xName="X" yName="Y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Germany" xName="X" yName="Y1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="France" xName="X" yName="Y2" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Italy" xName="X" yName="Y3" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-marker>
                 <e-series-datalabel visible="true"></e-series-datalabel>
             </e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<StackedColumnChartData> chartData = new List<StackedColumnChartData>
            {
                new StackedColumnChartData { X = "2014", Y = 111.1, Y1 = 76.9,  Y2 = 66.1,  Y3 = 34.1 },
                new StackedColumnChartData { X = "2015", Y = 127.3, Y1 = 99.5,  Y2 = 79.3,  Y3 = 38.2 },
                new StackedColumnChartData { X = "2016", Y = 143.4, Y1 = 121.7, Y2 = 91.3,  Y3 = 44.0 },
                new StackedColumnChartData { X = "2017", Y = 159.9, Y1 = 142.5, Y2 = 102.4, Y3 = 51.6 },
                new StackedColumnChartData { X = "2018", Y = 175.4, Y1 = 166.7, Y2 = 112.9, Y3 = 61.9 },
                new StackedColumnChartData { X = "2019", Y = 189.0, Y1 = 182.9, Y2 = 122.4, Y3 = 71.5 },
                new StackedColumnChartData { X = "2020", Y = 202.7, Y1 = 197.3, Y2 = 120.9, Y3 = 82.0 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedColumnChartData
        {
            public string X;
            public double Y;
            public double Y1;
            public double Y2;
            public double Y3;
        }

Corner radius

The CornerRadius property in the chart series is used to customize the corner radius for stacked column series. This allows you to create stacked columns with rounded corners, giving your chart a more polished appearance. You can customize each corner of the stacked columns using the topLeft, topRight, bottomLeft, and bottomRight properties.

<ejs-chart id="container" title="Mobile Game Market by Country" pointRender="pointRender">
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Years" interval="1">
    </e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Sales in Billions" minimum="0" maximum="700" interval="100" labelFormat="{value}B">
    </e-chart-primaryyaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="UK" xName="X" yName="Y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Germany" xName="X" yName="Y1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="France" xName="X" yName="Y2" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Italy" xName="X" yName="Y3" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
            <e-series-cornerradius topLeft="10" topRight="10"></e-series-cornerradius>
        </e-series>
    </e-series-collection>
</ejs-chart>

<script>
    function pointRender(args) {
        if (args.point.series.index % 2 !== 0) {
            args.fill = '#ff6347';
        }
        else {
            args.fill = '#009cb8';
        }
    }
</script>
public ActionResult Index()
    {
        List<StackedColumnChartData> chartData = new List<StackedColumnChartData>
        {
            new StackedColumnChartData { X = "2014", Y = -111.1, Y1 = 76.9,  Y2 = 66.1,  Y3 = 34.1 },
            new StackedColumnChartData { X = "2015", Y = 127.3, Y1 = 99.5,  Y2 = 79.3,  Y3 = 38.2 },
            new StackedColumnChartData { X = "2016", Y = -143.4, Y1 = 121.7, Y2 = 91.3,  Y3 = 44.0 },
            new StackedColumnChartData { X = "2017", Y = 159.9, Y1 = 142.5, Y2 = 102.4, Y3 = 51.6 },
            new StackedColumnChartData { X = "2018", Y = -175.4, Y1 = 166.7, Y2 = 112.9, Y3 = 61.9 },
            new StackedColumnChartData { X = "2019", Y = 189.0, Y1 = 182.9, Y2 = 122.4, Y3 = 71.5 },
            new StackedColumnChartData { X = "2020", Y = -202.7, Y1 = 197.3, Y2 = 120.9, Y3 = 82.0 }
        };
        ViewBag.dataSource = chartData;
        return View();
    }
    public class StackedColumnChartData
    {
        public string X;
        public double Y;
        public double Y1;
        public double Y2;
        public double Y3;
    }

Point corner radius

We can customize the corner radius for individual points in the chart series using the PointRender event by setting the CornerRadius property in its event argument.

<ejs-chart id="container" title="Mobile Game Market by Country" pointRender="pointRender">
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.Category" title="Years" interval="1">
    </e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Sales in Billions" minimum="0" maximum="700" interval="100" labelFormat="{value}B">
    </e-chart-primaryyaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="UK" xName="X" yName="Y" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Germany" xName="X" yName="Y1" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="France" xName="X" yName="Y2" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Italy" xName="X" yName="Y3" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StackingColumn">
        </e-series>
    </e-series-collection>
</ejs-chart>

<script>
    function pointRender(args) {
        if (args.point.index === 0 && args.point.series.index === 3) {
            args.cornerRadius = { topLeft: 10, bottomLeft: 0, topRight: 10, bottomRight: 0 };
        }
        if (args.point.index === 3 && args.point.series.index === 3) {
            args.cornerRadius = { topLeft: 10, bottomLeft: 0, topRight: 10, bottomRight: 0 };
        }
        if (args.point.index === 4 && args.point.series.index === 3) {
            args.cornerRadius = { topLeft: 10, bottomLeft: 0, topRight: 10, bottomRight: 0 };
        }
        if (args.point.index === 6 && args.point.series.index === 3) {
            args.cornerRadius = { topLeft: 10, bottomLeft: 0, topRight: 10, bottomRight: 0 };
        }
    }
</script>
public ActionResult Index()
    {
        List<StackedColumnChartData> chartData = new List<StackedColumnChartData>
        {
            new StackedColumnChartData { X = "2014", Y = 111.1, Y1 = 76.9,  Y2 = 66.1,  Y3 = 34.1 },
            new StackedColumnChartData { X = "2015", Y = 127.3, Y1 = 99.5,  Y2 = 79.3,  Y3 = 38.2 },
            new StackedColumnChartData { X = "2016", Y = 143.4, Y1 = 121.7, Y2 = 91.3,  Y3 = 44.0 },
            new StackedColumnChartData { X = "2017", Y = 159.9, Y1 = 142.5, Y2 = 102.4, Y3 = 51.6 },
            new StackedColumnChartData { X = "2018", Y = 175.4, Y1 = 166.7, Y2 = 112.9, Y3 = 61.9 },
            new StackedColumnChartData { X = "2019", Y = 189.0, Y1 = 182.9, Y2 = 122.4, Y3 = 71.5 },
            new StackedColumnChartData { X = "2020", Y = 202.7, Y1 = 197.3, Y2 = 120.9, Y3 = 82.0 }
        };
        ViewBag.dataSource = chartData;
        return View();
    }
    public class StackedColumnChartData
    {
        public string X;
        public double Y;
        public double Y1;
        public double Y2;
        public double Y3;
    }

Events

Series render

The seriesRender event allows you to customize series properties, such as data, fill, and name, before they are rendered on the chart.

<ejs-chart id="container" title="Family Expense for Month" seriesRender="changeColor">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" width="2" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" width="2" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" width="2" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" width="2" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>

<script>
    function changeColor(args) {
        if (args.series.index === 0) {
            args.fill = '#ff4251';
        }
        else if (args.series.index === 1) {
            args.fill = '#4C4C4C';
        }
        else if (args.series.index === 2) {
            args.fill = '#794F1B';
        }
        else if (args.series.index === 3) {
            args.fill = '#1a9a6f';
        }
    }
</script>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

Point render

The pointRender event allows you to customize each data point before it is rendered on the chart.

<ejs-chart id="container" title="Family Expense for Month" pointRender="changeColor">
    <e-chart-primaryxaxis valueType="Category" interval="1">
    </e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" name="John" xName="x" width="2" yName="y" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Peter" xName="x" width="2" yName="y1" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Steve" xName="x" width="2" yName="y2" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" name="Charle" xName="x" width="2" yName="y3" type="StackingColumn">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>

<script>
    function changeColor(args) {
        if (args.point.y < 100) {
            args.fill = '#ff6347';
        }
        else {
            args.fill = '#009cb8';
        }
    }
</script>
public ActionResult Index()
        {
            List<StackedLineChartData> chartData = new List<StackedLineChartData>
            {
                new StackedLineChartData { x= "Food", y= 90, y1= 40, y2= 70, y3= 120 },
                new StackedLineChartData { x= "Transport", y= 80, y1= 90, y2= 110, y3= 70 },
                new StackedLineChartData { x= "Medical", y= 50, y1= 80, y2= 120, y3= 50 },
                new StackedLineChartData { x= "Clothes", y= 70, y1= 30, y2= 60, y3= 180 },
                new StackedLineChartData { x= "Personal Care", y= 30, y1= 80, y2= 80, y3= 30 },
                new StackedLineChartData { x= "Books", y= 10, y1= 40, y2= 30, y3= 270 },
                new StackedLineChartData { x= "Fitness", y= 100,y1= 30, y2= 70, y3= 40 },
                new StackedLineChartData { x= "Electricity", y= 55, y1= 95, y2= 55, y3= 75 },
                new StackedLineChartData { x= "Tax", y= 20, y1= 50, y2= 40, y3= 65 },
                new StackedLineChartData { x= "Pet Care", y= 40, y1= 20, y2= 80, y3= 95 },
                new StackedLineChartData { x= "Education", y= 45, y1= 15, y2= 45, y3= 195 },
                new StackedLineChartData { x= "Entertainment", y= 75, y1= 45, y2= 65, y3= 115 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class StackedLineChartData
        {
            public string x;
            public double y;
            public double y1;
            public double y2;
            public double y3;
        }

See also