Line Chart DateTime Axis Accumulation

Hello,

see this codepen:

What I would like to achive is, to have one value on the x-Axis per month with an accumulation of the y-Values, here each month one accumulated value (if there are more that 1 values in the month).

Is there a way to achieve that? Like a grouping or accumulation on time-ranges?

Thanks a lot!
Martin

3 Replies 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team January 26, 2021 01:15 PM UTC

Hi Martin,

Greetings from Syncfusion.

We suggest you use DateTimeCategory axis with isIndexed as true to acheive your requirement. We have attached modified sample for your reference. Please check with below UG links and sample.

UG Links : 


Please revert us if you have any concerns.

Regards,
Durga G



MF Martin Frühmorgen January 26, 2021 03:21 PM UTC

Hello,

thanks for the updated codepen.

Unfortunately that's not what I want to achieve.

I would like to see in this example the accumulated values (summed up) of every month.

This means, f.e.
SeriesData 
March 2016 has value 6.3 + 10.3 = 16.6
April 2016 has value 13.3
and so on

SeriesData1
March 2016 has value -5.3
April 2016 has value 1 + 10 = 11
and so on

Any way to achieve this without doing the calculation on the arrays?

Thanks!
Martin



DG Durga Gopalakrishnan Syncfusion Team January 27, 2021 02:31 PM UTC

Hi Martin,

As of now, we don't have option to find same values on x values and sum up the y values automatically. You can use chart load event to find duplicates of x from array of object and perform sum with y values, then finally pass a single object in that data source array.

<ejs-chart :load='onChartLoad'>
export default Vue.extend({
methods: {    
  onChartLoad: function(args){
     //...
 }    
}
})

Please revert us if you have any concerns.

Regards,
Durga G


Marked as answer
Loader.
Up arrow icon