DataVisualizer.GlobalItemsIds

Syntax

GlobalItemsIds: Object

Description

The GlobalItemsIds method determines dictionary of global identifiers of items

Comments

Use JSON or the setGlobalItemsIds method to set the property value and the getGlobalItemsIds method to get the property value.

The property value is a JSON object which items are presented in following format: <internal identifier of the item: global identifier of the item>.

Dictionary of global identifiers serves to match items of express report visualizers in order to synchronize the actions as items selection or hovering over items.

Example

To execute the example, the HTML page must contain the BubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component).

Get arrays of legend identifiers and data bindings. Determine and set dictionary of global identifiers. Display to the development environment console following values:

Handle the legend items selection events:

// Get dictionary of legend mapping with data bindings
var legendMapping = bubbleChart.getLegendMapping();
// Determine arrays of legend identifiers and data bindings and fill it
var legendsIds = [];
var dataMappingsIds = [];
for (var key in legendMapping) {
    legendsIds.push(key);
    dataMappingsIds.push(legendMapping[key]);
}
// Get legend by identifier
var legend = bubbleChart.getLegendById(legendsIds[0]);
// Set dictionary of global identifiers
var globalIds = {
    Serie0_Point0: 23599
}
bubbleChart.setGlobalItemsIds(globalIds);
// Display legend size
console.log("Legend size: %sx%s", legend.getWidth(), legend.getHeight());
// Display global and internal item identifiers
console.log("Global identifier: " + bubbleChart.getGlobalItemId(bubbleChart.getBackwardGlobalItemsIds()[23599]));
console.log("Internal identifier: " + bubbleChart.getLocalItemId(23599));
// Display identifier of data binding
console.log("Identifier of data binding: " + legendMapping[legendsIds[0]]);
// Display legend identifier
var legendBackwardMapping = bubbleChart.getBackwardLegendMapping();
console.log("Legend identifier: " + legendBackwardMapping[dataMappingsIds[0]]);
// Handle events of legend items selection
bubbleChart.LegendItemSelected.add(function () {    
    console.log("The LegendItemSelected event is initialized");
});
bubbleChart.LegendItemSelecting.add(function () {    
    console.log("The LegendItemSelecting event is initiated");
});

As a result received values are displayed to the development environment console:

Legend size: 465x32

Global identifier: 23599

Internal identifier: Serie0_Point0

Data binding identifier: DataMapping257

Legend identifier: 0_BubbleChart71

On chart items selection the console also displays messages about handled event which were fired:

The LegendItemSelecting event is initialized

The event is LegendItemSelected initialized

DataVisualizer