charts - web2py-how to convert a list object to a 2D array or render it in google.visualization.arrayToDataTable -
i can't iterate through list object ardata = [] has, ['yesterday', 42, 49], ['today', 50, 67], ['tommorro', 57, 63]...] display chart.
<script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("visualization", "1", {packages:["corechart"]}); google.setonloadcallback(drawchart); function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('string','day'); data.addcolumn('number','positive'); data.addcolumn('number','negative'); data.addrows([{{=ardata}}] );... </script>
i tried this
function drawchart() { var data = google.visualization.arraytodatatable( {{for row in ardata:}} {{ardata[i]}} {{pass}} );
and
var data = google.visualization.arraytodatatable({{=ardata}});
the variable , ardata function dict return
please , best pratice
Comments
Post a Comment