ScaleBase.addItem

Syntax

addItem (value)

Parameters

value. Item value.

Description

The addItem method adds an item to scale.

Example

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:

ScaleBase