Skip to content

Is Google Charts setOnLoadCallback supported? #200

@ToddMinear

Description

@ToddMinear

Hello,

Thanks for Smashing!

I've researched/read/googled and can't find a solution - I'm hoping someone can give me a hint or point me in the right direction.

I'm using Google Charts in a bar widget. Half the time it works just fine, the other half of the time the widgets show with no data.

I'm pretty sure it's because I don't have the google.charts.setOnLoadCallback correct.

I have:

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
  google.charts.load('current', {packages:['corechart']});
</script>

And Google Charts documentation says I should use:

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
  google.charts.load('current', {packages:['corechart']});
  google.charts.setOnLoadCallback(drawChart);
</script>

Of course drawChart is undefined. I've tried to create my own drawChart() but I can't figure out what functions to call.

Here's a screenshot of the errors I'm seeing:
image

Thanks in advance for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions