'colors' is the config option you need: an array of colours for each range

options={{
  allowHtml: true,
  colors: ['green','purple'],
  tooltip: { isHtml: true },
  timeline: {
    colorByRowLabel: false,
    bar: { groupWidth: '10px' },
    barLabelStyle: *{ fontSize: 12, color: '#fff' }*,
    showRowLabels: false
  },
  hAxis: {
    format: 'h a'
  }
}}

Or, you can apply colours in the actual chart dataset:

e.g.

var data = google.visualization.arrayToDataTable([ 
 ['Element', 'Density', *{ role: 'style' }*],
 ['Copper', 8.94, *'#b87333'*], // RGB value
 ['Silver', 10.49, *'silver'*], // English color name
 ['Gold', 19.30, *'gold'*],
 ['Platinum', 21.45, *'color: #e5e4e2'* ], // CSS-style declaration 
]);

On Thursday, 17 November 2022 at 23:46:00 UTC+11 sourav....@unthinkable.co 
wrote:

> I am trying to give default font color to bar labels for Timeline chart. 
> But according to documentation it has only fontName & fontSize: 
> *barLabelStyle: { fontName: 'Garamond', fontSize: 14 } *
>
> Docs 
> <https://developers.google.com/chart/interactive/docs/gallery/timeline#changing-the-fonts>
>  
>
> options={{
> allowHtml: true,
> tooltip: { isHtml: true },
> timeline: {
> colorByRowLabel: false,
> bar: { groupWidth: '10px' },
> barLabelStyle: *{ fontSize: 12, color: '#fff' }*,
> showRowLabels: false
> },
> hAxis: {
> format: 'h a'
> }
> }}
>
> Can anyone provide suggestion for correct approach ? 
>

-- 
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 google-visualization-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/4d1eb9bf-ad13-430e-9a92-40510eef0b4an%40googlegroups.com.

Reply via email to