Need help with the following code:

<code>

google.load('visualization', '1.0', {'packages':['controls']});
    google.setOnLoadCallback(drawVisualization);

          function drawVisualization() {
            var dashboard = new google.visualization.Dashboard(
                 document.getElementById('visualization'));

             var control = new google.visualization.ControlWrapper({
               'controlType': 'ChartRangeFilter',
               'containerId': 'control',
               'options': {
                 // Filter by the date axis.
                 'filterColumnIndex': 0,
                 'ui': {
                   'chartType': 'LineChart',
                   'chartOptions': {
                                     'chartArea': {'width': '90%'},
                                     'hAxis': {'baselineColor': 'none'}
                                   },
                   // Display a single series that shows the closing value 
of the stock.
                   // Thus, this view has two columns: the date (axis) and 
the stock value (line series).
                   'chartView': {
                                   'columns': [0, 1]
                                 }, 
                   // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 
86,400,000
                   'minRangeSize': 86400000
                 }
               },
               // Initial range: 2012-02-09 to 2012-03-20.
               'state': {'range': {'start': new Date(2013, 2, 18), 'end': 
new Date(2013, 3, 2)}}
             });

             var chart = new google.visualization.ChartWrapper({
               'chartType': 'LineChart',
               'containerId': 'chart',
               'options': {
                 // Use the same chart area width as the control for axis 
alignment.
                 'chartArea': {'height': '80%', 'width': '90%'},
                 'hAxis': {'slantedText': false},
                 'vAxis': {'viewWindow': {'min': 8000000, 'max': 15000000}},
                 'legend': {'position': 'none'}
               },
               // Convert the first column from 'date' to 'string'.
               'view': {
                 'columns': [
                   {
                     'calc': function(dataTable, rowIndex) {
                       return dataTable.getFormattedValue(rowIndex, 0);
                     },
                     'type': 'string'
                   }, 1]
               }
             });
                 // Data
                  var data = new google.visualization.DataTable();
                  data.addColumn('date', 'Date');
                  data.addColumn('number', 'HBC Sales');
                  data.addRows([
                    [new Date(2013, 2 ,18), 9404836.37],
                    [new Date(2013, 2 ,19), 8990330.77],
                    [new Date(2013, 2 ,20), 10565528.47],
                    [new Date(2013, 2 ,21), 9282644.38],
                    [new Date(2013, 2 ,22), 9459120.95],
                    [new Date(2013, 2 ,23), 11877815.36],
                    [new Date(2013, 2 ,24), 11799125.34],
                    [new Date(2013, 2 ,25), 9271937.76],
                    [new Date(2013, 2 ,26), 8560052.19],
                    [new Date(2013, 2 ,27), 1661184.20],
                    [new Date(2013, 2 ,28), 9472661.90],
                    [new Date(2013, 3 , 1), 10305917.81],
                    [new Date(2013, 3 , 2), 12004270.32]
                  ]);

             dashboard.bind(control, chart);
             dashboard.draw(data);
          };
</code>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-chart-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to