title: Google Chart: how to set initial selection with listener for interactive
body: <p>I have some code I am trying to manipulate into my environment and can't get this last piece.  I want to have the chart draw with an initial value selected to begin with BUT I also want to leave the listener for user selected values.  I tried using an initialization variable to flag first load and subsequent clicks but that didn't seem to work.</p>
  
  <p>Any assistance is greatly appreciated.</p>
  
  <pre><code>Date.prototype.getWeekNumber = function(){
      var d = new Date(Date.UTC(this.getFullYear(), this.getMonth(), this.getDate()));
      var dayNum = d.getUTCDay() || 7;
      d.setUTCDate(d.getUTCDate() + 4 - dayNum);
      var yearStart = new Date(Date.UTC(d.getUTCFullYear(),0,1));
      return Math.ceil((((d - yearStart) / 86400000) + 1)/7)
  };
  
  function(response) {
  
          var i;
  
          google.charts.load("current", {packages:["calendar"]});
          google.charts.setOnLoadCallback(drawChart);
  
          function drawChart() {
              var dataTable = new google.visualization.DataTable();
              dataTable.addColumn({ type: 'date', id: 'Date' });
              dataTable.addColumn({ type: 'number', id: 'Changes' });
  
              for(var i=0; i &lt; response.d.Rows.length; i++){
                  var row = [new Date(response.d.Rows[i][0]),response.d.Rows[i][1]];
                  dataTable.addRow(row);
              }
  
              var chart = new google.visualization.Calendar(document.getElementById('calendar_basic'));
  
              var options = {
                  title: 'Total Alerts Triggered By Day',
                  calendar: { cellSize: 25 },
                  colorAxis: {colors:['#86ce76','#d61007']},
              };
  
              &lt;!--Event listener starting code--&gt;
              function selectHandler() {
                  &lt;!-- Do Some Code --&gt;
              }
  
              google.visualization.events.addListener(chart, 'select', selectHandler);
              &lt;!--End event listener--&gt;
  
              &lt;!--My Test--&gt;
              if !(response){
  
              var weekNumber = (new Date()).getWeekNumber();
              var dayOfWeek = 0; &lt;!--(new Date()).getDay();--&gt;
              chart.setSelection([{'row':dayOfWeek,'column':weekNumber}]);
          }
  
          chart.draw(dataTable, options);
  </code></pre>
  
  <p>So the Listener works but the initial value that i would like (select the current date in the chart) does not work.</p>