Calendar 我想让上面的谷歌日历响应。我需要一个窗口调整它的大小 这是最新的小提琴吗 我想让这个反应灵敏。如果我更改窗口的大小,我的日历大小应相应调整 我想按窗口查看整个日历

Calendar 我想让上面的谷歌日历响应。我需要一个窗口调整它的大小 这是最新的小提琴吗 我想让这个反应灵敏。如果我更改窗口的大小,我的日历大小应相应调整 我想按窗口查看整个日历,calendar,resize,window,google-visualization,Calendar,Resize,Window,Google Visualization,您可以使用calendar.cellSize选项更改日期(“单元格”)的大小 因此,我通过将单元格大小缩放到窗口的宽度来调整图表大小,如下所示: google.load("visualization", "1.1", {packages:["calendar"]}); google.setOnLoadCallback(drawChart); function drawChart() { var dataTable = new google.visualization.D

您可以使用
calendar.cellSize
选项更改日期(“单元格”)的大小

因此,我通过将单元格大小缩放到窗口的宽度来调整图表大小,如下所示:

google.load("visualization", "1.1", {packages:["calendar"]});
      google.setOnLoadCallback(drawChart);


  function drawChart() {
  var dataTable = new google.visualization.DataTable();
   dataTable.addColumn({ type: 'date', id: 'Date' });
   dataTable.addColumn({ type: 'number', id: 'Won/Loss' });
   dataTable.addRows([
      [ new Date(2012, 3, 13), 37032 ],
      [ new Date(2012, 3, 14), 38024 ],
      [ new Date(2012, 3, 15), 38024 ],
      [ new Date(2012, 3, 16), 38108 ],
      [ new Date(2012, 3, 17), 38229 ],
      // Many rows omitted for brevity.
      [ new Date(2013, 9, 4), 38177 ],
      [ new Date(2013, 9, 5), 38705 ],
      [ new Date(2013, 9, 12), 38210 ],
      [ new Date(2013, 9, 13), 38029 ],
      [ new Date(2013, 9, 19), 38823 ],
      [ new Date(2013, 9, 23), 38345 ],
      [ new Date(2013, 9, 24), 38436 ],
      [ new Date(2013, 9, 30), 38447 ]
    ]);



      var  chart = new       google.visualization.Calendar(document.getElementById('calendar_basic'));

      var options = {
       title: "Red Sox Attendance",
       height: 350,

   };

   chart.draw(dataTable, options);

   }
在哪里


有人能帮我吗?
var options = {
    title: "Red Sox Attendance",
    calendar: {
        cellSize: scale(5, 20)
    }
};
function scale(min, max) {
    var cellSize = window.innerWidth / 60;
    if (cellSize > max) return max;
    if (cellSize < min) return min;
    return cellSize;
}
//create trigger to resizeEnd event     
$(window).resize(function () {
    if (this.resizeTO) clearTimeout(this.resizeTO);
    this.resizeTO = setTimeout(function () {
        $(this).trigger('resizeEnd');
    }, 10);
});

//redraw graph when window resize is completed  
$(window).on('resizeEnd', function () {
    drawChart();
});