MapChart.getBarLayer

Syntax

getBarLayer();

Description

The getBarLayer method returns the layer of map bar factors.

Comments

The method returns a value of the SVGElement type.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Show all available bar factors in the map and set 50% transparency for these factors:

// Get map bar factors
var barVisual = map.getLayer("Regions").getVisuals().BarVisual;
// Show the bar factors in the map
barVisual.setVisibility(PP.Ui.Visibility.Visible);
// Redraw the map
map.draw();
// Get bar factors layer
var barLayer = map.getBarLayer();
// Set layer transparency to 50%
barLayer.style.opacity = 0.5;

After executing the example the map shows all available bar factors with 50% transparency:

See also:

MapChart