Hmmm...the documenation is rather vague there.  I suspect that, ultimately, 
what happens is that the value returned by the toString method call is used 
to filter the table, which wouldn't help you (ie, you can't create an 
object with a numerical value and a toString method that displays the 
string value in the list and uses the numerical value to filter.

There is a slightly better way to handle this than I used in my example, 
however: http://jsfiddle.net/asgallant/fqREc/2/.  This preserves the 
original value and uses the formatted value to populate the list (you can 
also achieve this by manually formatting your DataTable values).

On Thursday, October 4, 2012 5:27:17 AM UTC-4, Niv The Tool wrote:
>
> First, let me thank you.
>
> the CategoryFilter docs speaks of "values" configuration field (in options 
> section).
> and its ability to accept object array with toString inplementation
> do you know how to create such array to be assigned to the values field.
>
> 10x again.
>
> On Wednesday, October 3, 2012 8:14:46 PM UTC+2, asgallant wrote:
>>
>> To get the labels "0-Good" etc, you need to adjust the underlying data so 
>> that the control sees those strings as the column values instead of 0, 1, 
>> 2.  You can accomplish this by setting the view.columns option of the 
>> control to use a calculated column instead of the base column.  See an 
>> example here: http://jsfiddle.net/asgallant/fqREc/1/
>>
>>
>> On Wednesday, October 3, 2012 8:00:42 AM UTC-4, Niv The Tool wrote:
>>>
>>> simple is in it? but i could not find any sample code that shows the 
>>> values field usage.
>>>
>>> my datatable column can have 3 numbers only 0,1,2
>>>
>>> my category filter need to display instead of these 3 numbers text 
>>> instead like 0-Good,1-Bad,2-Fatal
>>>
>>> how is my values field should look like?
>>>
>>> many thanks in advance;
>>>
>>> can someone drop an example code
>>>
>>>             var types_slider = new google.visualization.ControlWrapper({
>>>                 'controlType': 'CategoryFilter',
>>>                 'containerId': 'types_control',
>>>                 'options': {
>>>                     'filterColumnLabel': 'Type',
>>> 'values': ????????????????????????????????????????????????
>>>                     'ui': {
>>>                         'caption': 'All',
>>>                         'labelStacking': 'horizontal',
>>>                         'allowTyping': false,
>>>                         'allowMultiple': false
>>>                     }
>>>                 }
>>>             });
>>>
>>>

-- 
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/-/ADJ41WlNzUUJ.
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