如何在悬停时将数据显示为百分比?我可以让网格线显示百分比,但悬停总是显示未格式化的数据:1
vs 100%
。
var data = google.visualization.arrayToDataTable([
['Who', 'Percentage'],
['Unlike Me', 0],
['Like Me', 1]
]);
var options = {
vAxis: { format:'#%'}, // Makes gridlines have percentages (correct)
format: '#%' // Does nothing
};
var div = $('#graph').get([0]);
var chart = new google.visualization.ColumnChart(div);
chart.draw(data, options);