Charts stopped working after I cleared cache today, which were earlier working and I also observed API changes especially in DataTable

68 views
Skip to first unread message

Nisarg Panchal

unread,
Feb 23, 2015, 5:29:56 AM2/23/15
to google-visua...@googlegroups.com
Hi,

I have developed a small application to generate graphs for performance monitoring. The graphs were working just fine until last time 18th Feb 2015. Today when I cleared cache and reloaded - the same code no longer works!

I also started getting issues for e.g. I was using a hack data.Pf.length to check how many columns are there in a DataTable since I am programmatically adding columns. But now the same property is changed to DataTable.If (I know we do have getNumberOfColumns() function), but this is just to highlight the issue better.

I am having correct data sets in terms of CSV files but unfortunately all of them are failing :

Cannot read property '1' of undefined


I am not sure where am I going wrong, any guidance related to most recent changes would be great. I even tried addRows with hardcoded scalar data in the required format but that too is giving same issue as above.

Nisarg Panchal

unread,
Feb 23, 2015, 6:09:13 AM2/23/15
to google-visua...@googlegroups.com
To test things I wrote code below for generating a dummy chart but that too is failing:

var data = new google.visualization.DataTable();
data.addColumn('string', 'X');
data.addColumn('number', 'Y');
for(var i=0;i<20;i++){
data.addRow(['tenant'+i, (10+i)]);
}
var view = new google.visualization.DataView(data);
var options = {
title : ' Demo chart',
hAxis: {title: 'X'},
vAxis : { title : "Y" },
animation:{
startup: true,
       duration: 1000,
       easing: 'out',
   },
   pointSize: 5,
   width : 1500,
height : 1200
};
var chart = new google.visualization.LineChart($('#dummy_chart')[0]);
chart.draw(view, options);

Bottomline is, I am using addRow() function to add individual record and it's failing, which was working just fine.

Daniel LaLiberte

unread,
Feb 23, 2015, 10:07:23 AM2/23/15
to google-visua...@googlegroups.com
Hi Nisarg,

First, the obfuscated property names will change each time we do a release, so you should not use them except for a short-term hack that you should expect will be broken again shortly.  

Second, the startup animation is a new feature, and it turns out not to work with DataViews.  So if you just use your data table directly instead, it will work.  See http://jsfiddle.net/dlaliberte/gdo1gsqd/


--
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 google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA
daniel.laliberte@GMail.com 9 Juniper Ridge Road, Acton MA

Nisarg Panchal

unread,
Feb 23, 2015, 9:45:10 PM2/23/15
to google-visua...@googlegroups.com
Thanks Daniel, it was very very helpful. You saved my day. :)


Thanks and Regards

"If the dream is BIG enough, the facts don't count"

-Nisarg Panchal

(+65-9384 3525)

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/5KPENxKr7Wo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages