javascript - Google Geochart: Improper colour code for the disputed for area -
i using google geochart api implementing state wise report indian political map. used following code:
google.load('visualization', '1', {'packages': ['geochart']}); google.setonloadcallback(drawvisualization); function drawvisualization() { var data = new google.visualization.datatable(); data.addcolumn('string', 'country'); data.addcolumn('number', 'value'); data.addcolumn({type:'string', role:'tooltip'}); var ivalue = new array(); data.addrows([[{v:'in-ap',f:'andhra pradesh'}, 5,'5']]); ivalue['in-ap'] = 'http://en.wikipedia.org/wiki/andhra_pradesh'; data.addrows([[{v:'in-ar',f:'arunachal pradesh'},4,'4']]); ivalue['in-ar'] = 'http://en.wikipedia.org/wiki/arunachal_pradesh'; data.addrows([[{v:'in-as',f:'assam'},2,'2']]); ivalue['in-as'] = 'http://en.wikipedia.org/wiki/assam'; data.addrows([[{v:'in-br',f:'bihar'},3,'3']]); ivalue['in-br'] = 'http://en.wikipedia.org/wiki/bihar'; data.addrows([[{v:'in-ct',f:'chhattisgarh'},4,'4']]); ivalue['in-ct'] = 'http://en.wikipedia.org/wiki/chhattisgarh'; data.addrows([[{v:'in-ga',f:'goa'},5,'5']]); ivalue['in-ga'] = 'http://en.wikipedia.org/wiki/goa'; data.addrows([[{v:'in-gj',f:'gujarat'},6,'6']]); ivalue['in-gj'] = 'http://en.wikipedia.org/wiki/gujarat'; data.addrows([[{v:'in-hr',f:'haryana'},7,'7']]); ivalue['in-hr'] = 'http://en.wikipedia.org/wiki/haryana'; data.addrows([[{v:'in-hp',f:'himachal pradesh'},7,'3']]); ivalue['in-hp'] = 'http://en.wikipedia.org/wiki/himachal_pradesh'; data.addrows([[{v:'in-jk',f:'jammu , kashmir'},3,'3']]); ivalue['in-jk'] = 'http://en.wikipedia.org/wiki/jammu_and_kashmir'; data.addrows([[{v:'in-jh',f:'jharkhand'},4,'4']]); ivalue['in-jh'] = 'http://en.wikipedia.org/wiki/jharkhand'; data.addrows([[{v:'in-ka',f:'karnataka'},8,'8']]); ivalue['in-ka'] = 'http://en.wikipedia.org/wiki/karnataka'; data.addrows([[{v:'in-kl',f:'kerala'},7,'7']]); ivalue['in-kl'] = 'http://en.wikipedia.org/wiki/kerala'; data.addrows([[{v:'in-mp',f:'madhya pradesh'},8,'8']]); ivalue['in-mp'] = 'http://en.wikipedia.org/wiki/madhya_pradesh'; data.addrows([[{v:'in-mh',f:'maharashtra'},9,'9']]); ivalue['in-mh'] = 'http://en.wikipedia.org/wiki/maharashtra'; data.addrows([[{v:'in-mn',f:'manipur'},7,'7']]); ivalue['in-mn'] = 'http://en.wikipedia.org/wiki/manipur'; data.addrows([[{v:'in-ml',f:'meghalaya'},4,'4']]); ivalue['in-ml'] = 'http://en.wikipedia.org/wiki/meghalaya'; data.addrows([[{v:'in-mz',f:'mizoram'},3,'3']]); ivalue['in-mz'] = 'http://en.wikipedia.org/wiki/mizoram'; data.addrows([[{v:'in-nl',f:'nagaland'},2,'2']]); ivalue['in-nl'] = 'http://en.wikipedia.org/wiki/nagaland'; data.addrows([[{v:'in-or',f:'orissa'},4,'4']]); ivalue['in-or'] = 'http://en.wikipedia.org/wiki/orissa'; data.addrows([[{v:'in-pb',f:'punjab'},5,'5']]); ivalue['in-pb'] = 'http://en.wikipedia.org/wiki/punjab'; data.addrows([[{v:'in-rj',f:'rajasthan'},7,'7']]); ivalue['in-rj'] = 'http://en.wikipedia.org/wiki/rajasthan'; data.addrows([[{v:'in-sk',f:'sikkim'},4,'4']]); ivalue['in-sk'] = 'http://en.wikipedia.org/wiki/sikkim'; data.addrows([[{v:'in-tn',f:'tamil nadu'},8,'8']]); ivalue['in-tn'] = 'http://en.wikipedia.org/wiki/tamil_nadu'; data.addrows([[{v:'in-tr',f:'tripura'},3,'3']]); ivalue['in-tr'] = 'http://en.wikipedia.org/wiki/tripura'; data.addrows([[{v:'in-ut',f:'uttarakhand'},4,'4']]); ivalue['in-ut'] = 'http://en.wikipedia.org/wiki/uttarakhand'; data.addrows([[{v:'in-up',f:'uttar pradesh'},8,'8']]); ivalue['in-up'] = 'http://en.wikipedia.org/wiki/uttar_pradesh'; data.addrows([[{v:'in-wb',f:'west bengal'},7,'7']]); ivalue['in-wb'] = 'http://en.wikipedia.org/wiki/west_bengal'; data.addrows([[{v:'in-an',f:'andaman , nicobar islands'},2,'2']]); ivalue['in-an'] = 'http://en.wikipedia.org/wiki/andaman_and_nicobar_islands'; data.addrows([[{v:'in-ch',f:'chandigarh'},6,'6']]); ivalue['in-ch'] = 'http://en.wikipedia.org/wiki/chandigarh'; data.addrows([[{v:'in-dn',f:'dadra , nagar haveli'},4,'4']]); ivalue['in-dn'] = 'http://en.wikipedia.org/wiki/dadra_and_nagar_haveli'; data.addrows([[{v:'in-dd',f:'daman , diu'},2,'2']]); ivalue['in-dd'] = 'http://en.wikipedia.org/wiki/daman_and_diu'; data.addrows([[{v:'in-dl',f:'delhi'},10,'10']]); ivalue['in-dl'] = 'http://en.wikipedia.org/wiki/delhi'; data.addrows([[{v:'in-ld',f:'lakshadweep'},1,'1']]); ivalue['in-ld'] = 'http://en.wikipedia.org/wiki/lakshadweep'; data.addrows([[{v:'in-py',f:'puducherry (pondicherry)'},6,'6']]); ivalue['in-py'] = 'http://en.wikipedia.org/wiki/puducherry'; var options = { backgroundcolor: {fill:'#ffffff',stroke:'#ffffff' ,strokewidth:0 }, coloraxis: {colors: ['yellow','orange', 'red']}, backgroundcolor: {fill:'#ffffff',stroke:'#ffffff' ,strokewidth:0 }, datalessregioncolor: '#ffffff', displaymode: 'regions', enableregioninteractivity: 'true', resolution: 'provinces', sizeaxis: {minvalue: 1, maxvalue:1,minsize:10, maxsize: 10}, region:'in', keepaspectratio: true, width:800, height:500, tooltip: {textstyle: {color: '#444444'}, trigger:'focus'} }; var chart = new google.visualization.geochart(document.getelementbyid('visualization')); google.visualization.events.addlistener(chart, 'select', function() { var selection = chart.getselection(); if (selection.length == 1) { var selectedrow = selection[0].row; var selectedregion = data.getvalue(selectedrow, 0); if(ivalue[selectedregion] != '') { window.open(ivalue[selectedregion]); } } }); chart.draw(data, options); }
in this, top state ie. jammu , kashmir disputed. there way can implement 1 of following:
1. either can remove disputed area , show whole state is, proper colour.
2. or how, show disputed state's having same colour disputed , undisputed area.
can have more 1 "region" in options "resolution: 'provinces' "?
please help!!
not complete answer , confess don't know aspect of google.maps says here :
the inner workings of map types within maps api advanced topic. developers can use basic map types noted below. however, can define own map tiles using custom map types or modify presentation of existing map types using styled maps. when providing custom map types, need understand how modify map's map type registry.
with effort, should provide mechanism can offer own recolored map tiles disputed region.
Comments
Post a Comment