google.visualization.events.addListener(baselinechart[classname], 'select', function () {
selectHandler(baselinechart[classname]);
});
If that is part of a loop (or other structure in which the value of "classname" can change), then you would want to use a closure to lock the value of classname to the handler at the time when the event handler is created. It would look like this:
google.visualization.events.addListener(baselinechart[classname], 'select', (function (x) {
return function () {
selectHandler(baselinechart[x]);
}
})(classname));
which locks the value of "classname" to the internal variable "x" at the time the event handler is created. Otherwise, the event handler would use whatever the current value of classname is when the event fires.