There are a couple of things going on here: 1) you have "var data" in your code twice - one has scope in your document, while the second has scope only inside the drawing function. Unless you have functions outside the drawing function that references data and chart, you don't need to declare them outside. If you do need to reference them outside, get rid of the second "var" keyword.
2) you reference a "PieChart" variable in the drawing function, but this is not defined anywhere. 3) you are using the old PieChart API - there's nothing wrong with doing so if you need one of the features that didn't get ported over to the new version, but if you're not using them, the new one is better, IMHO. You can also pass the select handler function itself as a parameter when adding the event listener, which avoids any possible scope issues with the chart and data table variables. See one way you could do this here: http://jsfiddle.net/x9vaD/ -- 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/-/vx6VWGxhnyEJ. 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.
