EaxMdService.setSpeedometer

Syntax

setSpeedometer(report: PP.Exp.EaxAnalyzer, metadata: Object, callback: function|PP.Delegate);

Parameters

report. Object of express report model.

metadata. Speedometer settings.

callback. Callback function.

Description

The setSpeedometer method sets speedometer for a dashboard.

Example

Executing the example requires that the HTML page contains the KapBox component named kapBox (seesp; Example of Placing the KapBox Component). Add a speedometer to dashboard using the Visualizers button and its Indicator element on the tool ribbon.

Set light blue fill color for speedometer background:

// Get container of added speedometer
var props = kapBox.getMeta().Md.kap.block.prop;
// get key of the block containing container with speedometer
var key;
for (var i in props) {
    if (props[i].area) {
        key = kapBox.getMeta().Md.kap.block.prop[i].area["@key"];
    }
};
var block = kapBox.getBlock(key);
var dataBox = block.getDataBox();
// Get service of container and its data source
var service = dataBox.getService();
var source = dataBox.getSource();
// Get speedometer settings
var data = dataBox.getInstance().getSettings(PP.SpeedometerSettings.All, True, False,
    False, True);
// Determine a new color for speedometer background fill
var style = {    
        Release: {        
            Background: {            
                "@Enabled": True,
                "@Color": PP.Color.Colors.lightblue        
            }    
        }
    }
    // Apply style
data.Style = style;
// Set data with changed container settings
source.setGaugeChangedData(data);
source.setGaugeData(data);
// Apply new settings 
service.setSpeedometer(source, source.getGaugeData());
// Refresh container
dataBox.refreshAll();

After executing the example light blue fill color is set for speedometer background:

EaxMdService