1
votes

Is there any way to set multiple colors in an axis title in google charts? Through the charts options or jQuery?

For instance, I have this graph: enter image description here

I set the Orange Y-axis title to orange with {title:'Orange', minValue: 0, titleTextStyle:{color: 'orange'}}. I would like to set the other Y-axis title so that green is the color green and blue is the color blue. Seems simple but is it possible?

1
multiple colors are not available via standard config options, you will need to manually change when the chart's 'ready' event fires -- you replace the contents of the <text> elements with multiple <tspan> elements -- here are a couple examples, example 1 & example 2WhiteHat
@WhiteHat Cool thanks, that's all I really wanted to know. If you want to submit this as an answer, I'll accept.nyvokub

1 Answers

0
votes

You can just fix it like this:

 hAxis: {title: 'Date de Prélévement',titleTextStyle:{color: '#FFF'}, textStyle: {color: '#FFF'  , fontSize: 10} },
          vAxis: {title: 'Heures de sommeil',titleTextStyle:{color: '#FFF'},  textStyle: {color: '#FFF'  , fontSize: 10} },