These are behaving exactly as expected. In the first case, all controls impose their starting state on whatever they are bound to - this is by design. NumberRangeFilters filter on numbers, and "null" is not a number, therefor it is automatically filtered out by NumberRangeFilters. If you don't want the filter to be imposed on the initial draw of the dashboard, you would have to draw the filter separately, then bind it to the dashboard in a "statechange" event handler and redraw the dashboard. See it in action here:
http://jsfiddle.net/asgallant/zNccF/ In the second case, the age filter has no way of knowing that Aaron's row is being filtered out by another filter. The same effect would happen in your first case if you filtered out Aaron's row by typing an "M" in the string filter control. If you want one control to effect another control, you have to bind them: dash.bind([slider], [slider2]); On Wednesday, September 5, 2012 5:23:30 AM UTC-4, Bassa Safa wrote: > > Another strange issue with this can be seen with this modified example > below. Now there are two NumberRangeFilters: one for 'age' and the other > for 'donuts eaten'. Observe how Aaron - who is the youngest (3 years old) - > has a null value in eaten donuts. Aaron does not show up on the table... > but the value 3 is still at the far most left part of the 'age'-slider. > > > > function drawVisualization() { > // Prepare the data > var data = google.visualization.arrayToDataTable([ > ['Name', 'Gender', 'Age', 'Donuts eaten'], > ['Michael' , 'Male', 12, 5], > ['Elisa', 'Female', 20, 7], > ['Robert', 'Male', 7, 3], > ['John', 'Male', 54, 2], > ['Jessica', 'Female', 22, 6], > ['Aaron', 'Male', 3, null], > ['Margareth', 'Female', 42, 8], > ['Miranda', 'Female', 33, 6] > ]); > > // Define a slider control for the Age column. > var slider = new google.visualization.ControlWrapper({ > 'controlType': 'NumberRangeFilter', > 'containerId': 'control1', > 'options': { > 'filterColumnLabel': 'Age', > 'ui': {'labelStacking': 'vertical'} > } > }); > > // Define a slider control for the Age column. > var slider2 = new google.visualization.ControlWrapper({ > 'controlType': 'NumberRangeFilter', > 'containerId': 'control2', > 'options': { > 'filterColumnLabel': 'Donuts eaten', > 'ui': {'labelStacking': 'vertical'} > } > }); > > > > // Define a Pie chart > var pie = new google.visualization.ChartWrapper({ > 'chartType': 'PieChart', > 'containerId': 'chart1', > 'options': { > 'width': 300, > 'height': 300, > 'legend': 'none', > 'title': 'Donuts eaten per person', > 'chartArea': {'left': 15, 'top': 15, 'right': 0, 'bottom': 0}, > 'pieSliceText': 'label' > }, > // Instruct the piechart to use colums 0 (Name) and 3 (Donuts Eaten) > // from the 'data' DataTable. > 'view': {'columns': [0, 3]} > }); > > // Define a table > var table = new google.visualization.ChartWrapper({ > 'chartType': 'Table', > 'containerId': 'chart2', > 'options': { > 'width': '300px' > } > }); > > // Create a dashboard > new google.visualization.Dashboard(document.getElementById('dashboard')) > . > // Establish bindings, declaring the both the slider and the > category > // picker will drive both charts. > bind([slider, slider2], [pie, table]). > // Draw the entire dashboard. > draw(data); > } > > >> -- 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/-/z-brYN_wc00J. 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.
