You have to change the value of the selected region's color cell in the DataTable and then redraw the chart.
On Thursday, March 21, 2013 5:33:57 AM UTC-4, KUTTIKRISHNAN P wrote: > > Hai, > > I have created geoChart of US by using below code . While clicking on any > region I would like to change the backgroud color of the clicked region. I > am able to trigger the region click event . Please help to change the > background color of the clicked region . > > <html> > <head> > <script type='text/javascript' src='https://www.google.com/jsapi > '></script> > <script type='text/javascript'> > google.load('visualization', '1', {'packages': ['geochart']}); > google.setOnLoadCallback(drawRegionsMap); > function drawRegionsMap() { > var data = google.visualization.arrayToDataTable([['State']]); > var options = { > region: 'US', > displayMode: 'region', > colorAxis: {colors: ['orange', 'blue']}, > datalessRegionColor:'F5F5F5', > enableRegionInteractivity:true, > resolution:'provinces' > }; > var chart = new > google.visualization.GeoChart(document.getElementById('chart_div')); > chart.draw(data, options); > google.visualization.events.addListener(chart, 'regionClick', > function(res){ > //var country_data = chart.getSelection(); > //chart.setSelection(); > }); > }; > </script> > </head> > <body> > <div id="chart_div" style="width: 900px; height: 500px;"></div> > </body> > </html> > > > > > > Thanks in Advance > > > > Regards, > Kutti > -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
