MapChart.HoveredBars

Syntax

HoveredBars: Object;

Description

The HoveredBars property determines an array of bar factors for which hovering is set.

Comments

Use JSON or the setHoveredBars method to set the property value and the getHoveredBars method to get the property value.

The property contains an object of the format: {<bar_id>: {<mapping_id>: true}}.

Example

To execute the example the HTML page must contain the MapChart component named map containing bar factors (see MapBar Constructor):

// Get accident bar factor
bar = mapBar.getLayer().getMapBarCollection()[3];
// Set visibility
bar.setIsVisible(true); 
map.refresh();
// Get bar factor identifier
barId = bar.getId();
// get data mapping identifier
barV = bar.getVisual();
dMapId = barV.getColorMappingsId();
// Select bar factor
selBar = {};
selBar[barId] = {};
selBar[barId][dMapId] = true;
map.setSelectedBars(selBar);
// Check attribute of hovering over bar factors
console.debug(map.getHoveredBars());

After executing the example selecting is set for the bar factor with the 3 index. The console shows identifiers of bar factors to which hovering is applied (the mouse cursor is hovered).

See also:

MapChart