如何更改谷歌图表标题字体大小?

时间:2022-11-11 12:39:15

How do I change the font size of my title in google chart?

如何在谷歌图表中更改标题的字体大小?

   var options = {
      title: 'My Daily Activities',
      'backgroundColor': 'transparent',   
      is3D: true,
    };

1 个解决方案

#1


33  

Use titleTextStyle in options like this

在像这样的选项中使用titleTextStyle

var options = {
    titleTextStyle: {
        color: <string>,    // any HTML string color ('red', '#cc00cc')
        fontName: <string>, // i.e. 'Times New Roman'
        fontSize: <number>, // 12, 18 whatever you want (don't specify px)
        bold: <boolean>,    // true or false
        italic: <boolean>   // true of false
    }
}

You can find a complete support guide for Google Charts here https://developers.google.com/chart/interactive/docs

您可以在https://developers.google.com/chart/interactive/docs找到Google图表的完整支持指南

#1


33  

Use titleTextStyle in options like this

在像这样的选项中使用titleTextStyle

var options = {
    titleTextStyle: {
        color: <string>,    // any HTML string color ('red', '#cc00cc')
        fontName: <string>, // i.e. 'Times New Roman'
        fontSize: <number>, // 12, 18 whatever you want (don't specify px)
        bold: <boolean>,    // true or false
        italic: <boolean>   // true of false
    }
}

You can find a complete support guide for Google Charts here https://developers.google.com/chart/interactive/docs

您可以在https://developers.google.com/chart/interactive/docs找到Google图表的完整支持指南