Do you mean like this:
function makeScorePicker(categoryName) {
return new google.visualization.ControlWrapper({
'controlType': 'CategoryFilter',
'containerId': categoryName + 'control',
'options': {
'filterColumnLabel': categoryName,
'ui': {
'allowTyping': false,
'allowMultiple': false
}
}
});
}
var compositeScorePicker = makeScorePicker('compositeScore');
Or do you want the function to assign to the variable also. If you want
that, you could (possibly) do something like this:
function assignScorePicker(categoryName) {
window[categoryName] = new google.visualization.ControlWrapper({...});
}
But that only works for a global variable.
dan
On Tue, Mar 26, 2013 at 2:27 PM, Alex Frieden <[email protected]> wrote:
> I have a bunch of controlwrappers for my google visualization dashboard in
> the form of
>
> var compositeScorePicker = new google.visualization.ControlWrapper({
> 'controlType': 'CategoryFilter',
> 'containerId': 'compositeScorecontrol',
> 'options': {
> 'filterColumnLabel': 'compositeScore',
> 'ui': {
> 'allowTyping': false,
> 'allowMultiple': false
> }
> }
> });
>
> How can I create a function that does this where I enter in
> "compositeScore" and output this variable? Thanks
>
> --
> 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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> -
978-394-1058
[email protected] <[email protected]> 562D 5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA
--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.