0
我有數據從測試JSON文件來折線圖,像這樣:格式谷歌路線圖提示數據使用百分比
{
"cols": [
{"id":"Day","label":"Day","type":"number"},
{"id":"Failed","label":"Checks Failed","type":"number"},
{"id":"Passed","label":"Checks Passed","type":"number"},
],
"rows": [
{"c":[{"v":"1","f":null},{"v": "25","f":null},{"v": "72","f":null}]},
{"c":[{"v":"2","f":null},{"v": "6","f":null},{"v": "67","f":null}]},
{"c":[{"v":"3","f":null},{"v": "6","f":null},{"v": "32","f":null}]},
{"c":[{"v":"4","f":null},{"v": "6","f":null},{"v": "7","f":null}]},
{"c":[{"v":"5","f":null},{"v": "6","f":null},{"v": "57","f":null}]},
]
}
我有我的圖表腳本:
var graph_1 = $.ajax({
url: "/linegraph.json",
dataType: "json",
async: false
}).responseText;
var data = new google.visualization.DataTable(graph_1);
var linechart_1 = new google.charts.Line(document.getElementById('lg1'));
var lg1_options = {
legend: {position: 'none'},
height: 100,
vAxis: {format: '#%'}
};
linechart_1.draw(data, lg1_options);
格式選項似乎沒有給我其他人建議的結果。我的工具提示只顯示一個普通數字,而我希望看到數字後跟%
。我哪裏錯了?