Problems with googlecharts

Asked

Viewed 30 times

1

Good afternoon,

I have following problem, when I start my site it appears the nice chart but when I click to go to page it from the problem and does not show it.

The site is programmed in ajax, so I change only one div. the following code is found in one of these pages I call with ajax.

This page I call Dashboard:

 google.charts.load("current", {packages: ["corechart"]});
google.charts.setOnLoadCallback(drawChart);

function drawChart() {
    var data = google.visualization.arrayToDataTable([
        ['Usado', 'Liberado'],
        ['Usado', <?php echo $tamanho->USADO ?>],
        ['Liberado', <?php echo $tamanho->LIBERADO ?>]
    ]);

    var options = {
        title: 'Banco de dados',
        is3D: true,
    };

    var chart = new google.visualization.PieChart(document.getElementById('piechart_3d'));
    chart.draw(data, options);
}

In my index I include the following web directory:

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>

When I open Chrome console, I am informed of the following error:

Uncaught Error: google.charts.load() cannot be called more than once with version 44 or earlier.

Searching the Internet I found nothing concrete, but I found that it is something related to the amount of calls made. I did not believe for obvious reasons of the amendments not working.

Does anyone know how to fix the problem ?

  • Have you tried placing the call google.charts.load on your home page?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.