是否可以删除垂直轴上的十进制数字?我正在尝试显示两个图表,但我不知道如何删除这些十进制数字,因为选项刻度在材料图表中不起作用。
显示图表的脚本代码:
<script type="text/javascript">
// Load the Visualization API and the line package.
google.charts.load('current', {'packages':['bar']});// google.charts.load('visualization', '1', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Rok', 'Pocet'],
<?php
foreach ($chart_data as $data) {
echo "['".$data["rok"]."', ".$data["pocet"]."],";
}
?>
]);
var data2 = google.visualization.arrayToDataTable([
['Rok', 'Pocet'],
<?php
foreach ($customers_data as $data) {
echo "['".$data["rok"]."', ".$data["pocet"]."],";
}
?>
]);
var options = {
chart: {
title: 'Chart 1',
},
};
var options2 = {chart: {
title: 'Chart 2',
},
};
var chart = new google.charts.Bar(document.getElementById('columnchart_material'));
chart.draw(data,google.charts.Bar.convertOptions(options));
var chart2 = new google.charts.Bar(document.getElementById('columnchart_material2'));
chart2.draw(data2,google.charts.Bar.convertOptions(options2));
}
</script>
现在显示如下:当前状态
我只想显示 0, 1, 2 ...
感谢您的所有建议。