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.35k stars 1.08k forks source link

Json load problem #1284

Open kulimu opened 3 years ago

kulimu commented 3 years ago

i m just want to make that push to the table because i will retrive my data from a server ,but on ready function didn't work but if i make that portion of code alone not in ready function it will work so fine.
$(document).ready(function () { var $arrayResult=[];

      $arrayResult.push(["row","total_bill","tip","sex","smoker","day","time","size"],);

 $arrayResult.push( ["1",16.99,1.01,"Female","No","Sun","Dinner",2],);

$arrayResult.push(["2",10.34,1.66,"Male","No","Sun","Dinner",3],); $arrayResult.push(["3",21.01,3.5,"Male","No","Sun","Dinner",3],); $arrayResult.push(["4",23.68,3.31,"Male","No","Sun","Dinner",2],); $arrayResult.push(["5",24.59,3.61,"Female","No","Sun","Dinner",4],); $arrayResult.push(["6",25.29,4.71,"Male","No","Sun","Dinner",4],); console.log('array==>',$arrayResult); $("#output").pivotUI( $arrayResult,{ rendererName: "Bar Chart", renderers: $.extend( $.pivotUtilities.renderers, $.pivotUtilities.plotly_renderers ) }); }