DataVisualizer.getFirstScale

Syntax

getFirstScale();

Description

The getFirstScale method returns the first scale in chart.

Comments

The method returns an object of the PP.ScaleBase type.

Example

To execute the example, the HTML page must contain the BubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component). Change colors array for the first scale of bubble chart data mapping:

// Determine color scale
var colorScale = new PP.ScaleBase({
    Mode: "Uniform",
    Items: "#00ff00 #30cf00 #708f00 #b04f00 #f00f00",
    NoData: "#AFBFBF",
    TypeArguments: "Brush"
});
// Get the  first scale of bubble chart - the color scale
var firstScale = bubbleChart.getFirstScale();
// Get scale color set
var colorItems = firstScale.getItems();
// Change scale colors
for (var i in colorItems) {
    var item = colorItems[i];
    item.setColor(colorScale.getItems()[i].getColor());
};
// Refresh bubble chart
bubbleChart.refresh();

As a result of example executing bubble colors are changed in the first scale of bubble chart data mapping:

See also:

DataVisualizer