I don't see anything obviously wrong with the code.  Can you post a sample 
of the JSON returned by your AJAX call so I can test this?

On Wednesday, July 17, 2013 10:02:51 PM UTC-4, Dan Mastromonaco wrote:
>
> Hi everyone,
>
> I've built a chart that works flawlessly in Chrome, but the range filter 
> control doesn't work in Safari, Firefox or IE.  Has anyone else had this 
> problem?
>
> Here is the code:
>
> <script type="text/javascript">
>>
>>
>>>       google.load('visualization', '1.1', {'packages': ['controls']});
>>
>>
>>>       google.setOnLoadCallback(drawVisualization);
>>
>>     
>>>
>> function drawVisualization() {
>>
>>    
>>
>>    var dashboard = new 
>>> google.visualization.Dashboard(document.getElementById('dashboard'));
>>
>>    
>>
>>    /** PREPARE DATA **/
>>
>>    var jsonData = $.ajax({
>>
>>   url: "ajax/metrics_json.php?type=calories",
>>
>>   dataType:"json",
>>
>>   async: false
>>
>>    }).responseText;
>>
>>    var data = new google.visualization.DataTable(jsonData); 
>>
>>    data.sort([{column: 0}]);
>>
>>    for(var i=0; i<data.getNumberOfRows(); i++){
>>
>>     data.setValue(i, 0, new Date(data.getValue(i, 0)));
>>
>>    }
>>
>>    var d = new Date();
>>
>>    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'}
>>
>>          },
>>
>>          'chartView': {
>>
>>            'columns': [0, 1, 2]
>>
>>          },
>>
>>          // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 86,400,000
>>
>>          'minRangeSize': 86400000
>>
>>        }
>>
>>      },
>>
>>      'state': {'range': {'start': new Date(2013,5,1), 'end': new 
>>> Date(2013,6,15)}}
>>
>>    });
>>
>>    var chart = new google.visualization.ChartWrapper({
>>
>>      'chartType': 'AreaChart',
>>
>>      'containerId': 'chart',
>>
>>      'options': {
>>
>>        // Use the same chart area width as the control for axis alignment.
>>
>>        'chartArea': {'height': '80%', 'width': '90%'},
>>
>>        'hAxis': {'slantedText': false},
>>
>>        'legend': {'position': 'top', 'alignment': 'center'}
>>
>>      },
>>
>>      // Convert the first column from 'date' to 'string'.
>>
>>      'view': {
>>
>>        'columns': [
>>
>>          {
>>
>>            'calc': function(dataTable, rowIndex) {
>>
>>              return dataTable.getFormattedValue(rowIndex, 0);
>>
>>            },
>>
>>            'type': 'string'
>>
>>          }, 1, 2]
>>
>>      }
>>
>>    });
>>
>>   
>>
>>    dashboard.bind(control, chart);
>>
>>    dashboard.draw(data);
>>
>>   
>>
>> }
>>
>>         
>>
>>       
>>
>>     </script>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization 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-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to