Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
489 views
in Technique[技术] by (71.8m points)

javascript - How to get Grand Total of a column using Webdatarocks and use it in charts

I am using Webdatarocks Pivot table. I get GrandTotal at the bottom of Grid, I want use this Grand Total in the Charts. I checked community but I am unable to find appropriate function which can provide me value of my GrandTotal.

I checked functions in Documentation like getAllMeasures(), getReport() etc. but none of them returns GrandTotal.

There is one way where I can calculate GrandTotal using Javascript function, but in my case GrandTotal will change soon I apply filters in Pivot table. Please advice how to get them in order to use them intermediately.

question from:https://stackoverflow.com/questions/65925553/how-to-get-grand-total-of-a-column-using-webdatarocks-and-use-it-in-charts

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There isn't a specific API call you could use to retrieve the grand total.

You could though use the update event handler to trigger your own grand total calculation every time a new filter is applied.

EDIT: On second thought, you could actually use the getData() method for this – among everything else, it returns the grand total value. More on this here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...