RamezIssac / django-slick-reporting

The Reporting Engine for Django. Create dashboards and standalone Reports and Charts.
https://django-slick-reporting.com/
BSD 3-Clause "New" or "Revised" License
564 stars 46 forks source link

Calculate cumulative sum #38

Open nithishnaidu opened 3 years ago

nithishnaidu commented 3 years ago

Hey,

I'm using django-slick-reporting to render graphs, particularly the ReportGenerator class so that I can send the graph data as a json and then render a graph on the frontend.

I'm trying to render a graph that shows the cumulative value for a particular field. (The red line graph from the below image)

cumulative_graph

How can we calculate the cumulative value using django-slick-reporting?

Thanks

RamezIssac commented 3 years ago

Hello @nithishnaidu For the cumulative sum you'd need to do this part of the calculation yourself by looping over the dataset. Sorry, so far did not find a better way yet :)

You can do it via custom calculation fields but that would be much less efficient.