Google 可视化图表时间轴 - 工具提示日期格式不起作用

问题描述

我正在尝试更改 Google 图表时间轴中的日期格式工具提示。由于某种原因,它根本不起作用。我已经尝试过这种模式 'dd.MM,yyyy' 通过工作得很好的选项来更改 hAxis,但工具提示没有改变。

google.charts.load('current',{'packages':['timeline']});
google.charts.setonLoadCallback(drawChart);
function drawChart() {
  var dataTable = new google.visualization.DataTable();

  dataTable.addColumn({ type: 'string',id: 'Name' });
  dataTable.addColumn({ type: 'string',id: 'City' });
  dataTable.addColumn({ type: 'date',id: 'Start' });
  dataTable.addColumn({ type: 'date',id: 'End' });
  dataTable.addRows([
     // some PHP code to echo Rows that look like this
     ['Mike','London',new Date(2021,4,25),5,18)],['Peter','Berlin',3,10),6,20)]
  ]);

var formatter = new google.visualization.DateFormat({ pattern: 'dd.MM,yyyy' });
formatter.format(dataTable,2);
formatter.format(dataTable,3);

var chart = new google.visualization.Timeline(document.getElementById('timeline'));
chart.draw(dataTable);
}

Timeline still shows this

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)