Google charts, error with values in a single month

0

I have this error in google charts, I could not request it.

google.load('visualization', '1', {packages: ['controls', 'charteditor']});
google.setOnLoadCallback(drawChart);

function drawChart() {
    var data = new google.visualization.DataTable();
    data.addColumn('date', 'X');
    data.addColumn('number', 'Y1');
    data.addColumn('number', 'Y2');

    
    data.addRow([new Date(2016, 1,1), 41,null]);
    data.addRow([new Date(2016, 1,1), null,42 ]);
    /*
    data.addRow([new Date(2016, 2,1), 4,49 ]);
    data.addRow([new Date(2016, 3,1), 23,486 ]);
    data.addRow([new Date(2016, 4,1), 89,476 ]);
    data.addRow([new Date(2016, 5,1), 46,444 ]);
    data.addRow([new Date(2016, 6,1), 178,442 ]);
    data.addRow([new Date(2016, 7,1), 12,274 ]);
    data.addRow([new Date(2016, 8,1), 123,4934 ]);
    data.addRow([new Date(2016, 9,1), 144,4145 ]);
    data.addRow([new Date(2016, 10,1), 135,946 ]);
    data.addRow([new Date(2016, 11,1), 178,747 ]);
   */
    
    var dash = new google.visualization.Dashboard(document.getElementById('dashboard'));
  
    var chart = new google.visualization.ChartWrapper({
        chartType: 'ComboChart',
        containerId: 'chart_div',
        options: {
        	legend: { 
              position: 'bottom', 
              alignment: 'center', 
              textStyle: {
                fontSize: 12
              }
          },
          explorer: {
              actions: ['dragToZoom', 'rightClickToReset'],
              axis: 'horizontal',
              keepInBounds: true
          },
          hAxis: {
              title: 'X'
          },
          pointSize: 3,
          vAxis: {
              title: 'Y'
          },
          seriesType: 'bars'
      }
    });
    
    var control = new google.visualization.ControlWrapper({
        controlType: 'ChartRangeFilter',
        containerId: 'control_div',
        options: {
            filterColumnIndex: 0,
            ui: {
                chartOptions: {
                    height: 50,
                    chartArea: {
                        width: '75%'
                    }
                }
            }
        },
        state: {
          range: {
            start: new Date(2016, 0,1)
          }
        }
    });
    
    dash.bind([control], [chart]);
    
    dash.draw(data);
    
    // example of a new date set up
    setTimeout(function () {    	
    	control.setState({range: {
      		start: new Date(2016, 0,1),
          end: new Date(2016, 1,2)
      }});
      control.draw();
    }, 3000);
}
<div id="dashboard_div">  
  <div id="chart_div"> </div>
  <div id="control_div"> </div>
  <div id="table_div"> </div>
</div>
<script src="https://www.google.com/jsapi"></script>

I appreciate if someone can help me ...

    
asked by diyo games 08.05.2018 в 23:42
source

0 answers