weixin_33722405 2016-05-04 20:10 采纳率: 0%
浏览 57

googlecharts问题

I am with following problem, when I initialize my site I can see the chart, but when I click to go to page he of the problem and not the shows. The site was programmed in Ajax, therefore I would give only a div. The following code is in one of these pages that I draw with Ajax. This feature page I call the 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);
}

My index I include myself the following directory web:

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

When I open the console of chrome, 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 not found nothing concrete, however I noticed that is something related to quantity of calls made. Not believed for obvious reasons of non-operation of the amendments. Someone knows how to fix the problem ?

  • 写回答

1条回答 默认 最新

  • weixin_33725272 2016-09-09 09:03
    关注

    I know that it is too late, but in case you still didn't found a solution, you can try this:

    google.charts.load('45', {packages: ['corechart']});
    

    write "45" instead of "current", because "current" is still version "44". This worked for me

    评论

报告相同问题?

悬赏问题

  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch