https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Example
如何将单位添加到垂直轴,如“$”或“€”?在示例中,它应该是 1.200 $、1.000 $、800 $、600 $ 和 400 $。
像这样添加 '$' 是行不通的:
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000 '$', 400],
['2005', 1170 '$', 460],
['2006', 660 '$', 1120],
['2007', 1030 '$', 540]
]);
我知道,这是一个不好的例子,因为销售没有任何单位,但这只是一个例子。
最佳答案
您需要在图形选项中添加格式标签,如下所示:
var options = {
vAxis: {format:'# $'}
};
引用:https://google-developers.appspot.com/chart/interactive/docs/gallery/linechart#Configuration_Options
关于google-visualization - 谷歌折线图 : How to add units?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15325837/