Using Specific Colors for Specific Cells in Pie Chart

18 views
Skip to first unread message

Seth Nickell

unread,
Aug 26, 2011, 9:32:58 AM8/26/11
to google-visua...@googlegroups.com
I have three pie charts on the same page with overlapping but not identical labels for the rows. e.g. say chart one has "china, india, nepal, germany", chart two has "germany, india, cuba, latvia", chart three has "china, germany, canada, mexico".

My problem is that the colors for the same "label" aren't the same between charts on the same page, e.g. Germany is red in chart 1, blue in chart 2, and pink in chart 3. I want a country to always be the same color on this page. Is there a way to specify this? Maybe I can make a single chart object with a single legend that contains three charts?

Its important enough I'd be happy to specifically set colors for each color myself manually, but I can't find a way to do this!

asgallant

unread,
Aug 26, 2011, 11:45:56 AM8/26/11
to google-visua...@googlegroups.com
You can specify the colors by setting the 'colors' option (http://code.google.com/apis/chart/interactive/docs/gallery/piechart.html#Configuration_Options).  It takes an array of HTML color strings, with each element in the array corresponding to the same numbered row (the first element colors the first row, the second colors the second row, etc).
Reply all
Reply to author
Forward
0 new messages