1
有沒有方法可以更改Google Chart中工具提示的日期格式?我不想讓它成爲HTML,因爲它完全適合我的需要。我只想要其他日期格式。正如你所看到的,我改變了hAxis的格式,並且我想爲tooltip做同樣的工作。Google Line Chart工具提示中的日期格式
var data = google.visualization.arrayToDataTable([[{"label":"Month","type":"date"},"Customers"],[new Date('2017-01-01'),30],[new Date('2017-02-01'),45],[new Date('2017-03-01'),55],[new Date('2017-04-01'),40],[new Date('2017-05-01'),20],[new Date('2017-06-01'),17],[new Date('2017-07-01'),15],[new Date('2017-08-01'),18],[new Date('2017-09-01'),0],[new Date('2017-10-01'),0],[new Date('2017-11-01'),0],[new Date('2017-12-01'),0]]);
var options = {"legend":{"position":"bottom"},"pointSize":5,"hAxis":{"format":"MMM","ticks":[new Date('2017-01-01'),new Date('2017-02-01'),new Date('2017-03-01'),new Date('2017-04-01'),new Date('2017-05-01'),new Date('2017-06-01'),new Date('2017-07-01'),new Date('2017-08-01'),new Date('2017-09-01'),new Date('2017-10-01'),new Date('2017-11-01'),new Date('2017-12-01')]},"height":300};
var c = new google.visualization.LineChart(document.getElementById("div-chartw0"));
c.draw(data, options);
謝謝你了。像魅力一樣工作 – forza020