Looking more closely into this I realized that the fix I proposed is 
insufficient.
The problem is you need the ChartRangeFilter to filter the original 
DataTable (so the Dashboard would feed the GeoChart correctly), but pass an 
aggregated view to the underlying line chart.
Unfortunately, as you have already found out (I see you submitted an 
issue<http://code.google.com/p/google-visualization-api-issues/issues/detail?id=891>
 on 
this), DataViews do not support aggregation yet.

Sorry for the inconvenience,
Visigoth

On Tuesday, May 1, 2012 5:39:03 PM UTC+3, visigoth wrote:
>
> Hi Chris,
>
> Please note that the 'chartView' option accepts a JSON object that 
> specifies a DataView, not a DataView object.
> Try replacing 'chartView': timeselectdataview with 'chartView': 
> timeselectdataview.toJSON() and let us know how this works for you.
>
> HTH,
> Visigoth
>
> On Monday, April 30, 2012 8:00:21 PM UTC+3, asgallant wrote:
>>
>> My apologies, I misstated earlier: you cannot set views on controls in 
>> general; chartRangeFilters specifically permit you to set views on them, 
>> but only as an initializer object - you cannot pass an instantiated 
>> DataView to them; ie, you might use:
>>
>> chartView: {
>>     columns: [0, 1]
>> }
>>
>> If you want to group data for the filter, you would have to do so before 
>> passing the data to the Dashboard.  If you specifically don't want grouped 
>> data for the chart itself, then some tricky manipulation is required to 
>> make it work, but it is doable.
>>
>> On Monday, April 30, 2012 11:06:43 AM UTC-4, Chris wrote:
>>>
>>> Thanks for the response. I've been hammering away at this, reading the 
>>> doc several times and just can't make any progress on a working 
>>> implementation using the new dashboard specs. My implementation is actually 
>>> far simpler then the dilbert/xkcd scenarious: I just have a GeoChart 
>>> intensity map (state, date, intensity as a number), and a DateRangerFilter 
>>> which uses date on the x axis, and on the y axis, is the aggregate date's 
>>> intensity. I did get it working well using the technique on the slide, but 
>>> I would rather use the published API and take advantage of the features of 
>>> the dashboard, if I could just manage to understand how it works.
>>>
>>> Follows is my relevant code - 
>>>
>>>         /***
>>>            load the DataTable to be used for dashboard widgets
>>>                I am loading from a JSON data source, using jQuery.
>>>                I tried a variant using literals to load, but that 
>>> actually proved to be far slower and crashed my browser.
>>>         ***/
>>>         var map = new google.visualization.DataTable();
>>>     map.addRows(data.length);
>>>         map.addColumn('string', 'State');
>>>         map.addColumn('number', 'Intensity');
>>>         map.addColumn('date', 'Date');
>>> $.each(data, function(i,v) {
>>> // set the values for both the name and the intensity
>>> map.setValue(i, 0, v.region);
>>> map.setValue(i, 1, v.intensity);
>>> map.setValue(i, 2, parseDate(v.shipdate));
>>> });
>>>
>>>             /***
>>>                load and draw the date range filter to be used for the map
>>>             ***/
>>>             // Group the data by Ship Date and Amount of Shipments
>>>
>>>             timeselectdata = new google.visualization.data.group(
>>>              map,
>>>              [2],
>>>              [{column: 1, aggregation: google.visualization.data.sum, 
>>> type: 'number'}]
>>>     );
>>>     timeselectdataview = new google.visualization.DataView(data)
>>>
>>>             timeselect = new google.visualization.ControlWrapper({
>>>             'controlType': 'ChartRangeFilter',
>>>             'containerId': 'timeselect',
>>>                 'options': {
>>>                 vAxis: {textPosition: 'none', minValue: 0},
>>>                 hAxis: {type: 'value'},
>>>                 legend: 'none'
>>>                 },
>>>                 'filterColumnIndex': 2,
>>>                 'ui': {
>>>                    'chartType': 'LineChart',
>>>                    'chartOptions': {
>>>                      'chartArea': {'width': '90%'},
>>>                      'hAxis': {'baselineColor': 'none'}
>>>                     },
>>>                  'chartView': timeselectdataview,
>>>                  // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 
>>> 86,400,000
>>>                  'minRangeSize': 86400000
>>>             }
>>>            });
>>>
>>>
>>> On Thursday, April 26, 2012 11:58:23 AM UTC-4, asgallant wrote:
>>>>
>>>> Use the ui.chartView option to set the view used by the 
>>>> chartRangeFilter.  You are correct, the dashboards allow you to use only 
>>>> one DataTable, but you can set different views of the DataTable on every 
>>>> chart and control in the dashboard.
>>>>
>>>> On Thursday, April 26, 2012 9:42:07 AM UTC-4, Chris wrote:
>>>>>
>>>>> Can we get an example of the xkcd/dilbert using ChartRangeFilter? I 
>>>>> have been trying to reproduce it on my own with no luck. I can't figure 
>>>>> out 
>>>>> how to specify a different view of the same data table to the range 
>>>>> filter.  And it seems that a dashboard allows only one data table to be 
>>>>> associated with it, and you associate a control with a different view of 
>>>>> that data. I might be wrong though!
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>
On Tuesday, May 1, 2012 5:39:03 PM UTC+3, visigoth wrote:
>
> Hi Chris,
>
> Please note that the 'chartView' option accepts a JSON object that 
> specifies a DataView, not a DataView object.
> Try replacing 'chartView': timeselectdataview with 'chartView': 
> timeselectdataview.toJSON() and let us know how this works for you.
>
> HTH,
> Visigoth
>
> On Monday, April 30, 2012 8:00:21 PM UTC+3, asgallant wrote:
>>
>> My apologies, I misstated earlier: you cannot set views on controls in 
>> general; chartRangeFilters specifically permit you to set views on them, 
>> but only as an initializer object - you cannot pass an instantiated 
>> DataView to them; ie, you might use:
>>
>> chartView: {
>>     columns: [0, 1]
>> }
>>
>> If you want to group data for the filter, you would have to do so before 
>> passing the data to the Dashboard.  If you specifically don't want grouped 
>> data for the chart itself, then some tricky manipulation is required to 
>> make it work, but it is doable.
>>
>> On Monday, April 30, 2012 11:06:43 AM UTC-4, Chris wrote:
>>>
>>> Thanks for the response. I've been hammering away at this, reading the 
>>> doc several times and just can't make any progress on a working 
>>> implementation using the new dashboard specs. My implementation is actually 
>>> far simpler then the dilbert/xkcd scenarious: I just have a GeoChart 
>>> intensity map (state, date, intensity as a number), and a DateRangerFilter 
>>> which uses date on the x axis, and on the y axis, is the aggregate date's 
>>> intensity. I did get it working well using the technique on the slide, but 
>>> I would rather use the published API and take advantage of the features of 
>>> the dashboard, if I could just manage to understand how it works.
>>>
>>> Follows is my relevant code - 
>>>
>>>         /***
>>>            load the DataTable to be used for dashboard widgets
>>>                I am loading from a JSON data source, using jQuery.
>>>                I tried a variant using literals to load, but that 
>>> actually proved to be far slower and crashed my browser.
>>>         ***/
>>>         var map = new google.visualization.DataTable();
>>>     map.addRows(data.length);
>>>         map.addColumn('string', 'State');
>>>         map.addColumn('number', 'Intensity');
>>>         map.addColumn('date', 'Date');
>>> $.each(data, function(i,v) {
>>> // set the values for both the name and the intensity
>>> map.setValue(i, 0, v.region);
>>> map.setValue(i, 1, v.intensity);
>>> map.setValue(i, 2, parseDate(v.shipdate));
>>> });
>>>
>>>             /***
>>>                load and draw the date range filter to be used for the map
>>>             ***/
>>>             // Group the data by Ship Date and Amount of Shipments
>>>
>>>             timeselectdata = new google.visualization.data.group(
>>>              map,
>>>              [2],
>>>              [{column: 1, aggregation: google.visualization.data.sum, 
>>> type: 'number'}]
>>>     );
>>>     timeselectdataview = new google.visualization.DataView(data)
>>>
>>>             timeselect = new google.visualization.ControlWrapper({
>>>             'controlType': 'ChartRangeFilter',
>>>             'containerId': 'timeselect',
>>>                 'options': {
>>>                 vAxis: {textPosition: 'none', minValue: 0},
>>>                 hAxis: {type: 'value'},
>>>                 legend: 'none'
>>>                 },
>>>                 'filterColumnIndex': 2,
>>>                 'ui': {
>>>                    'chartType': 'LineChart',
>>>                    'chartOptions': {
>>>                      'chartArea': {'width': '90%'},
>>>                      'hAxis': {'baselineColor': 'none'}
>>>                     },
>>>                  'chartView': timeselectdataview,
>>>                  // 1 day in milliseconds = 24 * 60 * 60 * 1000 = 
>>> 86,400,000
>>>                  'minRangeSize': 86400000
>>>             }
>>>            });
>>>
>>>
>>> On Thursday, April 26, 2012 11:58:23 AM UTC-4, asgallant wrote:
>>>>
>>>> Use the ui.chartView option to set the view used by the 
>>>> chartRangeFilter.  You are correct, the dashboards allow you to use only 
>>>> one DataTable, but you can set different views of the DataTable on every 
>>>> chart and control in the dashboard.
>>>>
>>>> On Thursday, April 26, 2012 9:42:07 AM UTC-4, Chris wrote:
>>>>>
>>>>> Can we get an example of the xkcd/dilbert using ChartRangeFilter? I 
>>>>> have been trying to reproduce it on my own with no luck. I can't figure 
>>>>> out 
>>>>> how to specify a different view of the same data table to the range 
>>>>> filter.  And it seems that a dashboard allows only one data table to be 
>>>>> associated with it, and you associate a control with a different view of 
>>>>> that data. I might be wrong though!
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>
>>>>> On Thursday, February 23, 2012 8:06:08 AM UTC-5, visigoth wrote:
>>>>>>
>>>>>> Good news,
>>>>>>
>>>>>> We have released the 
>>>>>> ChartRangeFilter<http://code.google.com/apis/chart/interactive/docs/gallery/controls.html#chartrangefilter>
>>>>>>  as 
>>>>>> part of the latest version.
>>>>>> Please try it out and tell us whether it works for you.
>>>>>>
>>>>>> Visigoth
>>>>>>
>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-visualization-api/-/flqI4-fliFQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to