Pie chart: pie slice text poor positioning in Chrome

1,541 views
Skip to first unread message

Robert Roberts

unread,
Dec 13, 2013, 2:29:41 PM12/13/13
to google-visua...@googlegroups.com
In Chrome, if you take a look at the piechart page ( https://developers.google.com/chart/interactive/docs/gallery/piechart ) the numbers and text are placed poorly, often off of the slice on the larger slices. "German" becomes "Ger" and "45%" becomes "45". When I load this page in Firefox and Safari, this is not an issue.

I like using google visualization charts but for now in chrome my only solution is to just hide the pie slice string. Changing the font size or style doesn't help and I don't see a way through the API to change their positioning.

Chrome is up to date: Version 31.0.1650.63

Daniel LaLiberte

unread,
Dec 13, 2013, 2:41:49 PM12/13/13
to google-visua...@googlegroups.com
Thanks Robert.  This is due to a known bug in chrome starting with v31, and will be fixed in a subsequent version.  We don't have any workaround in the meantime.


--
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/groups/opt_out.



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

asgallant

unread,
Dec 13, 2013, 2:45:00 PM12/13/13
to google-visua...@googlegroups.com
This is due to a bug in Chrome itself, not a bug in the Visualization API.  As I understand it, the Chrome developers are aware of the problem and have a fix scheduled to be released "soon".

Vaughn Hagerty

unread,
Dec 18, 2013, 2:45:06 PM12/18/13
to google-visua...@googlegroups.com
I ran into this same thing. If you can figure out how to isolate the offending text node, you can nudge it over. Here's an example of what I did (I had just a simple pie chart with two slices:

            if(window.navigator.appVersion.match(/Chrome\/(31.*?) /)) { // fix for chrome v31
                var pie_text = jQuery('#all-receivers-pie-chart g text');
                var chrome_fix = jQuery(pie_text[1]).attr('x') - 30; //it's the second one causing the problem, move it to the left 30px
                jQuery(pie_text[1]).attr('x',chrome_fix); 
            }


On Friday, December 13, 2013 2:29:41 PM UTC-5, Robert Roberts wrote:

Lakshmi v s

unread,
Jan 14, 2014, 5:18:01 AM1/14/14
to google-visua...@googlegroups.com
Thank you for the fix. I put the piece of code in window.load function and was working. But the pie slice text goes back to the original position on hovering (when 'enableInteractivity' is set)

Rishabh Kesarwani

unread,
Nov 23, 2017, 2:51:07 AM11/23/17
to Google Visualization API
Hi! I'm encountering the same problem, though I'm using the latest version of Chrome, i.e., Version 62.0.3202.94. And I'm encountering this problem across all the browsers. Please give any workaround, if possible. Thank you.
Reply all
Reply to author
Forward
0 new messages