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.
/***
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
}
});