Google图表会更改haxis字体大小

Ale*_* Es 18 charts google-visualization

有谁知道改变这些日期的字体大小的方法?我想让它们变得更小,所以它们都适合而不是每次都跳过一个......

在此输入图像描述

juv*_*ian 50

试试:

options:{
    hAxis : { 
        textStyle : {
            fontSize: 7 // or the number you want
        }

    }

}
Run Code Online (Sandbox Code Playgroud)


小智 6

我使用以下代码修复了这个问题:

titleTextStyle -- 指定标题文本样式的对象。该对象具有以下格式:

    var options = {
    title: 'Chart Name ',
    width: '100%',
    height: '100%',
    legend: {
        position: "none"
    },
    hAxis: {
        title: 'Request Status',
        titleTextStyle: {
            color: "#000",
            fontName: "sans-serif",
            fontSize: 11,
            bold: true,
            italic: false
        }
    },
    vAxis: {
        title: 'Amount requested ($)',
        titleTextStyle: {
            color: "#000",
            fontName: "sans-serif",
            fontSize: 11,
            bold: true,
            italic: false
        }
    },
    annotations: {
        alwaysOutside: true,
        textStyle: {
            fontSize: 14,
            auraColor: 'none'
        }
    }
};
Run Code Online (Sandbox Code Playgroud)

来自谷歌图表的更多细节

快乐编码...