How to change color of annotation text in google-charts

后端 未结 5 1108
醉梦人生
醉梦人生 2021-01-17 12:16

How do you change the color of an annotation text in Google Chart Tools LineChart ?

Here is an example

google.load(\'visualization\', \'1\', {package         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 12:41

    Actually you can. Color of the annotations is the same as line color. Just put a dot in the place you want to make an annotation and set a dot's color to the desirable annotation color.

    data.addColumn({type: 'string', role: 'style'});
    data.addColumn({type:'string', role:'annotation'});
    

    and then when you add data

    'point { size: 14; shape-type: circle; fill-color: #63A74A','Your annotation'
    

    See example at http://www.marketvolume.com/stocks/stochasticsmomentumindex.asp?s=SPY&t=spdr-s-p-500

提交回复
热议问题