TAGS :Viewed: 2 - Published at: a few seconds ago

[ Setting custom colors in Highcharts drill-down maps ]

I'm trying to set different colors for each region on Highcharts JS drill-down map, but dont know how to do it.

The only option I yet found is to change map color for all regions - set nullColor option - but that's not what I need for it sets just one color for entire map, not a custom color for a specific region within a map

Answer 1

Ok. This is a piece of code which makes an entire map a deep blue:

series: [{
            useHTML: true,
            // Use the gb-all map with no data as a basemap
            mapData: Highcharts.maps['/highcharts-infographics/js/ru-all.js'],
            name: 'Basemap',
            borderColor: '#A0A0A0',
            nullColor: 'rgb(0, 0, 128)',
            showInLegend: false

nullColor here sets one color for entire map

Answer 2

Based on this Highmaps demo (http://www.highcharts.com/maps/demo/category-map), it appears you can accomplish what you need by setting each region as its own series, and then defining the specific color in that series. This may require you to split up the data per region, rather than a single country.