如何将hAxis(x轴)格式更改为HH:mm?

问题描述 投票:1回答:1

请告诉我哪里出错了。

我的折线图如下所示:

enter image description here

目前的hAxis格式:HH(24小时)

目标:HH:MM,如下:

enter image description here

我在这里找到了可能的答案(Google line chart configuration),但只有标题奏效了:(

hAxis: {
    title: 'MY OWN LABEL GOES HERE',
    gridlines: {
        units: {hours: {format: ['HH:mm']}}
}

注意:我使用谷歌分析API获取图表

google-analytics google-visualization google-analytics-api google-analytics-v4
1个回答
0
投票

试试hAxis.format ......

hAxis: {
    format: 'HH:mm',
    title: 'MY OWN LABEL GOES HERE'
}
© www.soinside.com 2019 - 2024. All rights reserved.