c# - How to display accumulated data in a line graph in wpf -


i'm sure beginner question somehow fail come solution.

i've got database table mapped mvvm among other columns has 2 named 'dts' , 'movement'.

dts movement

01.01.2016 12:00 +6.5

02.01.2016 20:00 -4

03.01.2016 13:45 +4.4

04.01.2016 13:45 +10

... ...

now want visualize information in line graph syncfusion wpf library. x axis should 'dts'-column y axis should sum of values of movement column dts.

for example

x: 01.01.2016 12:00 y: 6.5

x: 02.01.2016 20:00 y: 2.5 (6.5 - 4)

x: 03.01.2016 13:45 y: 6.9 (6.5 - 4 +4.4)

x: 04.01.2016 13:45 y: 16.9 (6.5 - 4 + 4.4 + 10)

...

is there's elegant way solve this?

best regards

markus

we can accumulated values manipulating movements , accumulated value bound y-axis value in syncfusion chart.

 private void calculateyvalue()  {     double temp = 0;     (int index=0;index<datapoints.count;index++)     {         temp += datapoints[index].movement;         datapoints[index].yvalue += temp;     } } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -