title: Setting specific colors in google charts
body: <p>I have Google visualization where I want to set the specific colors of each pie slice/bar based on a column in the datatable.</p>
  
  <p>i.e. I have a table of the number of people who voted for their favorite color:</p>
  
  <pre><code>*Input table*
  id  Color   Num Votes
  1  'Red'    10
  2  'Blue'   100
  3  'Green'  50
  </code></pre>
  
  <p>How do I set the colors on the pie chart so that the slice for 'Red' is colored red, etc? However, due to the data set, I cannot guarantee that the rows will be in a certain order so cannot create an array of colors.</p>
  
  <p>I think I need to use a formatter, but cannot get it to work.</p>
  
  <pre><code> var formatter = new google.visualization.ColorFormat();
   formatter.addRange('Blue', 'Blue', 'blue', 'blue');
   formatter.format(data, 1);
  </code></pre>
  
  <p>Thanks in advance</p>