addItem (value)
value. Item value.
The addItem method adds an item to scale.
To execute the example, the HTML page must contain the MapChart component (see Placing of Map on a HTML Page) named map, XML file with settings of map and the Russia.svg topobase.
The XML file must contain settings of the fill factor that is the first located in the list of map factors. Fill background - dependency object, for which scale is set up.
Let us create the scaleSet() to edit scale colors:
function scaleSet() {
scale = map.getFirstVisual().getBackground().getMapScale();
scale.clearItems();//remove scale items
scale.addItem("Green");
scale.addItem("Yellow");
scale.addItem("Orange");
scale.addItem("Red");
map.draw();
}
map.Loaded.add(scaleSet);
After executing the example map fill colors are changed:
See also: