Thanks for the response. I believe the data setup which you have posted will show up the ColumnChart with data for Jan 2010, Jan 2011 grouped together and shown in different colors and then Feb2010, Feb 2011 grouped together and shown with the same set of colors followed by Mar 2010, Mar2011 and so on... But the requirement here is that the chart should first display 2010 with all the months (Jan, Feb, Mar, Apr...) in one color followed by 2011 with all the months (Jan, Feb, Mar, Apr...) in another color. I hope the data setup which you have discussed here will produce a column chart as shown in the following link http://code.google.com/apis/chart/interactive/docs/gallery/columnchart.html but my requirement is that the Column chart should display a set of blue colored bars(for all the months of 2010) followed by a set of red colored bars (for all the months of 2011). Is this possible using the current version of the Visualization API? Can you please guide me?
Thanks in advance. On Apr 28, 8:18 pm, asgallant <[email protected]> wrote: > It depends on how you have your data set up. You can assign colors to (data > table) columns, so if you set it up like this: > > function drawChart() { > var data = new google.visualization.DataTable(); > data.addColumn('string', 'Month'); > data.addColumn('number', '2010'); > data.addColumn('number', '2011'); > > data.addRow(); > data.setValue(0, 0, "January"); > data.setValue(0, 1, <data for Jan 2010>); > data.setValue(0, 2, <data for Jan 2011>); > etc... > var options = {colors: ['#FF0000', '#0000FF']}; > var chart = new > google.visualization.ColumnChart(document.getElementById('chartDiv')); > chart.draw(data, options); > > } > > you get a chart of data for years grouped by months, with 2010 being red and > 2011 being blue. -- 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.
