Why do you create a  single string for all the colors? The 'colors' option
of LineChart expects an array of colors (strings).
Did you try to use your variable 'colors' directly in the chart options?

On Mon, Feb 6, 2012 at 11:28 AM, Marc CG <[email protected]> wrote:

> Hello,
> I'm trying to control de line color of a lineChart with javascript. I
> have a variable number of rows, but I need allways the same color for
> each one. I used this code:
>
>            while(j<=i)
>            {
>                if(j!=0)
>                {
>                    string_colors += ",";
>                }
>                string_colors +=colors[j];
>                j++;
>            }
>
>        // Draw the visualization.
>        var data = response.getDataTable();
>        var chart = new
> google.visualization.LineChart(document.getElementById('chart_div'));
>        chart.draw(data, {width: '100%', height: 480, is3D: true,
> hAxis: {showTextEvery: 49}, vAxis: {Title: notacio},
> colors:string_colors});
>
> I have an array with a variable number of colors and, with this I
> create the String which I want to use.
>
> Do you have some ideas about how to do it?
>
> Thanks
>
> Marc
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> 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.
>
>

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