Chrome: Cannot read property 'length' of null

1,242 views
Skip to first unread message

Zdravko Balorda

unread,
Jul 26, 2014, 10:52:55 AM7/26/14
to google-visua...@googlegroups.com
I get this error on rendering a ComboChart in Chrome:
Cannot read property 'length' of null

The same page in FireFox works ok.
Best regards, Zdravko

Andrew Gallant

unread,
Jul 27, 2014, 8:48:09 AM7/27/14
to google-visua...@googlegroups.com
Could you provide a code example that demonstrates the problem?  That error is too generic to point to any specific cause.

Zdravko Balorda

unread,
Jul 27, 2014, 9:03:11 AM7/27/14
to google-visua...@googlegroups.com
Thank you.
In the mean time I solved this issue. The problem was that chart was to
be rendered in a table cell:
<td id="chart"></td>
which caused this error.
The solution is:
<td><div id="chart"></div></td>
Now the chart gets rendered in Chrome, too. All is good.

Regards, Zdravko
> --
> 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/oAmSOcvql1o/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

Message has been deleted

Daniel LaLiberte

unread,
May 4, 2016, 4:13:48 PM5/4/16
to Google Visualization API
Hi Kelly,

The problem you bumped into is actually a bug in the chartArea code regarding the new bottom and right options.  If you use bottom without top, it fails, apparently.  Similarly, if you use right without left, it will fail.  

I am surprised to learn that it works if you specify the value with, e.g. '75px'.  I suspect it is just ignoring the px.

Hope that helps.

On Wed, May 4, 2016 at 3:01 PM, Kelly Close <kelly...@lrewater.com> wrote:
Hopefully this helps others searching for this same fairly generic error.  Much like Zdravko, my cause came down to syntax.

On a site that worked until recently (April, 2016) I had a ComboChart with this included in the options:
               chartArea:{left:85,bottom:75,width:'77%',height:'78%'},

If I comment this out of the chart options, the chart renders, and if I include it I get the error noted in the subject of this thread.

Upon changing to this, it works again:
               chartArea:{left:'85px',bottom:'75px',width:'77%',height:'78%'},

This is the full chart definition, for context (with proper syntax in place):

      var chart_flows6 = new google.visualization.ChartWrapper({
                containerId: 'chart_flows6',
                chartType: 'ComboChart',
                options: {title: 'ARKPUECO Stream Gage - Colors of Water',
                              seriesType:'area',
                              width:'100%',height:320,
                              chartArea:{left:'85px',bottom:'75px',width:'77%',height:'78%'},
                              isStacked:'true', lineWidth:0,
                              series: {0: {type: 'line',lineWidth:1,pointSize:9}}
                             }
                                                                                           }); 

I'm guessing I was using an old syntax that was finally deprecated as of May 2016.

~Kelly

--
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.

For more options, visit https://groups.google.com/d/optout.



--
dlaliberte@Google.com   5CC, Cambridge MA

Kelly Close

unread,
May 4, 2016, 4:24:01 PM5/4/16
to google-visua...@googlegroups.com
Thanks for your reply!  I actually went and deleted my post because I realized I was too hasty in diagnosing the issue, and I eventually realized that only removing the "bottom" spec really fixed it.  

The quoting and using px was a false lead.  I thought it worked because when I changed them to be quoted and include px, the chart rendered.  Thing is, I then noticed my spacing was not being applied at all.  It turns out rather than fixing anything, the new syntax just made those options unreadable and the Chrome browser graciously ignored them.  

I'm really glad to know that if I include a top with the bottom I can still use the bottom spacing option!  Similarly with right and left.  I bet I have some other broken visualizations out there because of one or the other - I'm always futzing over the spacing...it's where my OCD manifests.

Thanks again,

~Kelly

K. Kelly Close, P.E.
Senior Project Manager | Technology Group Lead

Leonard Rice Engineers, Inc.

Office   303-455-9589

Cell      720-307-3728

Web     www.lrewater.com  – new!

 

Click to find us on Facebook, LinkedIn and Google+

 

**CONFIDENTIALITY NOTICE: 
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Thank you.

--
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/oAmSOcvql1o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

Daniel LaLiberte

unread,
May 4, 2016, 4:32:10 PM5/4/16
to Google Visualization API
Thanks for the followup.  I hope to have some time to fix this before the next release.


For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages