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: 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

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

Kivy: Swiping (Carousel & ScreenManager) -