getState();
The getState method returns bubble chart settings.
This method returns a value of the following type: PP.Ui.PropertyChangedEventArgs.
To execute this example, the HTML page must contain the BubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component). Place elements of bubble chart legend as two columns, and process the Refreshed event:
// Process the Refreshed event
bubbleChart.Refreshed.add(function (sender, args) {
// Output name and value of changed setting
console.log("Changed setting name: " + args.getMetadata().Name);
console.log("New name of setting: " + args.getMetadata().Value);
})
if (bubbleChart.isLoaded()) {
// Get bubble chart settings
var state = bubbleChart.getState();
// Get name and value of the setting that determines the number of columns in the bubble chart legend
var metadataArray = state.getMetadata();
var metadata = null;
for (var i = 0; i < metadataArray.length; i++) {
var m = metadataArray[i];
if (m.Name = "chartmaster.legendpanel.columnscount") {
metadata = m;
metadata.Value = 2; // Display the legend in tow columns
break;
}
}
// Determine settings for displaying the legend that describes bubble chart value intervals in tow columns
var args = new PP.Ui.PropertyChangedEventArgs({
PropertyName: "BubbleChartSettings",
Metadata: metadata
});
// Refresh bubble chart by applying new settings
bubbleChart.refreshView(args);
} else {
console.log("bubble chart is not loaded.");
};
After executing the example elements of bubble chart legend are placed in two columns:

After value of the setting that determines the number of columns in bubble chart legend is refreshed, and the Refreshed event is processed, the browser console displays name and value of this setting:
Name of the changed setting: chartmaster.legendpanel.columnscount
Its new value: 2
See also: