Syncfusion AI Assistant

How can I help you?

Tooltip in ASP.NET CORE Chart Component

23 Mar 202624 minutes to read

Chart will display details about the points through tooltip, when the mouse is moved over the point.

Enable tooltip

The tooltip is useful when you cannot display information by using the data labels due to space constraints. You can enable the tooltip by setting Enable property as true in Tooltip object.

<ejs-chart id="container">
        <e-chart-tooltipsettings enable="true">
        </e-chart-tooltipsettings>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
        <e-series-collection>
            <e-series dataSource="ViewBag.dataSource" name="Germany" xName="x" width="2" opacity="1" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            </e-series>
        </e-series-collection>
    </ejs-chart>
public IActionResult Index()
        {
            List<ColumnChartData> chartData = new List<ColumnChartData>
            {
                new ColumnChartData { x= "USA", yValue= 46 }, 
                new ColumnChartData { x= "GBR", yValue= 27 }, 
                new ColumnChartData { x= "CHN", yValue= 26 },
                new ColumnChartData { x= "UK", yValue= 26 },
                new ColumnChartData { x= "AUS", yValue= 26 },
                new ColumnChartData { x= "IND", yValue= 26 },
                new ColumnChartData { x= "DEN", yValue= 26 },
                new ColumnChartData { x= "MEX", yValue= 26 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class ColumnChartData
        {
            public string x;
            public double yValue;
        }

Fixed tooltip

By default, tooltip track the mouse movement, but you can set a fixed position for the tooltip by using the Location property.

<ejs-chart id="container">
        <e-chart-tooltipsettings enable="true">
            <e-tooltipsettings-location x="120" y="20"></e-tooltipsettings-location>
        </e-chart-tooltipsettings>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-primaryxaxis valueType="Category" interval="1"></e-chart-primaryxaxis>
        <e-series-collection>
            <e-series dataSource="ViewBag.dataSource" name="Gold" xName="xValue" width="2" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            </e-series>
        </e-series-collection>
    </ejs-chart>
public IActionResult Index()
{
    List<ColumnChartData> chartData = new List<ColumnChartData>
    {
        new ColumnChartData { xValue= "USA", yValue= 46 }, 
        new ColumnChartData { xValue= "GBR", yValue= 27 }, 
        new ColumnChartData { xValue= "CHN", yValue= 26 },
        new ColumnChartData { xValue= "UK",  yValue= 26 },
        new ColumnChartData { xValue= "AUS", yValue= 26 },
        new ColumnChartData { xValue= "IND", yValue= 26 },
        new ColumnChartData { xValue= "DEN", yValue= 26 },
        new ColumnChartData { xValue= "MEX", yValue= 26 }
    };
    ViewBag.dataSource = chartData;
    return View();
}
public class ColumnChartData
{
    public string xValue;
    public double yValue;
}

Format the tooltip

By default, tooltip shows information of x and y value in points. In addition to that, you can show more information in tooltip. For example the format ${series.name} ${point.x} shows series name and point x value.

<ejs-chart id="container">
        <e-chart-tooltipsettings enable="true" header="Unemployment" format="<b>${point.x} : ${point.y}</b>">
        </e-chart-tooltipsettings>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
        <e-series-collection>
            <e-series dataSource="ViewBag.dataSource" name="Germany" xName="x" width="2" opacity="1" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            </e-series>
        </e-series-collection>
    </ejs-chart>
public IActionResult Index()
        {
            List<ColumnChartData> chartData = new List<ColumnChartData>
            {
                new ColumnChartData { x= "USA", yValue= 46 }, 
                new ColumnChartData { x= "GBR", yValue= 27 }, 
                new ColumnChartData { x= "CHN", yValue= 26 },
                new ColumnChartData { x= "UK", yValue= 26 },
                new ColumnChartData { x= "AUS", yValue= 26 },
                new ColumnChartData { x= "IND", yValue= 26 },
                new ColumnChartData { x= "DEN", yValue= 26 },
                new ColumnChartData { x= "MEX", yValue= 26 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class ColumnChartData
        {
            public string x;
            public double yValue;
        }

Tooltip template

Any HTML elements can be displayed in the tooltip by using the Template property of the tooltip. You can use the ${x} and ${y} as place holders in the HTML element to display the x and y values of the corresponding data point.

<ejs-chart id="container">
        <e-chart-tooltipsettings enable="true" template="#Unemployment">
        </e-chart-tooltipsettings>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
        <e-series-collection>
            <e-series dataSource="ViewBag.dataSource" name="Germany" xName="x" width="2" opacity="1" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            </e-series>
        </e-series-collection>
  </ejs-chart>
  <script id="Unemployment" type="text/x-template">
    <div id='templateWrap'>
        <table style="width:100%;  border: 1px solid black;">
            <tr><th colspan="2" bgcolor="#00FFFF">Unemployment</th></tr>
            <tr><td bgcolor="#00FFFF">${x}:</td><td bgcolor="#00FFFF">${y}</td></tr>
        </table>
    </div>
</script>
public IActionResult Index()
        {
            List<ColumnChartData> chartData = new List<ColumnChartData>
            {
                new ColumnChartData { x= "USA", yValue= 46 },
                new ColumnChartData { x= "GBR", yValue= 27 },
                new ColumnChartData { x= "CHN", yValue= 26 },
                new ColumnChartData { x= "UK", yValue= 26 },
                new ColumnChartData { x= "AUS", yValue= 26 },
                new ColumnChartData { x= "IND", yValue= 26 },
                new ColumnChartData { x= "DEN", yValue= 26 },
                new ColumnChartData { x= "MEX", yValue= 26 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class ColumnChartData
        {
            public string x;
            public double yValue;
        }

Customize the appearance of tooltip

The Fill and Border properties are used to customize the background color and border of the tooltip respectively. The TextStyle property in the tooltip is used to customize the font of the tooltip text. The HighlightColor property is used to customize the point color while hovering for tooltip.

@{
    var border = new { color = "grey", width = 2 };
}
 <ejs-chart id="container" highlightColor="red">
        <e-chart-tooltipsettings enable="true" format="${series.name} ${point.x} : ${point.y}"
            fill="#7bb4eb" border="border">
        </e-chart-tooltipsettings>
        <e-chart-legendsettings visible="false"></e-chart-legendsettings>
        <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
        <e-series-collection>
            <e-series dataSource="ViewBag.dataSource" name="Germany" xName="x" width="2" opacity="1" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            </e-series>
        </e-series-collection>
</ejs-chart>
public IActionResult Index()
        {
            List<ColumnChartData> chartData = new List<ColumnChartData>
            {
                new ColumnChartData { x= "USA", yValue= 46 },
                new ColumnChartData { x= "GBR", yValue= 27 },
                new ColumnChartData { x= "CHN", yValue= 26 },
                new ColumnChartData { x= "UK", yValue= 26 },
                new ColumnChartData { x= "AUS", yValue= 26 },
                new ColumnChartData { x= "IND", yValue= 26 },
                new ColumnChartData { x= "DEN", yValue= 26 },
                new ColumnChartData { x= "MEX", yValue= 26 },
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class ColumnChartData
        {
            public string x;
            public double yValue;
        }

Tooltip mapping name

By default, tooltip shows information of x and y value in points. You can show more information from data source in tooltip by using the TooltipMappingName property of the tooltip. You can use the ${point.tooltip} as place holders to display the specified tooltip content.

<ejs-chart id="container">
    <e-chart-tooltipsettings enable="true" format="${point.tooltip}">
    </e-chart-tooltipsettings>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" tooltipMappingName="text" name="Germany" xName="xValue" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<GroupingChartData> chartData = new List<GroupingChartData>
            {

                new GroupingChartData { xValue = "China",         yValue = 26, text = "China: 26" },
                new GroupingChartData { xValue = "Russia",        yValue = 19, text = "Russia: 19" },
                new GroupingChartData { xValue = "Germany",       yValue = 17, text = "Germany: 17" },
                new GroupingChartData { xValue = "Japan",         yValue = 12, text = "Japan: 12" },
                new GroupingChartData { xValue = "France",        yValue = 10, text = "France: 10" },
                new GroupingChartData { xValue = "South Korea",   yValue = 9,  text = "South Korea: 9" },
                new GroupingChartData { xValue = "Great Britain", yValue = 27, text = "Great Britain: 27" },
                new GroupingChartData { xValue = "Italy",         yValue = 8,  text = "Italy: 8" },
                new GroupingChartData { xValue = "Australia",     yValue = 8,  text = "Australia: 8" },
                new GroupingChartData { xValue = "Netherlands",   yValue = 8,  text = "Netherlands: 8" },
                new GroupingChartData { xValue = "Hungary",       yValue = 8,  text = "Hungary: 8" },
                new GroupingChartData { xValue = "Brazil",        yValue = 7,  text = "Brazil: 7" },
                new GroupingChartData { xValue = "Spain",         yValue = 7,  text = "Spain: 7" },
                new GroupingChartData { xValue = "Kenya",         yValue = 6,  text = "Kenya: 6" }

            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class GroupingChartData
        {
            public string xValue;
            public double yValue;
            public string text;
        }

Split tooltip

The split tooltip displays a separate tooltip for each series at the same data point, making it easier to compare values across multiple series.

Enable this feature by setting the split property to true:

<ejs-chart id="container">
    <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Value"></e-chart-primaryyaxis>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-tooltipsettings enable="true" split="true"></e-chart-tooltipsettings>
    <e-series-collection>
        <e-series dataSource="ViewBag.vietnamData"
                  xName="x"
                  yName="y"
                  name="Vietnam"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.indonesiaData"
                  xName="x"
                  yName="y"
                  name="Indonesia"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.franceData"
                  xName="x"
                  yName="y"
                  name="France"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.polandData"
                  xName="x"
                  yName="y"
                  name="Poland"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.mexicoData"
                  xName="x"
                  yName="y"
                  name="Mexico"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Line">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;

namespace EJ2CoreSampleBrowser.Controllers.Chart
{
    public partial class ChartController : Controller
    {
        public IActionResult SplitTooltip()
        {
            List<ChartData> vietnamData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 7.8 },
                new ChartData { x = 2017, y = 10.3 },
                new ChartData { x = 2018, y = 15.5 },
                new ChartData { x = 2019, y = 17.5 },
                new ChartData { x = 2020, y = 19.5 },
                new ChartData { x = 2021, y = 23.0 },
                new ChartData { x = 2022, y = 20.0 },
                new ChartData { x = 2023, y = 19.0 },
                new ChartData { x = 2024, y = 22.1 }
            };

            List<ChartData> indonesiaData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 4.8 },
                new ChartData { x = 2017, y = 5.2 },
                new ChartData { x = 2018, y = 6.2 },
                new ChartData { x = 2019, y = 7.8 },
                new ChartData { x = 2020, y = 9.3 },
                new ChartData { x = 2021, y = 14.3 },
                new ChartData { x = 2022, y = 15.6 },
                new ChartData { x = 2023, y = 16.0 },
                new ChartData { x = 2024, y = 17.0 }
            };

            List<ChartData> franceData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 14.6 },
                new ChartData { x = 2017, y = 15.5 },
                new ChartData { x = 2018, y = 15.4 },
                new ChartData { x = 2019, y = 14.4 },
                new ChartData { x = 2020, y = 11.6 },
                new ChartData { x = 2021, y = 13.9 },
                new ChartData { x = 2022, y = 12.1 },
                new ChartData { x = 2023, y = 10.0 },
                new ChartData { x = 2024, y = 10.8 }
            };

            List<ChartData> polandData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 8.9 },
                new ChartData { x = 2017, y = 10.3 },
                new ChartData { x = 2018, y = 10.8 },
                new ChartData { x = 2019, y = 9.0 },
                new ChartData { x = 2020, y = 7.9 },
                new ChartData { x = 2021, y = 8.5 },
                new ChartData { x = 2022, y = 7.4 },
                new ChartData { x = 2023, y = 6.4 },
                new ChartData { x = 2024, y = 7.1 }
            };

            List<ChartData> mexicoData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 19.0 },
                new ChartData { x = 2017, y = 20.0 },
                new ChartData { x = 2018, y = 20.2 },
                new ChartData { x = 2019, y = 18.4 },
                new ChartData { x = 2020, y = 16.8 },
                new ChartData { x = 2021, y = 18.5 },
                new ChartData { x = 2022, y = 18.4 },
                new ChartData { x = 2023, y = 16.3 },
                new ChartData { x = 2024, y = 13.7 }
            };

            ViewBag.vietnamData = vietnamData;
            ViewBag.indonesiaData = indonesiaData;
            ViewBag.franceData = franceData;
            ViewBag.polandData = polandData;
            ViewBag.mexicoData = mexicoData;
            return View();
        }

        public class ChartData
        {
            public double x;
            public double y;
        }
    }
}

Follow pointer

The follow pointer feature enables the tooltip to follow the mouse cursor or touch pointer as users interact with the chart. This provides a more dynamic and intuitive experience by keeping the tooltip close to the user’s point of interaction.

Enable this feature by setting the followPointer property to true:

<ejs-chart id="container">
    <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Value"></e-chart-primaryyaxis>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-tooltipsettings enable="true" followPointer="true"></e-chart-tooltipsettings>
    <e-series-collection>
        <e-series dataSource="ViewBag.vietnamData"
                  xName="x"
                  yName="y"
                  name="Vietnam"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.franceData"
                  xName="x"
                  yName="y"
                  name="France"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.mexicoData"
                  xName="x"
                  yName="y"
                  name="Mexico"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public IActionResult FollowPointer()
{
    List<ChartData> vietnamData = new List<ChartData>
    {
        new ChartData { x = 2016, y = 7.8 },
        new ChartData { x = 2017, y = 10.3 },
        new ChartData { x = 2018, y = 15.5 },
        new ChartData { x = 2019, y = 17.5 },
        new ChartData { x = 2020, y = 19.5 },
        new ChartData { x = 2021, y = 23.0 },
        new ChartData { x = 2022, y = 20.0 },
        new ChartData { x = 2023, y = 19.0 },
        new ChartData { x = 2024, y = 22.1 }
    };

    List<ChartData> franceData = new List<ChartData>
    {
        new ChartData { x = 2016, y = 14.6 },
        new ChartData { x = 2017, y = 15.5 },
        new ChartData { x = 2018, y = 15.4 },
        new ChartData { x = 2019, y = 14.4 },
        new ChartData { x = 2020, y = 11.6 },
        new ChartData { x = 2021, y = 13.9 },
        new ChartData { x = 2022, y = 12.1 },
        new ChartData { x = 2023, y = 10.0 },
        new ChartData { x = 2024, y = 10.8 }
    };

    List<ChartData> mexicoData = new List<ChartData>
    {
        new ChartData { x = 2016, y = 19.0 },
        new ChartData { x = 2017, y = 20.0 },
        new ChartData { x = 2018, y = 20.2 },
        new ChartData { x = 2019, y = 18.4 },
        new ChartData { x = 2020, y = 16.8 },
        new ChartData { x = 2021, y = 18.5 },
        new ChartData { x = 2022, y = 18.4 },
        new ChartData { x = 2023, y = 16.3 },
        new ChartData { x = 2024, y = 13.7 }
    };

    ViewBag.vietnamData = vietnamData;
    ViewBag.franceData = franceData;
    ViewBag.mexicoData = mexicoData;
    return View();
}

public class ChartData
{
    public double x;
    public double y;
}

Tooltip distance

The tooltip distance property controls the spacing between the tooltip and the mouse pointer or target data point. This prevents the tooltip from overlapping with the cursor or nearby chart elements, improving readability.

Set the distance property to specify the gap in pixels:

<ejs-chart id="container">
    <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Value"></e-chart-primaryyaxis>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-tooltipsettings enable="true" distance="20"></e-chart-tooltipsettings>
    <e-series-collection>
        <e-series dataSource="ViewBag.vietnamData"
                  xName="x"
                  yName="y"
                  name="Vietnam"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.polandData"
                  xName="x"
                  yName="y"
                  name="Poland"
                  type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
            <e-series-marker visible="true"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;

namespace EJ2CoreSampleBrowser.Controllers.Chart
{
    public partial class ChartController : Controller
    {
        public IActionResult TooltipDistance()
        {
            List<ChartData> vietnamData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 7.8 },
                new ChartData { x = 2017, y = 10.3 },
                new ChartData { x = 2018, y = 15.5 },
                new ChartData { x = 2019, y = 17.5 },
                new ChartData { x = 2020, y = 19.5 },
                new ChartData { x = 2021, y = 23.0 },
                new ChartData { x = 2022, y = 20.0 },
                new ChartData { x = 2023, y = 19.0 },
                new ChartData { x = 2024, y = 22.1 }
            };

            List<ChartData> polandData = new List<ChartData>
            {
                new ChartData { x = 2016, y = 8.9 },
                new ChartData { x = 2017, y = 10.3 },
                new ChartData { x = 2018, y = 10.8 },
                new ChartData { x = 2019, y = 9.0 },
                new ChartData { x = 2020, y = 7.9 },
                new ChartData { x = 2021, y = 8.5 },
                new ChartData { x = 2022, y = 7.4 },
                new ChartData { x = 2023, y = 6.4 },
                new ChartData { x = 2024, y = 7.1 }
            };

            ViewBag.vietnamData = vietnamData;
            ViewBag.polandData = polandData;
            return View();
        }

        public class ChartData
        {
            public double x;
            public double y;
        }
    }
}

Enable highlight

By setting the EnableHighlight property to true, you can highlight all points in the hovered series while dimming points in other series, enhancing focus and clarity.

<ejs-chart id="container">
    <e-chart-tooltipsettings enable="true" format="${point.tooltip}" enableHighlight="true">
    </e-chart-tooltipsettings>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-primaryxaxis valueType="Category"></e-chart-primaryxaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" tooltipMappingName="text" name="Germany" xName="xValue" yName="yValue" type="@Syncfusion.EJ2.Charts.ChartSeriesType.Column">
        </e-series>
    </e-series-collection>
</ejs-chart>
public ActionResult Index()
        {
            List<GroupingChartData> chartData = new List<GroupingChartData>
            {

                new GroupingChartData { xValue = "China",         yValue = 26, text = "China: 26" },
                new GroupingChartData { xValue = "Russia",        yValue = 19, text = "Russia: 19" },
                new GroupingChartData { xValue = "Germany",       yValue = 17, text = "Germany: 17" },
                new GroupingChartData { xValue = "Japan",         yValue = 12, text = "Japan: 12" },
                new GroupingChartData { xValue = "France",        yValue = 10, text = "France: 10" },
                new GroupingChartData { xValue = "South Korea",   yValue = 9,  text = "South Korea: 9" },
                new GroupingChartData { xValue = "Great Britain", yValue = 27, text = "Great Britain: 27" },
                new GroupingChartData { xValue = "Italy",         yValue = 8,  text = "Italy: 8" },
                new GroupingChartData { xValue = "Australia",     yValue = 8,  text = "Australia: 8" },
                new GroupingChartData { xValue = "Netherlands",   yValue = 8,  text = "Netherlands: 8" },
                new GroupingChartData { xValue = "Hungary",       yValue = 8,  text = "Hungary: 8" },
                new GroupingChartData { xValue = "Brazil",        yValue = 7,  text = "Brazil: 7" },
                new GroupingChartData { xValue = "Spain",         yValue = 7,  text = "Spain: 7" },
                new GroupingChartData { xValue = "Kenya",         yValue = 6,  text = "Kenya: 6" }

            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class GroupingChartData
        {
            public string xValue;
            public double yValue;
            public string text;
        }

Closest tooltip

The ShowNearestTooltip property in the chart tooltip displays tooltips based on the data points closest to the cursor.

<ejs-chart id="container" title="Unemployment Rates 1975-2010">
    <e-chart-tooltipsettings enable="true" enableHighlight="true" showNearestTooltip="true">
    </e-chart-tooltipsettings>
    <e-chart-legendsettings visible="true"></e-chart-legendsettings>
    <e-chart-primaryxaxis valueType="@Syncfusion.EJ2.Charts.ValueType.DateTime" title="Years" labelFormat="y" intervalType="@Syncfusion.EJ2.Charts.IntervalType.Years" edgeLabelPlacement="@Syncfusion.EJ2.Charts.EdgeLabelPlacement.Shift">
        <e-linestyle width="0"></e-linestyle>
    </e-chart-primaryxaxis>
    <e-chart-primaryyaxis title="Percentage (%)" minimum="0" maximum="20" interval="4" labelFormat="{value}%">
    </e-chart-primaryyaxis>
    <e-series-collection>
        <e-series dataSource="ViewBag.dataSource" xName="X" yName="Y" width="2" name="China" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StepLine">
            <e-series-marker visible="true" height="10" width="10"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" xName="X" yName="Y1" width="2" name="Australia" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StepLine">
            <e-series-marker visible="true" height="10" width="10"></e-series-marker>
        </e-series>
        <e-series dataSource="ViewBag.dataSource" xName="X" yName="Y2" width="2" name="Japan" type="@Syncfusion.EJ2.Charts.ChartSeriesType.StepLine">
            <e-series-marker visible="true" height="10" width="10"></e-series-marker>
        </e-series>
    </e-series-collection>
</ejs-chart>
public IActionResult Index()
        {
            List<ColumnChartData> chartData = new List<ColumnChartData>
            {
                new ColumnChartData { X = new DateTime(1975, 01, 01), Y = 16,   Y1 = 10,  Y2 = 4.5 },
                new ColumnChartData { X = new DateTime(1980, 01, 01), Y = 12.5, Y1 = 7.5, Y2 = 5 },
                new ColumnChartData { X = new DateTime(1985, 01, 01), Y = 19,   Y1 = 11,  Y2 = 6.5 },
                new ColumnChartData { X = new DateTime(1990, 01, 01), Y = 14.4, Y1 = 7,   Y2 = 4.4 },
                new ColumnChartData { X = new DateTime(1995, 01, 01), Y = 11.5, Y1 = 8,   Y2 = 5 },
                new ColumnChartData { X = new DateTime(2000, 01, 01), Y = 14,   Y1 = 6,   Y2 = 1.5 },
                new ColumnChartData { X = new DateTime(2005, 01, 01), Y = 10,   Y1 = 3.5, Y2 = 2.5 },
                new ColumnChartData { X = new DateTime(2010, 01, 01), Y = 16,   Y1 = 7,   Y2 = 3.7 }
            };
            ViewBag.dataSource = chartData;
            return View();
        }
        public class ColumnChartData
        {
            public DateTime X;
            public double Y;
            public double Y1;
            public double Y2;
        }