Hi,
In JavaScript, there is no difference between accessing a field using
".fieldname" ad using ['fieldname'].

Is there a chance you are missing something else?

BTW: Here is a snipped from Chrome debugger:
x = {}
Object
x.y = {}
Object
x.y.z = function A(asd){this.asd = asd}
function A(asd){this.asd = asd}
new x.y['z']('wow')
A

   1. asd: "wow"
   2. __proto__: A
   3.


On Mon, Feb 7, 2011 at 9:18 PM, Yottagray <[email protected]> wrote:

> Hello, I am trying to develop a generic visualization function and I
> am having trouble with the following:
>
> var foo = new
> google.visualization.Table(document.getElementById(div));
>
> It's obviously easy here to pass in the id of the div you want, but I
> want to change which type of visualization is being used.
> In other words I want to change "Table" in the above code to whatever
> I pass as a variable. Any ideas how I can alter the above code to do
> this?
>
> I tried doing it as follows but it failed miserably:
>
> var table = new google.visualization[variable_in_question]
> (document.getElementById(divId));
>
> You guys have a better way?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> 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.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
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