
new sg.controls.Guage()
Description
Create a Gauge object.
Position
controls.js
Parameters
Parameter
|
Type
|
Description
|
param
|
Object
|
set object
Name
|
Type
|
Description
|
maxDataValue
|
Number
|
maximum value
|
dataField
|
String
|
data field name
|
caption
|
String
|
descriptions
|
title
|
String
|
control title
|
dataLabelField
|
String
|
label field of data
|
unitLabel
|
String
|
label of unit
|
color
|
String
|
gauge color
|
|
node
|
DOMNODE
|
gauge control node
|
Methods
Method
|
Type
|
Description
|
setCaption(p)
|
String
|
set caption
Name
|
Type
|
Description
|
p
|
String
|
caption
|
|
setFeature(p)
|
sg.Graphic
|
set target graphic
Name
|
Type
|
Description
|
p
|
sg.Graphic
|
target graphic
|
|
setLabel(p)
|
String
|
set data label
Name
|
Type
|
Description
|
p
|
String
|
data label
|
|
setTitle(p)
|
String
|
set title for the gauge
Name
|
Type
|
Description
|
p
|
String
|
title for the gauge
|
|
setValue(p)
|
Number
|
set value
|
destroy()
|
none
|
remove gauge
|
startup()
|
none
|
initialize gauge
|
show
|
none
|
show gauge
|
Example
<script type="text/javascript" src="scripts/FX.js"></script>
var param = {
layer: featureLayer,
maxDataValue: 600,
dataField: "value",
unitLabel: "mm",
title: "Precipitation station",
caption: "Precipitation value",
dataLabelField: "Name"
};
var gaugeNode = document.getElementById("gaugeNode");
var gaugeControl = new sg.controls.Gauge(param, gaugeNode);
gaugeControl.startup();
|
|
See live demo
©2015 Supergeo Technologies Inc.