I would create a DataView based on your original DataTable, and sort that.
The pass the view to the Dashboard instead of the DataTable.
On Saturday, July 12, 2014 4:43:12 PM UTC-4, AM wrote:
>
> What if I needed to filter the data for the first chart?
>
> If I already have that chart in in the dashboard initialization:
>
> var dashboard = new
> google.visualization.Dashboard(document.getElementById('chart_div1')).bind([categoryPicker1],[Chart1,Chart4]).draw(data1);
>
> I can't then do this procedure of creating new views based on the first
> table. I would need to filter it first before that dashboard draw?
>
> Would I just do a temp variable like var view1?
>
> Thanks for any feedback.
>
>
>
>
> On Friday, July 4, 2014 2:21:02 PM UTC-7, AM wrote:
>>
>> Is there a way to both sort and filter the data in a view?
>>
>>
>> var view18 = new google.visualization.DataView(dt);
>> view18.setRows(dt.getFilteredRows([{'column': 2, 'value': 'Male'}]));
>> view18.setRows(dt.getSortedRows(3));
>> Chart18.setDataTable(view18);
>> Chart18.draw();
>>
>> I'm finding that this only allows for the the filter.
>>
>
--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.