nicolaskruchten / pivottable

Open-source Javascript Pivot Table (aka Pivot Grid, Pivot Chart, Cross-Tab) implementation with drag'n'drop.
https://pivottable.js.org/
MIT License
4.36k stars 1.07k forks source link

Make pivottable responsive #848

Closed BrunildaDosti closed 6 years ago

BrunildaDosti commented 6 years ago

Hello,

Thank you for pivottable.js. I have integrated it with Gentelella theme and works fine. But we have an issue with chart display. Chart are not responsive and display wider than the width of page. Could you please tell me how to get a fix for that? Is there any way how to integrate Bootstrap framework with pivot or is another way to get this fixed?

Please instruct me, I`m loosed if the chart does not display as it should!

Thank you in advance! Waiting for your reply. The attachement show a part of issue I`m having. image001

nicolaskruchten commented 6 years ago

You can set the height/width of the chart using rendererOptions as in this example https://pivottable.js.org/examples/scatter.html but there is no built-in way to make things responsive. You can probably force a rerender of the size you like on resize, though.

ffflabs commented 6 years ago

You'd need to add listeners to window resize events and redraw the graph with different dimensions.

Most charts are svg and svgs are not responsive friendly.