I'm currently in the process of trying to refactor code and noticed a 
pretty common scenario when working with the chartwrapper object throughout 
my code, e.g.:
*
                chart.setChartType data.type
                chart.setDataTable tables[ti - data.tables.length]
                chart.setOptions data.options
                chart.setOption "width", div.width()
                chart.draw div.get(0)*

So I thought to myself, "Hey! This this would look a lot better if I simply 
chained all of these methods together?" Which would look like this in 
coffeescript:

* chart.setChartType(data.type).setDataTable(tables[ti - 
data.tables.length]).setOptions(data.options).setOption("width", 
div.width()).draw div.get(0)*

Beautiful! Alas, it wouldn't run as none of these chartwrapper methods have 
any return values. Is there perhaps some sort of design consideration for 
why these methods don't have return values? Does anybody see value in 
adding something like this to the API?

-- 
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/-/KgWY3LHY82wJ.
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