我正在使用谷歌图表来显示统计数据。我正在向图表数据发送如下的json数据。我正在准确地得到图表,但是如果你观察到Y轴上的值,那么它们就不合适了。我该如何解决这个问题?附上图表的截图。我将更多地解释数据,在数据库中我们有卧室1到卧室6的数据,状态为Occupied或Vacant。我们需要在特定的财政年度显示他们的统计数据,例如我的酒店占用多少以及有多少空置。
[[["name","budjet1","budjet2","budjet3","budjet4","budjet5","Bedroom6","Bedroom3","Bedroom2","Bedroom1"
],["Occupied","26","17","13","5","4","1","0","0","0"],["Vacant","1","1","1","0","0","0","0","0","0"]
,["Future - Certain","2","3","0","0","0","0","0","0","0"]]]
function drawChart(response) {
var data1 = google.visualization.arrayToDataTable(response[0]);
var options1 = {
chart: {
title: 'Availability Status By Bedroom', },
};
var chart = new google.charts.Bar(document.getElementById('columnchart_material1'));
chart.draw(data1, options1);
}
答案 0 :(得分:1)
" budjet1"," budjet2" ...的值需要是数字,而不是字符串
(丢失报价)
["Future - Certain",2,3,0,0,0,0,0,0,0]