Hi,

It seems I still need a dashboard, otherwise there is no way to bind the 
control to a DataTable.

Here's my try:

    google.charts.setOnLoadCallback(function(){
      var container = document.createElement("DIV");
      container.id = "slider";
      controlUI.appendChild(container);
      var container2 = document.createElement("DIV");
      container2.id = "slider2";
      controlUI.appendChild(container2);
  
      var slider = new google.visualization.ControlWrapper({
        'controlType': 'NumberRangeFilter',
        'containerId': 'slider',
        'options': {
          'filterColumnIndex': 0,
          'minValue': yearRange.min,
          'maxValue': yearRange.max}
      });
      
      var tableChart = new google.visualization.ChartWrapper({
        'chartType': 'Table',
        'containerId': 'slider2',
        'options': {
          'width': '100%',
          'height': '100%',
          'chartArea': {top: 0, right: 0, bottom: 0}
        }
      });
      
      // Create the dashboard.
      var data = google.visualization.arrayToDataTable([
                                                        ['Year'],
                                                        [yearRange.min],
                                                        [yearRange.max],
                                                        ]);
      var dashboard = new google.visualization.Dashboard(controlUI);
      dashboard.bind(slider, tableChart);
      dashboard.draw(data);
    });

This only gets me a "... failed to draw" error.


Am Mittwoch, 8. März 2017 15:41:24 UTC+1 schrieb Daniel LaLiberte:
>
> Yes it is possible to use controls outside of dashboards, but they are 
> dependent on accessing a DataTable.  Perhaps you can fake a datatable just 
> so it gets the right range.  You don't need to use the filtered datatable 
> that results.
>
> You'll need to listen for the 'statechange' and 'ready' events.  
>
> On Wed, Mar 8, 2017 at 8:10 AM, 'perspektive42' via Google Visualization 
> API <[email protected] <javascript:>> wrote:
>
>> Is it somehow possible to use controls (e.g. a DateRangeFilter) without a 
>> dashboard and without connecting it to a DataTable? I'd like to use it as a 
>> UI element to control elements in a Google Map (not within a chart).
>>
>> -- 
>> 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] 
>> <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> Visit this group at 
>> https://groups.google.com/group/google-visualization-api.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-visualization-api/6393c233-c9bc-4a33-8ec3-083a21990ce7%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-visualization-api/6393c233-c9bc-4a33-8ec3-083a21990ce7%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
> [email protected] <javascript:>   5CC, Cambridge MA
>

-- 
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/c1a82f8a-0e03-4c92-b13a-e15fd32fd3fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [visualization-api] Using ... 'perspektive42' via Google Visualization API
    • Re: [visualization-ap... 'Daniel LaLiberte' via Google Visualization API
      • Re: [visualizatio... 'perspektive42' via Google Visualization API
        • Re: [visualiz... 'Daniel LaLiberte' via Google Visualization API
          • Re: [visu... 'perspektive42' via Google Visualization API
            • Re: ... 'Daniel LaLiberte' via Google Visualization API
              • ... 'perspektive42' via Google Visualization API
                • ... 'Daniel LaLiberte' via Google Visualization API
                • ... 'perspektive42' via Google Visualization API
                • ... 'perspektive42' via Google Visualization API
                • ... 'Daniel LaLiberte' via Google Visualization API
                • ... 'perspektive42' via Google Visualization API
                • ... 'Daniel LaLiberte' via Google Visualization API

Reply via email to