How to use Thresholds to Color the Map
Overview
Thresholds is the best way to color the map, they allow to predefine rules and apply colors to regions, based on some data attached to the map.
There are two types of thresholds - Custom (when you can define a set of rules and specify colors) and Automatic (choose one of automatic thresholding method and AnyChart will do the rest).
In this article both Custom and Automatic thresholds are demonstrated.
Custom Thresholds
Every custom thresholds is a set of rules that define the color for the region basing on some data attached to the map, to leran how to attach data to the map see Attaching Data to a Map tutorial, to learn more about conditions (rules) and threshold configuration - see Thresholds Tutorial.
In the sample below we will display a map of China, and color China provinces according to Illiteracy Rate. We will define a custom threshold that will color provinces with Illiteracy Rate higher than 40% in "Red", from 10% to 40% percents in "Gold" and lower than 10% - in "Green".
That is how this custom threshold is defined:
And it is simply applied to all data on the chart:
Please note that the data values are set as (for example):
But on the labels and in tooltips you can see this value as 3.85% - it is done using AnyChart number formatting feature:
Automatic Thresholds
Automatic thresholds is a great feature for map coloring, they allow to create the thematic maps (choropleth maps) in which areas are shaded in proportion to the measurement of the statistical variable being displayed on the map.
Let's create the same China Illiteracy Rate map using one of the automatic thresholds type, to learn about available types please study the Automatic Thresholds.