I am fortunate enough to be able to work with the Google Visualization API frequently. I found myself writing similar code over and over and started to build out a wrapper library in my spare time.
The library is called Gable (G(oogle)+(T)able) and what it does is take semi-structured JavaScript objects and dumps them to a Google Table object literal or to CSV -- kind of like google.visualization.arrayToDataTable() but for objects of all types. It's meant to be really lightweight API, such that you can build Google visualizations in one line of JS. Examples are here: http://editor.github.com/Gable/#examples For example, a pie chart looks like this (source: ): Gable( 'food_data_pie' ) .add( { value: [ { 'Food': 'Apple Pie', 'kCal': 405 } , [ 'Beer, Light', 95 ] , [ 'Carrots, Raw, Whole', 30 ] , [ 'Doughnuts, Cake Type, Plain', 210 ] , [ 'Enchilada', 235 ] , [ 'Froot Loops Cereal', 110 ] , [ 'Grape Soda', 180 ] , [ 'Hamburger, 4oz Patty', 445 ] ], meta: { title: 'USDA Nutrient Database' } } ) .draw( { target: 'example4' , type: 'pie' , meta: { backgroundColor: '#FDF6E3' , height: 400 , series: [ { color: '#586E75' }, { color: '#EEE8D5' } ] , legend: { position: 'bottom', textStyle: { color: 'black', fontSize: 16 } } } } ); I've cross-browser tested it and am getting ready to put it into production use where I work. Before that point, I'm planning to release the code under a dual MIT/GPL license so a wider software community can enjoy the work. More examples are here: http://editor.github.com/Gable/#examples Check it out and let me know how it could be improved, or just submit a pull request on Github. I've benefitted greatly from the Visualization API and I'd love to help spur adoption of this wonderful library. Best, Taylor -- 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/-/tZO_mJgRBr8J. 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.
