【问题标题】:How to set different color on annotations?如何在注释上设置不同的颜色?
【发布时间】:2017-04-04 14:28:40
【问题描述】:

我想为谷歌组合图表上的注释提供不同的colorauraColor。任何人都可以说它是否可能以及如何?

这是当前选项;

annotations: {
            stemColor: 'none',
            textStyle: {
                fontName: 'Arial',
                color: 'white',
                auraColor: 'grey',
                fontSize: 11,
                alwaysOutside: true,
            }
        },

我也试过了,但是没用;

annotations: {
             0:{stemColor: 'none',
                textStyle: {
                    fontName: 'Arial',
                    color: 'white',
                    auraColor: 'grey',
                    fontSize: 11,
                    alwaysOutside: true
                }},
             1:{stemColor: 'none',
                textStyle: {
                    fontName: 'Arial',
                    color: 'black',
                    auraColor: 'red',
                    fontSize: 11,
                    alwaysOutside: true,
                 }},
            2:{stemColor: 'none',
                textStyle: {
                    fontName: 'Arial',
                    color: 'blue',
                    auraColor: 'white',
                    fontSize: 11,
                    alwaysOutside: true,
                }}                
        },

提前致谢

【问题讨论】:

    标签: google-api annotations google-visualization


    【解决方案1】:

    尝试使用series 选项...

    series: {
      0:{
        annotations: {
          stemColor: 'none',
          textStyle: {
            fontName: 'Arial',
            color: 'white',
            auraColor: 'grey',
            fontSize: 11,
            alwaysOutside: true
          }
        }
      },
      1:{
        annotations: {
          stemColor: 'none',
          textStyle: {
            fontName: 'Arial',
            color: 'black',
            auraColor: 'red',
            fontSize: 11,
            alwaysOutside: true,
          }
        }
      },
      ...
    

    【讨论】:

    • 是的,这就是我要找的。谢谢你:)
    猜你喜欢
    • 2015-05-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多