About stacked line charts

Hi,

For example, for a model where all y values ​​are 10, I would like to draw a line graph that increases by 10 as shown below.
Is this possible?

Regards,
Pylori.


1 Reply 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team December 28, 2020 12:23 PM UTC

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 


Marked as answer
Loader.
Up arrow icon