Using the "colors" option is not the best approach, as the process for 
setting this option correctly to get the colors you want is rather complex. 
 A much simpler way to do this is to use a "style" role column that has the 
desired color for the bar listed directly in it, eg:

var data = google.visualization.arrayToDataTable([
    ['Category', 'Name', {role: 'style'}, 'Start', 'End'],
    ['Foo', 'Cad', '#a23c7a', new Date(2014, 7, 1), new Date(2014, 7, 5)],
    ['Foo', 'Qud', '#40a67d', new Date(2014, 7, 3), new Date(2014, 7, 4)],
    ['Bar', 'Fiz', '#5581b4', new Date(2014, 7, 2), new Date(2014, 7, 9)]
]);

see example: http://jsfiddle.net/asgallant/qgo310pc/1/

On Thursday, September 4, 2014 4:11:36 AM UTC-4, Ákos Kovács wrote:
>
> I have a timeline with a lot of rows and in each rows are several 
> timesheets. 
>
> I would like to fix for each timesheet an exact color, so one type of 
> timesheet will have same color in every row.
>
> I am using this code: 
>
> var options = { colors: ['#0C14F2', '#114C9E', '#ee8800', '#F6FF00'], 
> timeline: { showBarLabels: false, avoidOverlappingGridLines: false }, 
> backgroundColor: '#f8f8ff' };
>
> This code changes the colors seemly randomly of timesheets.
>

-- 
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/d/optout.

Reply via email to