Le mardi 7 août 2012 15:31:21 UTC, Lumière a écrit :
>
> Hi guys,
> I'm looking for a way to have different colors on a bar chart, based on 
> the values.
>
> I have something like this : 
>
>         for(var i=0; i<table.length;i++){
>             colors[i]=new Object();
>             if (table[i][1]<=300){
>                 colors[i].color='blue';
>             }
>             else if (table[i][1]<=800){
>                 colors[i].color='yellow';
>             }
>             else{
>                 colors[i].color='red';
>             }
>         alert(colors[i].color);
>         }
>
> So "colors" is an array of objects, and every object has a color field. 
> Then I do this :
>
>         var options = { series: colors};
>

I also  tried this:
       colors: ['black','blue','white','blue','blue','blue','blue']


But none of the above work. Can anyone please help me do it?
>
> Thanks.
>
>

-- 
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/-/qgPe6L1zTuQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to