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

Pivot_UI not showing bar charts , line charts how to enable? #1085

Open rmohamedfazil opened 5 years ago

rmohamedfazil commented 5 years ago

This is My code

<!DOCTYPE html>

Pivot Demo

« back to PivotTable.js examples

image

buckelieg commented 5 years ago

jqeury extend does not eturn any merged objects. you need to separate renderes object declaration and merging like this: var renderers = {}; $.extend(renderers, $.pivotUtilities.renderers, $.pivotUtilities.c3_renderers, $.pivotUtilities.subtotal_renderers);

somkhil commented 5 years ago

HI, I also have similar issue. I can only see default renders in the dropdown though I have added c3 renderers as metioned above. I also tried plotly renederer as per the demo, however it didn;t showup. Default summary pivot table works fine.

var renderers = {}; $.extend(renderers, $.pivotUtilities.renderers, $.pivotUtilities.c3_renderers, $.pivotUtilities.subtotal_renderers);

            var url = '/api/getPivotData' + q;
            Papa.parse(url, {
                download: true,
                skipEmptyLines: true,
                complete: function(parsed){
                    $("#oimPivotTableOutput").pivotUI(parsed.data, {
                        renderers: renderers,
                        cols: ["x"],
                        rows: ["y"],

               // renderer: $.pivotUtilities.plotly_renderers["Scatter Chart"],
                rendererOptions: { plotly: {width: 600, height: 600} }         
                    }); 

                }
klukiyan commented 4 years ago

Hi @somkhil , hi @rmohamedfazil , I had the same issue as you and the solution was that I had to include 1 more dependency: 1 this one I had:

<script src="https://cdn.plot.ly/plotly-basic-latest.min.js"></script>

2 this one had to be included

<script src="https://cdnjs.cloudflare.com/ajax/libs/pivottable/2.23.0/plotly_renderers.min.js"></script>

After that everything worked as per instructions...

var renderers = {}; $.extend(renderers, $.pivotUtilities.renderers, $.pivotUtilities.plotly_renderers);
...
renderers:renderers,
...

Hope it helps