Google Charts - Change individual bar color

后端 未结 9 1493
走了就别回头了
走了就别回头了 2020-12-10 01:36

With Google Charts bar graph, is it possible to to change the color of one bar. For example I\'d like to make the 2006 data red (other bars are blue).

 funct         


        
9条回答
  •  一个人的身影
    2020-12-10 01:41

    Here is a code sample that changes the color. Note that the "colors" option accepts an array of strings.

    var options = {
          title: 'Company Performance',
          hAxis: {title: 'Year', titleTextStyle: {color: 'red'}},
          colors: ['red','green'],
          is3D:true
    };
    

提交回复
热议问题