Hi Alex,

The angularjs component you are using should be fixed to load Google Charts
properly.  That may take time for someone (any idea who?) to implement.
 In the meantime, you should be able to add a timeout loop to your code
before you start making calls to the Google Charts functions.   Something
like this:

  function maybeDrawChart() {
    if (!window.google || !google.visualization ||
!google.visualization.DataTable) {
      setTimeout(maybeDrawChart, 2000);
      return;
    }
    // DataTable has been defined, so now we can proceed to draw the chart.
    ....
  }
  setTimeout(maybeDrawChart, 1000);

On Wed, Jul 29, 2020 at 7:43 AM alex2196 <[email protected]>
wrote:

> Hi Daniel,
> Thanks....
>
> actually i'm using angularjs in php to load the google visualization
> charts, and the whole code was working from years by now and suddenly error
> popped up.
>
> due to angular js i have never used google callback command.
>
>
> On Tuesday, July 28, 2020 at 7:48:05 PM UTC+5:30, Daniel LaLiberte wrote:
>>
>> Hi Alex,
>>
>> Since you are calling your loadChart independent of whether google.load
>> is done loading, then sometimes it won't be done.  You need to use one of
>> the callback mechanisms documented here:
>> https://developers.google.com/chart/interactive/docs/basic_load_libs#callback
>>
>>
>> Also, please switch to using the new loader, also documented in that same
>> page.
>>
>> On Tue, Jul 28, 2020 at 3:50 AM alex2196 <[email protected]> wrote:
>>
>>> Till 27th july 2020, code was working file. (more than 2 years)
>>> suddenly it started giving the above error randomly.
>>> More than 50% i'm getting above error,
>>> but sometimes code work totally fine , chart and tables loads up
>>> properly and no error...
>>>
>>> can anyone help me please...
>>>
>>> <script type="text/javascript" src="https://www.google.com/jsapi
>>> "></script>
>>>
>>> <script type="text/javascript">
>>>     google.load('visualization', '1.1', {packages: ['corechart',
>>> 'table']});
>>> </script>
>>>
>>>
>>>  $scope.loadChart = function (gdata) {
>>>             var data = new google.visualization.DataTable();
>>>             data.addColumn('datetime', 'Date Time');
>>>             data.addColumn({type: 'string', role: 'annotation'});
>>>             var datatype = 'number';
>>>             var ColLength = gdata[0].length;
>>>             var fullLength = gdata.length;
>>>
>>> ...
>>> ...
>>>
>>> ...
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Visualization API" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-visualization-api/fb37b6a6-1b30-4994-9985-7b0e87881bafo%40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-visualization-api/fb37b6a6-1b30-4994-9985-7b0e87881bafo%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
>> [email protected]   Cambridge MA
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/0dbb7c60-1581-43d8-be76-8fd523f42b4bo%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/0dbb7c60-1581-43d8-be76-8fd523f42b4bo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   Cambridge MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJPfUArYpUYaaOgW1cb%2BJcgJ9kB7uJxNCPFncx1ZLMuX3A%40mail.gmail.com.

Reply via email to