Google charts

  • Hello,
    Is there way to use google charts? I tried this but its not working, i can't pass data to function


    google.charts.load('current', {'packages':['corechart']});
    function graph(element, data){
            function() {
                drawPieChart(element, data);
    function drawPieChart(element,rdata) {
        console.log('Draw chart')
            var data =  google.visualization.arrayToDataTable(rdata);
            var options = {
              pieHole: 0.5,
              pieSliceTextStyle: {
                color: 'black',
              legend: 'none'
            var chart = new google.visualization.PieChart(document.getElementById(element));
            chart.draw(data, options);


             graph('returnRate',{{returnRateGraphData}} );
     <div id="returnRate" style="width: 900px; height: 500px;"></div>

  • administrators

    hi! can you please reproduce your example in the playground, save it and then share the link back here? it will help to check the full example, maybe there is something missing here and we can help pointing where should be the fix in your code


    if you leave the graph2 function commented, it will work, but i need somehow pass data.

  • @Arcus16 using DOM dataset attribut I did manage to pass data to your chart see this playground, hope this can help

  • @MI53RE19 Thank You!

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.