3D Piecharts Label bug: missing labels on certain percentages

74 views
Skip to first unread message

Kasper

unread,
Mar 6, 2012, 3:47:09 AM3/6/12
to google-visua...@googlegroups.com
Hi,
I am using the piecharts from the visualisation API, using the 3D option, to create something like this:







Though, like you can see, the labels are missing on the left area.
This occurs on multiple percentages, like 38 percent, which is really weird.

The percentages in my example are: 45.89 vs 54.11, 6.5 vs 93.5 and 24.2 vs 76.8

Is there a way to fix this?

Viz Kid

unread,
Mar 7, 2012, 12:26:12 PM3/7/12
to google-visua...@googlegroups.com

Can you give us the exact options you pass into the chart? (and the size if it is not passed in the options).
The label of a slice should be located in the middle of the arc of that slice and I assume that in these examples there is simply not enough space, given the relatively large font size.

  Viz Kid

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/KvEpcNussjwJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Kasper

unread,
Mar 8, 2012, 2:16:04 AM3/8/12
to google-visua...@googlegroups.com
Yes, you can see a working example here:
http://test.lyxdesign.nl/chart-mockup.html

The options I pass:

<input id="variables-piechart-1-data-value1" type="hidden" value="45.8944" />
<input id="variables-piechart-1-data-value2" type="hidden" value="54.1056" />
<input id="variables-piechart-2-data-value1" type="hidden" value="44.1667" />
<input id="variables-piechart-2-data-value2" type="hidden" value="637.8333" />
<input id="variables-piechart-3-data-value1" type="hidden" value="3882.5" />
<input id="variables-piechart-3-data-value2" type="hidden" value="12837.5" />

and in javascript:
	   'width': 146,
	   'height': 130,
	   'chartArea': {left:0, top:0, width:'100%', height:'100%'},
	   'legend': {position: 'none'},
	   'fontSize': '12px',
	   'slices': [{textStyle: {color:'#ededef', fontSize: '16'}}, {textStyle: {color:'#999a9e', fontSize: '16'}}],
	   'is3D': true,
	   'colors':['#999a9e', '#ededef', '#7d7e82', '#d1d2d4'],
	   'tooltip': {trigger: 'none'}
   };
 
Fontsize could play a role here, but when the left chart has 46 or 45 percent, it will show the label... which is weird, right?

asgallant

unread,
Mar 8, 2012, 8:53:47 AM3/8/12
to google-visua...@googlegroups.com
I hesitate to call this a bug, because it is probably doing exactly what the developers intended it to do (hide the labels when they don't quite fit correctly); the problem is that fontSize 16 is very large in proportion to the total size of the charts, so with the labels in the default positions, they don't quite fit right.  The solution would be to change the default position of the labels (probably depending on slice size, position, and label size), but that isn't anything we can control.

Kasper

unread,
Apr 25, 2012, 2:25:49 AM4/25/12
to google-visua...@googlegroups.com
I see, the font is indeed pretty big. Though it should/could fit in the shape.
Thanks though
Sorry for the late reply.

Op donderdag 8 maart 2012 14:53:47 UTC+1 schreef asgallant het volgende:
Reply all
Reply to author
Forward
0 new messages