Jack Corleone
Jack Corleone

Reputation: 43

Google Charts: How I can change "Choose a value..." in controlType: CategoryFilter of ControlWrapper

I need know how change "Choose a value..." in controlType: CategoryFilter of ControlWrapper

Example:

 // Define a category picker control for the Gender column    
var categoryPicker = new google.visualization.ControlWrapper({
          'controlType': 'CategoryFilter',
          'containerId': 'control2',
          'options': {
        'filterColumnLabel': 'Sexo',
      'ui': {
          'labelStacking': 'vertical',
              'allowTyping': false,
              'allowMultiple': false,
            }
          },
      'state': {'selectedValues': ['']} // this don't solve my problem
        }); 

This show me one select box like this:
[ Choose a value...]
[ Man ]
[ Woman ]

And I need this:
[ Choose sex...]
[ Man ]
[ Woman ]

Thanks!

Upvotes: 2

Views: 2030

Answers (1)

Johannes Kommer
Johannes Kommer

Reputation: 6451

You can use the ui.caption option to change the value displayed when nothing is selected.

Change:

  'ui': {
          'labelStacking': 'vertical',
          'allowTyping': false,
          'allowMultiple': false,
        }

to:

  'ui': {
          'labelStacking': 'vertical',
          'allowTyping': false,
          'allowMultiple': false,
          'caption' : 'Choose sex'
        }

Upvotes: 3

Related Questions