Your code looks fine. The problem might be in your data.  You could try to
just display a table chart, not even a dashboard, just to see what data is
being fetched.

Looking in your spreadsheet, I see that column E, after row 3111, is all 0s
for 53000 more rows.  That could be cause the chart to display very slowly,
assuming it displays at all, which may be what you are seeing. Try
selecting a smaller number of rows.

On Sun, May 10, 2015 at 2:41 AM, <[email protected]> wrote:

> Hello everybody,
> i would like to display a chart using the google visualization
> chartrangefilter. I can get it work when the data comes from an array
> inside the code but i can't get it work when the data is coming from a
> spreadsheet, as i want....
> Here is my code:
>
> <html>
> <head>
>
> <script type="text/javascript"src="https://www.google.com/jsapi";></script>
>
> <script type="text/javascript">
>     google.load('visualization', '1.0', {packages: ['corechart',
> 'controls']});
>
>     google.setOnLoadCallback(initialize);
>
> function initialize() {
>   var query = new google.visualization.Query(
>       '
> https://docs.google.com/spreadsheets/d/1TD6w3umaHJaFv_IW_Dizh5xk_em4q4JUDTFGA57ihxU/edit#gid=2107756481'
> );
>    query.setQuery('select A, E');
>   query.send(drawDashboard);
>                       }
>
> function drawDashboard(response) {
>    if (response.isError()) {
>     alert('Error in query: ' + response.getMessage() + ' ' +
> response.getDetailedMessage());
>     return;
>   }
> // Create a dashboard.
>     var dashboard = new
> google.visualization.Dashboard(document.getElementById('dashboard_div'));
>
>     var control = new google.visualization.ControlWrapper({
>             // Create a range slider, passing some options
>         'controlType' : 'ChartRangeFilter',
>         'containerId': 'chartRangeFilter_control_div',
>         'options' : {
>                 // Filter by the date axis.
>         'filterColumnIndex': 0,
>         'ui': {
>           'chartType': 'LineChart',
>           'chartOptions': {
>             'chartArea': {'width': '90%'},
>             'hAxis': {'baselineColor': 'none'}
>           },
>           // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 86,400,000
>           'minRangeSize': 8640000
>         }
>       }//,
>       // Initial range: 2012-02-09 to 2012-03-20.
>      // 'state': {'range': {'start':  new Date (2015, 4, 28, 22, 0, 0),
> 'end': new Date (2015, 4, 29, 12, 0, 0)}}
>     });
>
>
>  // Create a scatter chart, passing some options
>     var chart = new google.visualization.ChartWrapper({
>         'chartType' : 'ScatterChart',
>         'containerId' : 'chartContainer_div',
>         'options' : {
>             'chartArea': {'height': '80%', 'width': '90%'},
>             'vAxis' : {
>    // 'title' : 'Temperature',
>                 'viewWindow': {'min': 10, 'max': 40},
>             //    'gridlines': {'count': 10},
>              //   'minorGridlines': {'count': 3}
>
>                    }
>     'legend': {'position': 'none'}
>                  }
>     });
>
> // Create our data table.
>
>   var data = response.getDataTable();
>
>
>     dashboard.bind(control, chart);
>     dashboard.draw(data);
>
> }
> </script>
>
> </head>
> <body>
>
>    <!--Div that will hold the dashboard-->
> <div id="dashboard_div">
>      <table class="columns">
>     <tr>
>       <td>
>   <!--Divs that will hold each control and chart-->
>   <div id="chartRangeFilter_control_div" style="width: 615px; height:
> 50px;"></div>
>   </td>
>     </tr>
>     <tr>
>       <td>
>   <div id="chartContainer_div" style="width: 615px; height: 500px;></div>
>
>       </td>
>     </tr>
>      </table>
> </div>
> </body>
> </html>
>
>
> Thanks for your help
> With best regards
> Pierre
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to