The ideal thing to do would be to use the new "style" column role to control slice colors, but it doesn't seem to be implemented for PieCharts.
I suggest adding a column to your DataTable for slice color, and building the "colors" option or "slices" option appropriately for each chart when the table is sorted. Here's one example of how you might do it: http://jsfiddle.net/asgallant/bRkU2/ On Wednesday, December 18, 2013 11:57:06 PM UTC-5, Graham Polley wrote: > > Hi All, > > I have two pie charts each with a corresponding table (using a dashboard). > Each table/chart has the the labels/domains e.g. "foo" and "bar". > > Because the data set behind each one is different and sorted we end up > with different ordering e.g: > > e.g. > > *Table/Graph A* > > > > *Foo : 10* > *Bar : 9* > > > ...which draws the pie chart as "foo" blue and "bar" as red > > *Table/Graph B* > > *Bar : 100* > *Foo : 99* > > > ...which draws the pie chart as "foo" red and "bar" as blue > > What we need is for "foo" and "bar" to always be graphed with the same > color. I've checked the API and it's possible to set the slices based on > the index/series but the problem is of course it is different for each > graph i.e. > > slices: {0: {color: 'blue'}, 1: {color: 'red'}} > > Is it possible to always assign the same color to a label/domain or am I > missing something obvious? > > Thanks, > Graham > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/groups/opt_out.
