pie chart legend position issues

1,619 views
Skip to first unread message

cabennett85

unread,
Nov 28, 2011, 3:20:20 PM11/28/11
to Google Visualization API
I'm trying to position the legend to the right of the pie chart but
also have it vertically centered relative to the pie chart. Right now
I set legend: 'right' and the legend is placed at the top right of the
container which looks odd. Is there a way to align it vertically with
the pie?

Also, when I set the legend: 'in', the legend doesn't show up. Has
anybody used this option and gotten it to work?

Roni Biran

unread,
Nov 29, 2011, 2:48:10 AM11/29/11
to google-visua...@googlegroups.com
The legend is placed at the top since it is lengthen when you have lots of items, so aligning it to the center of the pie does not look good. In addition it automatically adds a legend pager when your legend is too long for display in your chart.
As for the 'in' option, I don't really know what it does.




--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
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.


asgallant

unread,
Nov 29, 2011, 11:45:59 AM11/29/11
to google-visua...@googlegroups.com
The legend 'in' option is supposed to put the legend inside the chartArea, but the few times I experimented with it, it never looked good.  It is possible that this is broken in Pie Charts.

visigoth

unread,
Nov 29, 2011, 12:11:12 PM11/29/11
to google-visua...@googlegroups.com
Folding the title or the legend inside is something that makes sense in a chart with axes, not so much in a Pie chart.
I'll double check, but this seems to me like a mistake in the documentation.

If you feel that having the title/legend on top of the pie can prove useful, feel free to open a feature request.

Visigoth

cabennett85

unread,
Nov 30, 2011, 1:23:09 PM11/30/11
to Google Visualization API
Yea that makes sense. The problem I'm having though is with a short
list of items, say 3 or 4, most of the items are above the pie which
makes them look misaligned. It would be nice to be able to do
something similar to a vertical-align: center; in css. so that the
center of the pie aligns with the center of legend.

Just some thoughts...or if anybody has a way to make this chart
actually do this? Thanks!

visigoth

unread,
Dec 5, 2011, 3:11:59 AM12/5/11
to google-visua...@googlegroups.com
I'm afraid this cannot currently be done from within the chart.
You can set the legend to 'none' and write your own outside the chart (note that this will not enable you to set the focus on a slice when you hover over its corresponding legend entry).
Reply all
Reply to author
Forward
0 new messages