我正在使用Google可视化资料图表…
https://google-developers.appspot.com/chart/interactive/docs/gallery/barchart#Material
….在我的例子中
http://jsfiddle.net/ETFairfax/78595a3h/
…工具提示正在对条形数值进行四舍五入,而不是仅显示它们的值.
我已经尝试自定义工具提示,如下所示:https://developers.google.com/chart/interactive/docs/customizing_tooltip_content#custom_html_content,但仍然没有喜悦.
文件确实说…
“The Material Charts are in beta.”
所以也许我正在打败一个失败的事业.
我的问题:
有谁知道如何阻止工具提示四舍五入?
任何帮助赞赏.
HTML
<div id="chart_div" style="width: 900px; height: 500px;"></div>
JS代码:
google.load("visualization","1.1",{ packages: ["bar"] }); google.setOnLoadCallback(drawChart); function drawChart() { var data = google.visualization.arrayToDataTable([ ['Task','Hours per Day'],['Work',8.5],// Tooltip says 8.5. CORRECT ['Eat',11.5],// Tooltip says 12 - INCORRECT ['Commute',2],// Tooltip says 2 - CORRECT ['Watch TV',0.28],// Tooltip says 0.28 - CORRECT ['Sleep',7.28] // Tooltip says 7.3 - INCORRECT ]); var options = { title: 'My Daily Activities' }; var chart = new google.charts.Bar(document.getElementById('chart_div')); chart.draw(data,google.charts.Bar.convertOptions(options)); }