admin管理员组

文章数量:1392101

Firefox, safari, safari on ios, IE, ... all of them behave the same way.

no matter what I do, this error is only avoidable on the chrome browser.

Note that it is not a date formatting issue as I use

var rows = [
    [new Date(Date.UTC(x,y,z,...)), ...],
    ...
  ];
var table = new google.visualization.DataTable();
table.addColumn('datetime', 'Time');
table.addColumn(...);
...
table.addRows(rows);

i've done

<script type="text/javascript" src="={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>

as per

and i've done

<script type="text/javascript" src=""></script>
<script>
  var googleChartLoaded = false;
  google.load('visualization', '1', {packages: ['corechart'], callback: function() {
    googleChartLoaded = true;
  }});
</script>

and even

<script type="text/javascript" src=""></script>
<script>
  google.load('visualization', '1', {packages: ['corechart']});
  google.setOnLoadCallback(function() {
    googleChartLoaded = true;
  });
</script>

I have tried as per /

window.setTimeout(function() {
  try {chart.draw(table, chartOptions);}catch(err) {
    console.err(err);
  }
}, 1000);

our issue is identical to

how do I go about diagnosing this issue... I assumed a google product would of been cross-browser patible...

Firefox, safari, safari on ios, IE, ... all of them behave the same way.

no matter what I do, this error is only avoidable on the chrome browser.

Note that it is not a date formatting issue as I use

var rows = [
    [new Date(Date.UTC(x,y,z,...)), ...],
    ...
  ];
var table = new google.visualization.DataTable();
table.addColumn('datetime', 'Time');
table.addColumn(...);
...
table.addRows(rows);

i've done

<script type="text/javascript" src="https://www.google./jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>

as per https://stackoverflow./a/29777575/3338098

and i've done

<script type="text/javascript" src="https://www.google./jsapi"></script>
<script>
  var googleChartLoaded = false;
  google.load('visualization', '1', {packages: ['corechart'], callback: function() {
    googleChartLoaded = true;
  }});
</script>

and even

<script type="text/javascript" src="https://www.google./jsapi"></script>
<script>
  google.load('visualization', '1', {packages: ['corechart']});
  google.setOnLoadCallback(function() {
    googleChartLoaded = true;
  });
</script>

I have tried as per https://nealpoole./blog/2010/07/jquery-getjson-firefox-and-google-visualization-madness/

window.setTimeout(function() {
  try {chart.draw(table, chartOptions);}catch(err) {
    console.err(err);
  }
}, 1000);

our issue is identical to https://developer.appcelerator./question/148481/how-i-make-line-graph-on-android-device

how do I go about diagnosing this issue... I assumed a google product would of been cross-browser patible...

Share Improve this question edited May 23, 2017 at 10:30 CommunityBot 11 silver badge asked May 18, 2015 at 19:26 user3338098user3338098 8741 gold badge18 silver badges41 bronze badges 2
  • I ended up not using Google Charts API for obvious reasons and I am now using flotcharts without any plaint. – user3338098 Commented Jun 1, 2015 at 14:36
  • I am not sure reason of this error. But it is due to "new Date()". I got this error when calling new Date() but does not found the solution for it. – Tom Commented Jul 8, 2015 at 9:58
Add a ment  | 

3 Answers 3

Reset to default 3

I had the same issue with exact this error message. Here, the issue is with options object that is passed to draw function.

In my case, I had two options : vAxis.ticks and hAxis.viewWindow The documentation says these options are only for continuous axis and my axes were continuous. However these were the problem. I took them out, and its working perfectly.

I had the same issue when by mistake the data on xAxis was wrong:

2015-12-22T01:10:02,1 2015-12-22:01:15:01,1

My script saving the values because of my mistake was using : instead of T on the date string.

Fixing the value to YYYYMMDDTHH:MM:SS solved my issue

I don't know if you've managed this problem or used something else, but I had the same problem and solved it by using this "new Date()" formatting that is proper to google charts :

new Date(Year, Month, Day, Hours, Minutes, Seconds, Milliseconds)

Try declaring your date this way and see if it solves your error.

本文标签: javascriptgoogle charts quotis not a functionquot in every browser except chromeStack Overflow