I have a dashboard that contains a few different charts along with a
CategoryFilter. This works great, except for when my data gets to be a
little more complex. Basically I want to be able to filter a chart based on
whether or not an array contains the selected value rather than having to
exactly match a column.
As an example, if I had a DataTable that contains t-shirt records:
var data = new google.visualization.DataTable();
data.addColumn("string", "ItemName");
data.addColumn("number", "Price");
data.addColumn("string", "Size");
data.addRows([
[ "Crew Cut", 10, "Small" ],
[ "V-Neck", 12, "Medium" ],
[ "Graphic", 15, "Medium" ]
]);
I can create a CategoryFilter easily enough to filter on sizes
var sizePicker = new google.visualization.ControlWrapper({
"controlType": "CategoryFilter",
"containerId": "size-picker",
"options": {
"filterColumnLabel": "Size"
}
});
Now lets say I want each t-shirt record to contain an array of available
colors that the shirt comes in.
So basically I'd like to have something like this for a record
[ "Crew Cut", 10, "Small", [ "Blue", "Striped", "White" ]]
Then a CategoryFilter has a list of the colors, and when a color is picked
the filter searches the array and if it contains the selected color, it's
included in the result set.
Now since DataTables don't support arrays and I can't find anything on how
to override the filtering methods, I'm not sure how to go about this. Is
this in any way possible?
--
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/groups/opt_out.