Hi Pylori,
We have analysed your query. From that, we would like to let you know that it is not possible to achieve your requirement using stacked line series. Hence we suggest you to use load event in the chart to customize the datasource based on your requirement.
Code Snippet:
|
Index.cshtml:
// add your additional code here
@Html.EJS().Chart("container").ChartArea(area => area.Border(br => br.Color("transparent"))).Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).Width(2).XName("xValue")
.Marker(mr => mr.Visible(true).Width(10).Height(10)).YName("yValue")
.DataSource(ViewBag.dataSource).Name("Germany").Add();
})
// add your additional code here
).Title("Inflation - Consumer Price").Tooltip(tt => tt.Enable(true)).Load("load").Render()
<script>
var load = function (args) {
var count = 0;
for (var i = 0; i < args.chart.series[0].dataSource.length; i++) {
args.chart.series[0].dataSource[i].yValue = args.chart.series[0].dataSource[i].yValue + count;
count = count + 10;
}
}
</script> |
Screenshot:
Let us know if you have any concerns.
Regards,
Srihari M