简体   繁体   中英

how to create pivot table from Canvas Data Grid?

I need help - how to create a pivot table in Canvas-Datagrid. Kindly Help me. This is what we're trying to do. the actual data is below:

https://github.com/TonyGermaneri/canvas-datagrid

在此处输入图片说明

we're trying to get the data grid to display something like this in a new grid preferably:

在此处输入图片说明

data in the grid is a array of objects or an array of arrays, manipulating the data is done the same way you would any standard JS data.

This looks like an elegant solution to the problem: https://medium.com/front-end-hacking/matrix-rotation-%EF%B8%8F-6550397f16ab

So what you'd do is:

grid.data = flipMatrix(grid.data); and maybe grid.draw();

If the grid is not disposing of the previous schema (the column names are not changing) you can tell it to always load a new schema when the setting data by setting the autoGenerateSchema property to true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM