google / google-visualization-issues

288 stars 35 forks source link

Cannot read property 'getElementsByTagName' of undefined #2510

Open jafsab opened 7 years ago

jafsab commented 7 years ago

I have problem in my dashboard that I have 4 charts (line, pie, geo and calender) evreything was ok, until today, the site give me the error Cannot read property 'getElementsByTagName' of undefined when I remove 3 of them, the fourth is working.

can you help me please? screen shot 2017-06-19 at 12 35 11

dlaliberte commented 7 years ago

Can you point us at your we page so we can see the error?

dvonlehman commented 7 years ago

Experiencing this same issue. The URL is behind a password gate.

NagarajP commented 7 years ago

Hi All, Experiencing the same issue all of sudden. It was working till last week. Not sure the root cause.

dlaliberte commented 7 years ago

Are you guys loading version 'upcoming' ? If so, that would explain the recent change since I announced that 'upcoming' is now version 45.2. If not, please point to an example page that shows the error, or create a small example on jsfiddle so we have a chance of debugging it.

If 'upcoming' is the problem, then you can workaround it temporarily by changing to another version. 'current' will become the same as upcoming soon, but I would like to fix any problems before then.

On Tue, Jun 20, 2017 at 8:53 AM, NagarajP notifications@github.com wrote:

Hi All, Experiencing the same issue all of sudden. It was working till last week. Not sure the root cause.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/google-visualization-issues/issues/2510#issuecomment-309803693, or mute the thread https://github.com/notifications/unsubscribe-auth/AAizDT0h-GxIno7NzdYnOYjqbOGXbbWmks5sF-rvgaJpZM4N9-jp .

-- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 dlaliberte@Google.com dlaliberte@google.com 5CC, Cambridge MA

dvonlehman commented 7 years ago

In my case I discovered I was loading two different chart versions on the page - one 'current' and one 'upcoming'. I changed it so both are 'current' and the error went away. I believe I needed 'upcoming' for the geochart at the time this was originally coded. So must be some incompatibility between what is now "current" and "upcoming". At any rate my issue is resolved.

jafsab commented 7 years ago

Hi, thanks for your answers. http://callcenter.sabahtech.com.tr/index_1.php also I have attached the dashboard php/html fil dashboard_1.php.zip

dlaliberte commented 7 years ago

Jafar,

I stepped through your code, which effectively changes the timing of when things get loaded, and it worked correctly for me without displaying the error about getElementsByTagName. So I would guess there is a timing related issue.

I see that your code draws a linechart and a piechart, but both load the 'corechart' package. Only one load call should actually load the package (and the second should notice that it is already being loaded), but perhaps there is a problem in this case. As a workaround, try eliminating the extra google.charts.load() call.

On Wed, Jun 21, 2017 at 11:21 PM, Jafar Sabah notifications@github.com wrote:

Hi, thanks for your answers. http://callcenter.sabahtech.com.tr/index.php login to the system as (admin/admin) also I have attached the dashboard php/html file

dashboard.php.zip https://github.com/google/google-visualization-issues/files/1093798/dashboard.php.zip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/google-visualization-issues/issues/2510#issuecomment-310287019, or mute the thread https://github.com/notifications/unsubscribe-auth/AAizDQ4onREc1OTZnOZVicFKDqXMeCb7ks5sGgf_gaJpZM4N9-jp .

-- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 dlaliberte@Google.com dlaliberte@google.com 5CC, Cambridge MA

jafsab commented 7 years ago

thanks dlaliberte, it working now the code is working when I remove the second load call. google.charts.load('upcoming', {'packages': ['geochart']});

also it works when I change the upcoming to current.

dlaliberte commented 7 years ago

Ah, I didn't notice that you were trying to use 2 different versions. Yes, that can cause weird problems, at least in 45.1. I believe in future versions, the loader should ignore the version in subsequent load calls, by reusing the first version you specify.

On Thu, Jun 22, 2017 at 1:46 AM, Jafar Sabah notifications@github.com wrote:

thanks dlaliberte, it working now the code is working when I remove the second load call. google.charts.load('upcoming', {'packages': ['geochart']});

also it works when I change the upcoming to current.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/google-visualization-issues/issues/2510#issuecomment-310316883, or mute the thread https://github.com/notifications/unsubscribe-auth/AAizDeD-u_ym_NSGR5QDQzINqtZIHsq5ks5sGinMgaJpZM4N9-jp .

-- Daniel LaLiberte https://plus.google.com/100631381223468223275?prsrc=2 dlaliberte@Google.com dlaliberte@google.com 5CC, Cambridge MA