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.08k forks source link

Integrating PivotUI into my application #1242

Open ericus2307 opened 4 years ago

ericus2307 commented 4 years ago

Good day I use an application called WebDev to develop web applications. I would like to offer users a Pivot Table experience.

I have included pivot.js in my application and just trying your pivot demo. A button executes the following javascript code. PAGE is how to reference my page and A2 is the control (cell) in which the pivot must be displayed.

$("PAGE#A2").pivotUI( $.pivotUtilities.tipsData, { rows: ["sex", "smoker"], cols: ["day", "time"], vals: ["tip", "total_bill"], aggregatorName: "Sum over Sum", rendererName: "Heatmap" });

However I get these messages in my browser:

$("PAGE#A2").pivotUI( $.pivotUtilities.tipsData, { rows: ["sex", "smoker"], cols: ["day", "time"], vals: ["tip", "total_bill"], aggregatorName: "Sum over Sum", rendererName: "Heatmap" });

pivot.coffee:1043 Error: unknown input format at Function.PivotData.forEachRecord (pivot.coffee:356) at init.$.fn.pivotUI (pivot.coffee:697) at sB0AAAAAAAAAAPEOaPUNRsRRw_g:34 at u (WDUtil.js?3ffff93871220:3) at HTMLButtonElement.onclick (sB0AAAAAAAAAAPEOaPUNRsRRw_g:16) $.fn.pivotUI @ pivot.coffee:1043 WDAJAX.js?3000b93871220:3 [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. WDAJAXRequete.xEnvoi @ WDAJAX.js?3000b93871220:3

Thank you in advance for assistance.

nicolaskruchten commented 4 years ago

The error you're seeing here is Error: unknown input format and it looks like you're trying to use the sample data $.pivotUtilities.tipsData. Are you loading the following file? https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.6.0/tips_data.min.js ... this is where the tips data lives :)