Open orwant opened 9 years ago
This is a problem with Table Chart
Original issue reported on code.google.com by erik.m.hoffman
on 2015-02-19 15:26:34
I have a similar issue. My ColumnChart uses a DataView as its data source which returns
a 'g is undefined' message in Firefox. If I revert to using the underlying DataTable
(used in the constructor of the DataView) the ColumnChart will load fine.
Original issue reported on code.google.com by chrissloan247
on 2015-02-19 16:18:49
Chris, your problem appears from the symptoms to be very different. Could you post a
link to your page, or reproduce a minimal case (e.g. with jsfiddle). Thanks.
We are rolling back the v41 change, but please test by loading 1.1 so we can be sure
that we fix your problems before the next version we roll out.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-19 16:23:43
Thanks for getting back to me. My simplified version I was building on
JSFiddle has resolved what ever the problem was.
So now I guess I need to go back through what was removed to make the
simpler example and work out what causes the issue.
On 19 February 2015 at 16:23, <
google-visualization-api-issues@googlecode.com> wrote:
Original issue reported on code.google.com by chrissloan247
on 2015-02-19 17:17:17
when are you rolling back the version. I was able to fix the problem by changing the
width. But does not solve all my problems. One the site there are a few too many
places to change.
Original issue reported on code.google.com by erik.m.hoffman
on 2015-02-19 17:24:22
The rollback is in progress. Just FYI, the change has been submitted, but then it goes
through a deployment process that could take 4 or more hours before it succeeds.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-19 17:27:45
So I have managed to pinpoint my issue directly to the following setting
animation: {
startup: true,
duration: 1000,
easing: 'in'
},
When loading the chart with the DataView and this setting present in the options the
chart returns g is undefined.
Removing this option and loading with the DataView loads the chart fine.
Using the DataTable and the animation the chart loads - and animates.
Removing the animation option obviously stops the animation as expected.
It therefore appears that the animation option causes the DataView class to fail somehow.
Hope this helps.
Original issue reported on code.google.com by chrissloan247
on 2015-02-19 17:33:28
We are using the google visualization api to display the grid in one of the application.
It was working fine till yesterday and it stopped working since morning. Is there any
change happened last night? Can you please brief about the change?
We are getting "Object doesn't support property or method 'querySelector'"? Any advice
on this?
Original issue reported on code.google.com by arunprasath.ramachandran
on 2015-02-19 18:54:39
Some users using IE are getting the "Object doesn't support property or method 'querySelector'"
error.
Where can we find updates? I only saw that a update on October of last year listed....
Original issue reported on code.google.com by erik.m.hoffman
on 2015-02-19 19:00:04
Chris,
The startup animation is a new feature, and could well be broken in situations we have
not anticipated. I do see a problem with using a DataView which doesn't occur without
the DataView, but I get a different error than you did though probably for the same
reason. So thanks for reporting this.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-19 19:00:56
The querySelector problem will be fixed in the next candidate release. We are rolling
back the broke version now.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-19 19:12:34
Thank you, When will the rollback gets completed? Any ETA to my users?
Original issue reported on code.google.com by arunprasath.ramachandran
on 2015-02-19 19:24:59
The querySelector issue has been resolved but tables are still not displaying as they
did 2 days ago. Was there a complete rollback or select portions?
Original issue reported on code.google.com by jimintheberkshires
on 2015-02-20 11:12:45
Our charts are still not working correctly after the rollback. Please advise on whether
a full rollback will be done or if we should start looking for alternatives to fix
the problem on our end.
Original issue reported on code.google.com by Vectorl33t2
on 2015-02-20 14:27:58
The rollback actually failed, so we applied several fixes instead which are now live
if you load "1.0" (not yet in "1.1"). Table changes were not part of those fixes since
we didn't have enough evidence of what needed to be fixed or how to fix it.
The table chart element and css have changed, so if you have local css that relied
on the internal css, you will have to update that accordingly, or better, use the cssClassNames
option so your custom classes will be used.
Please provide a link to a page that shows the behavior you are seeing so we can look
into it and hopefully find a fix or suggest work arounds.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-20 14:34:19
It's an internal page with highly sensitive data so unfortunately sharing the page is
not an option. The code is as follows:
var chartData = {DATA_PAIRS};
google.setOnLoadCallback(function () {
google.load('visualization', '1', { 'packages': ['corechart'], 'callback': function
() {
chart.render(chartData);
}});
});
function SalesByPeriodChart(domId, color, loadingContent) {
this.domId = domId;
this.color = color;
this.loadingContent = loadingContent;
}
SalesByPeriodChart.prototype.render = function (responseObj) {
var data = responseObj.data;
var total = responseObj.total;
var chart = new google.visualization.LineChart(document.getElementById(this.domId));
var chartData = new google.visualization.DataTable({
cols: [
{id: 'date', label: 'Date', type: 'string'},
{id: 'amount', label: 'Sales', type: 'number'}
],
rows: data
});
var dataView = new google.visualization.DataView(chartData);
dataView.setColumns([
{
calc: function (data, row) {
return data.getFormattedValue(row, 0);
},
type: 'string'},
1
]);
var options = {
colors: [this.color],
legend: { position: "none" },
pointSize: 5,
title: 'Sales by Period: ' + total,
titleTextStyle: { fontSize: 16 },
hAxis: {
slantedText: false,
format: 'MMM `yy'
},
backgroundColor: { fill: 'transparent' }
};
chart.draw(chartData, options);
};
SalesByPeriodChart.prototype.loading = function (state) {
var loadingDom = this.getLoadingDom();
if (state) {
if (loadingDom != null) {
loadingDom.style.display = "";
} else {
var loadingDom = document.createElement("div");
loadingDom.id = this.getLoadingId();
loadingDom.className = "loading";
loadingDom.innerHTML = this.loadingContent;
document.getElementById(this.domId).appendChild(loadingDom);
}
} else if (loadingDom != null) {
loadingDom.style.display = "none";
}
};
SalesByPeriodChart.prototype.getLoadingDom = function () {
return document.getElementById(this.getLoadingId());
};
SalesByPeriodChart.prototype.getLoadingId = function () {
return this.domId + "_loading";
};
Original issue reported on code.google.com by Vectorl33t2
on 2015-02-20 14:45:48
If there was someway for me to email you, or you to email me, I could give you the page
url with the credentials for a demo account where you could see that error. Unfortunately
I don't feel comfortable posting it on the thread, nor can I get to your email address
as there are just dots.
vectorl33t2@gmail.com
Original issue reported on code.google.com by Vectorl33t2
on 2015-02-20 15:14:33
Hi Vector, the email of the original poster is dlaliberte <at> google.com. Please link
him to your page so that we can figure out the issues =)
Original issue reported on code.google.com by grabks@google.com
on 2015-02-20 15:50:37
I'll leave this on the other thread I'm in as well, thanks to dlalibe...@google.com
for reaching out and diagnosing the problem.
Turns out, we had another legacy library that had an implementation of Array.prototype.filter
defined there, so that the charts would not work correctly when it also used our incorrect
implementation of Array.prototype.filter.
Simply removing the defined method fixed the problem, our charts load, and turns out
we only implemented that method for legacy browsers which we no longer support.
Figured it might save somebody else some time to know about this, as I was unaware.
Original issue reported on code.google.com by Vectorl33t2
on 2015-02-20 18:28:41
I have a similar problem with Table chart that uses a dataview as data source. It worked
fine until a few days ago. Now the table chart simply does not display. It uses the
v1.0 library.
Original issue reported on code.google.com by arbeiv
on 2015-02-23 19:14:34
arbeiv, can you link us to a page showing the problem you are seeing?
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-24 14:56:20
Hi dlalibe,
I resolved my problem by adding height and width parameters in the Table chart options.
Before I only passed data to the Table chart drawing method [i.e, table.draw(data)],
and it worked fine. Now it seems that height and width options need to be specified
explicitly in the options to draw the Table chart [i.e, table.draw(data, options)].
Original issue reported on code.google.com by arbeiv
on 2015-02-24 17:58:03
I'm suddenly getting this issue too on any chart that uses a DataView. I get this error
on all charts:
Unable to get property '1' of undefined or null reference
Tried it in IE and Chrome. Here's the script for a BarChart. If I pass the data over
as a DataView, I get this error. If I pass it as a DataTable, it displays fine. But,
this was again all working fine a last week, and now nothing with a DataView works
correctly when nothing was changed.
var data = google.visualization.arrayToDataTable([
['Week', 'New Desktop (D)', 'New Mobile (M)', 'Mail Opt-Ins (D)', 'Mail Opt-Ins (M)','eMail
Opt-Ins (D)','eMail Opt-Ins (M)', 'Unique Opt-ins (D)', 'Unique Opt-ins (M)', 'Dual
Opt-Ins (D)', 'Dual Opt-Ins (M)', 'Snus User Regs (D)', 'Snus User Regs (M)', 'Primary
User (D)', 'Primary User (M)']
,['W 1', 42, 40, 17, 18, 21, 33, 26, 34, 12, 17, 33, 0.83, 25, 22]
,['W 2', 63, 48, 38, 33, 39, 36, 49, 44, 28, 25, 43, 0.75, 24, 22]
,['W 3', 63, 36, 30, 16, 45, 16, 50, 21, 25, 11, 51, 0.44, 23, 15]
,['W 4', 81, 46, 30, 31, 55, 34, 62, 42, 23, 23, 65, 0.74, 42, 20]
]);
var view = new google.visualization.DataView(data);
view.setColumns([0, 1, { calc: "stringify",sourceColumn: 1,type: "string",role: "annotation"
},
2, { calc: "stringify",sourceColumn: 2,type: "string",role: "annotation" },
3, { calc: "stringify",sourceColumn: 3,type: "string",role: "annotation" },
4, { calc: "stringify",sourceColumn: 4,type: "string",role: "annotation" },
5, { calc: "stringify",sourceColumn: 5,type: "string",role: "annotation" },
6, { calc: "stringify",sourceColumn: 6,type: "string",role: "annotation" },
7, { calc: "stringify",sourceColumn: 7,type: "string",role: "annotation" },
8, { calc: "stringify",sourceColumn: 8,type: "string",role: "annotation" },
9, { calc: "stringify",sourceColumn: 9,type: "string",role: "annotation" },
10, { calc: "stringify",sourceColumn: 10,type: "string",role: "annotation" },
11, { calc: "stringify",sourceColumn: 11,type: "string",role: "annotation" },
12, { calc: "stringify",sourceColumn: 12,type: "string",role: "annotation" },
13, { calc: "stringify",sourceColumn: 13,type: "string",role: "annotation" },
14, { calc: "stringify",sourceColumn: 14,type: "string",role: "annotation" }]);
// Set chart options
var options = {
title: 'Registrations', width: 500, height: 850,
bar: {groupWidth: "95%"},
chartArea: {left:40,top:50,width:'65%',height:'90%'},
animation: { duration: 2000, startup: true }
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.BarChart(document.getElementById('chartRegistrations'));
chart.draw(view, options);
Original issue reported on code.google.com by harold.blackorby@rivetglobal.com
on 2015-02-24 21:35:36
I've narrowed the issue down further. I can use DataViews as long as I turn off animation.
If I set Animation to be true, then every chart no matter the chart type displays:
"Unable to get property '1' of undefined or null reference" instead of a chart.
Original issue reported on code.google.com by harold.blackorby@rivetglobal.com
on 2015-02-24 22:05:57
You are correct Harold. And more specifically, it is the startup animation that doesn't
work yet with DataViews. We should be able to fix this for the next release.
Original issue reported on code.google.com by dlaliberte@google.com
on 2015-02-24 22:54:56
Thanks for the info. At the least, it should degrade better so as to show the chart
but just not animate. But, thanks.
Original issue reported on code.google.com by harold.blackorby@rivetglobal.com
on 2015-02-24 23:40:41
I fixed this issue by override the margin $(".google-visualization-table").css("margin-top",
"-1px");
Original issue reported on code.google.com by emadaldeen.hajjar
on 2015-03-01 20:57:23
Hi.
I have used this google visualization API charts. Line charts,bar charts and pie chart.
I have given data to above charts by using datatable. Now I think google API is not
loading and because of that I am getting no charts on the page. Also giving datatable
is null error. Please find the solution for this urgently.
Original issue reported on code.google.com by Rohan@headfitted.com
on 2015-03-25 10:09:34
It appears that the JS fiddle code provided in the google documetnation charts is not
consistent with the sample code in the google documentation.
And the one in JS fiddle is the one that is working, ( had to make some changes to
my code to get it working again)
regards
Original issue reported on code.google.com by patozgg
on 2015-04-17 20:08:02
I bumped against the same issue. Is there no workaround in v1 to use a animation with a DataView?
This is fixed if you load 1.1, but if you have to use version 1 (which is v41 now), then the best workaround is to create a new DataTable from the DataView using toDataTable().
I also tried 1.1 but still doesn't work. Note I use a BarChart
As soon as I add startup: true to the animation config the chart breaks.
Marcel,
The startup animation is new and different from other animation. We don't know of any problems animating the BarChart, so if you could post enough code and data to reproduce the problem, that would help us debug it. A jsfiddle would be best. Thanks.
Original issue reported on code.google.com by
erik.m.hoffman
on 2015-02-19 15:25:30