Cannot read property 'bottom' of undefined

654 views
Skip to first unread message

David Schmidt

unread,
Sep 24, 2015, 4:54:23 AM9/24/15
to Google Visualization API
Since yesterday I have a problem with pie charts, I can't figure why it's happening.

I use several charts to visualize my Google Fit activity at https://individual8.com/about/activity
Pie Charts are the only one not working.


Daniel LaLiberte

unread,
Sep 24, 2015, 9:39:54 AM9/24/15
to Google Visualization API
Hi David,

This appears to be a problem with the labeled legend feature.  If you turn that off, I bet your chart will at least work again.  

If the only thing that changed is your data, then it would be good to grab a copy of the data that causes this problem.  I tried to reproduce the problem using your data and options here:  http://jsfiddle.net/dlaliberte/zwfykqap/ but it works fine in this situation.

Ah, I see the problem.  The property 'shuffle' has been added to the Array prototype, and that causes confusion in the labeled legend code when iterating over the properties of an array.  The addition of the 'shuffle' property appears to be happening in https://individual8.com/min/g=js perhaps as an update to that code.  Modifying the prototype of Array or other classes in the JavaScript environment is generally considered a bad practice.  Though it is possible for us to work around such problems (and we will probably do that), more problems similar to this are likely to arise.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/6ae74a5e-064c-4823-97ce-47085857cdba%40googlegroups.com.
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

David Schmidt

unread,
Sep 24, 2015, 9:48:06 AM9/24/15
to Google Visualization API
Wow, Daniel. I'd have never even thought about adding that prototype function caused the problem. I know made the shuffle function independent from the Array prototype and everything's working again the way intended.

Thx for that insight. And for the solution. Pies are working for me again.

Best David
Reply all
Reply to author
Forward
0 new messages