SpectrumLegend Constructor

Syntax

PP.Ui.SpectrumLegend(settings);

Parameters

settings. JSON object that contains values of component properties.

Description

The SpectrumLegend constructor creates an instance of the SpectrumLegend class.

Example

To execute the example, the HTML page must contain links to the PP.js, PP.GraphicsBase.js script files, and the PP.css styles file. In the <body> tag place spectrum block that will store the created legend:

<div id="spectrum" style = "position: absolute; top:5px; left:5px; width: 610px; height: 110px; border: 1px solid #660000; "></div>

Define spectrum legend settings by placing the following code in the block <script type="text/javascript">:

Spectrum Legend Settings

Next in the <body> tag add a script that creates a legend:

<script type = "text/javascript" >
// Create a legend object
var spectrum = new PP.Ui.SpectrumLegend(settings);
// Render legend
spectrum.draw(new PP.Rect({
    Left: 7,
    Top: 0,
    Width: 600,
    Height: 110
}), document.getElementById("spectrum"));
</script>

After executing the example a spectrum legend is placed in the HTML page:

See also:

SpectrumLegend