javascript - Geochart - mark one country with a special color -
there standard example of google geochart, countries have scale color depends on value. question how mark 1 country, example canada, red one, leave countries before. ok if canada without value, how mark in color? https://jsfiddle.net/8wowo9xc/
google.setonloadcallback(drawregionsmap); function drawregionsmap() { var data = google.visualization.arraytodatatable([ ['country', 'popularity'], ['germany', 200], ['united states', 300], ['brazil', 400], ['canada', 500], ['france', 600], ['ru', 700] ]); var options = {}; var chart = new google.visualization.geochart(document.getelementbyid('regions_div')); chart.draw(data, options); }
the desire result:
if specify defaultcolor
, give canada
no value, want.
so like:
google.setonloadcallback(drawregionsmap); function drawregionsmap() { var data = google.visualization.arraytodatatable([ ['country', 'popularity'], ['germany', 200], ['united states', 300], ['brazil', 400], ['canada', null], ['france', 600], ['ru', 700] ]); var options = {defaultcolor: 'red'}; var chart = new google.visualization.geochart(document.getelementbyid('regions_div')); chart.draw(data, options); }
Comments
Post a Comment