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
3 Answers
Reset to default 3I 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
版权声明:本文标题:javascript - google charts "is not a function" in every browser except chrome - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744779899a2624644.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论