如何在Google Charts中绘制图表区域周围的边框?

nec*_*cer 8 charts google-visualization

我只需要图表区域周围的边框,而不是整个图表.我找不到要设置的属性.这是在Google Visualization API中.

asg*_*ant 13

适当的选项没有记录.您需要设置chartArea.backgroundColor.strokechartArea.backgroundColor.strokeWidth选项.该stroke选项控制边框的颜色,并采用任何有效的HTML颜色字符串.该strokeWidth选项控制边框的宽度,并采用宽度的整数(以像素为单位):

chartArea: {
    backgroundColor: {
        stroke: '#4322c0',
        strokeWidth: 3
    }
}
Run Code Online (Sandbox Code Playgroud)

  • 似乎没有使用谷歌饼图 (2认同)
  • 自从我上次使用Visualization API以来已经有一段时间了,但我认为如果你还需要设置笔画,你可以使用`chartArea.backgroundColor.fill`来设置背景颜色. (2认同)