Google chart is "not a feature" in every browser except chrome

a [jc] is not a function

Firefox, safari, ios safari, IE, ... they all behave the same.

no matter what I do, this error can only be avoided in Chrome browser.

Please note that this is not a date formatting issue as I am using

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 did

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

      

according to stackoverflow question/1582973 / ...

and i did

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

      

I've tried like https://nealpoole.com/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 problem is identical https://developer.appcelerator.com/question/148481/how-i-make-line-graph-on-android-device

how do I start diagnosing this problem ... I assumed the google product would be cross-browser compatible ...

+3


source to share


3 answers


I had the same problem with the exact error message. The problem here is with the object options

being passed to the function draw

.



In my case, I had two options: vAxis.ticks

and hAxis.viewWindow

The documentation states that these options are for continuous axis only, and my axes are continuous. However, this was a problem. I pulled them out and worked great.

+1


source


I had the same problem where the xAxis data was wrong by mistake:

2015-12-22T01: 10: 02.1 2015-12-22: 01: 15: 01.1



My script, while storing the values ​​due to my mistake, used: instead of T in the date string.

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

0


source


I don't know if this worked or if I used something else, but I had the same problem and solved it with this "new Date ()" formatting, which is fine for google charts:

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

      

Try to declare your date this way and see if it resolves your error.

0


source







All Articles