AnyChart
API Reference
Still have questions?
Contact support
Top
You are looking at an outdated v7 version of this document. Switch to the v8 version to see the up to date information.

class anychart.core.linearGauge.pointers.Thermometer Improve this Doc

Extends: anychart.core.linearGauge.pointers.Base

Thermometer pointer class.

Methods Overview

Specific settings
hoverLabel()Hover label settings.
label()Label settings.
legendItem()Legend item settings.
selectLabel()Select label settings.
Axes and Scales
scale()Scale settings.
Coloring
color()Color settings.
fill()Fill settings.
hatchFill()Hatch fill settings.
hoverFill()Fill settings.
hoverHatchFill()Hatch fill settings.
hoverStroke()Stroke settings.
selectFill()Select fill settings.
selectHatchFill()Hatch fill settings.
selectStroke()Stroke settings.
stroke()Stroke settings.
Data
dataIndex()Pointer name settings.
name()Pointer name settings.
Events
listen()Adds an event listener.
listenOnce()Adds a single time event listener.
removeAllListeners()Removes all listeners.
unlisten()Removes the listener.
unlistenByKey()Removes the listener by the key.
Export
print()Prints all elements.
Gauges
getGauge()Getter for the gauge.
Interactivity
enabled()Element state (enabled or disabled).
hover()Hovers a pointer.
select()Selects a pointer.
unhover()Removes hover from the pointer.
unselect()Deselects a pointer.
Size and Position
bulbPadding()Bulb padding settings
bulbRadius()Bulb radius settings.
offset()Offset settings.
width()Width settings
zIndex()Z-index of the element.

Methods Description

bulbPadding

Getter for the bulb padding.

Returns:

string | number - The bulb padding.
Setter for the bulb padding.

Params:

NameTypeDefaultDescription
valuestring | number
"3%"
Bulb padding to set.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

bulbRadius

Getter for the bulb radius.

Returns:

string - The bulb radius.
Setter for the bulb radius.

Params:

NameTypeDescription
valuestringBulb radius to set.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

color

Getter for the pointer color.

Returns:

string - The pointer color.
Setter for the pointer color.

Params:

NameTypeDescription
valuestringColor as a string.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

dataIndex

Getter for the data index.

Returns:

number - Data index.
Setter for the data index.

Params:

NameTypeDescription
indexnumberData index to set.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

enabled

Getter for the current element state (enabled or disabled).

Returns:

boolean - The current element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
valueboolean
true
Value to set.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

fill

Getter for the pointer fill color.

Returns:

anychart.graphics.vector.Fill | function - Pointer fill color.
Setter for fill settings using an array or a string. Learn more about coloring.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Fill
Color as an object or a string.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

getGauge

hatchFill

Getter for pointer hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function - The pointer hatch fill.
Setter for hatch fill settings.

Params:

NameTypeDefaultDescription
patternFillOrTypeanychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string | boolean
false
PatternFill or HatchFill instance or type of hatch fill.
colorstring
Color.
thicknessnumber
Thickness.
sizenumber
Pattern size.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

hover

Hovers a pointer.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

hoverFill

Getter for the hover fill color.

Returns:

anychart.graphics.vector.Fill | function - Pointer hover fill color.
Setter for the hover fill settings using an array or a string. Learn more about coloring.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Fill
Color as an object or a string.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

hoverHatchFill

Getter for pointer hover hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function - Pointer hover hatch fill settings.
Setter for hover hatch fill settings.

Params:

NameTypeDefaultDescription
patternFillOrTypeanychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string | boolean
false
PatternFill or HatchFill instance or type of hatch fill.
colorstring
Color.
thicknessnumber
Thickness.
sizenumber
Pattern size.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

hoverLabel

Getter for the pointer hover label.

Returns:

anychart.core.ui.LabelsFactory - Labels factory instance.
Setter for the pointer hover label.

Params:

NameTypeDescription
valueanychart.core.ui.LabelsFactory | Object | booleanPointer label settings.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

hoverStroke

Getter for the pointer hover stroke.

Returns:

anychart.graphics.vector.Stroke | function - The pointer hover stroke.
Setter for the pointer hover stroke using function. Learn more about hoverStroke settings.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Stroke | function
// return hoverStroke from the default palette.
function() {
  return anychart.color.darken(this.sourceColor);
};
or Stroke, or Stroke-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Stroke - hoverStroke of the current point // } return myStroke; //anychart.graphics.vector.Stroke };.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Setter for the pointer hover stroke using several parameters. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to hoverStroke paths.
lineJoinanychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapanychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

label

Getter for the pointer label.

Returns:

anychart.core.ui.LabelsFactory - Labels factory instance.
Setter for the pointer label.

Params:

NameTypeDescription
valueanychart.core.ui.LabelsFactory | Object | booleanPointer label settings.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

legendItem

Getter for the legend item settings.

Returns:

anychart.core.utils.LegendItemSettings - Legend item settings.
Setter for the legend item settings.

Params:

NameTypeDescription
valueObjectLegend item settings object.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method. Function that looks like function(event){ // event.actualTarget - actual event target // event.currentTarget - current event target // event.iterator - event iterator // event.originalEvent - original event // event.point - event point // event.pointIndex - event point index }.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

name

Getter for the pointer name.

Returns:

string - The pointer name.
Setter for the pointer name.

Params:

NameTypeDescription
valuestringPointer name.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

offset

Getter for the pointer offset.

Returns:

string - The pointer offset.
Setter for the pointer offset.

Params:

NameTypeDescription
valuestringPercent offset.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

print

Prints all elements on related stage.

Params:

NameTypeDefaultDescription
paperSizeOrOptionsanychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscapeboolean
false
Flag of landscape.

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

scale

Getter for the pointer scale.

Returns:

anychart.scales.Base - Pointer scale.
Setter for the pointer scale.

Params:

NameTypeDescription
valueanychart.scales.BasePointer scale.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

select

Selects a pointer.

Params:

NameTypeDescription
eventanychart.core.MouseEventEvent that initiate point selecting.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

selectFill

Getter for the select fill color.

Returns:

anychart.graphics.vector.Fill | function - Pointer fill color.
Setter for the select fill settings using an array or a string. Learn more about coloring.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Fill
Color as an object or a string.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDescription
colorstringColor as a string.
opacitynumberColor opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

selectHatchFill

Getter for pointer select hatch fill settings.

Returns:

anychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function - The pointer select hatch fill.
Setter for the pointer select hatch fill settings.

Params:

NameTypeDefaultDescription
patternFillOrTypeanychart.graphics.vector.PatternFill | anychart.graphics.vector.HatchFill | function | anychart.graphics.vector.HatchFill.HatchFillType | string | boolean
false
PatternFill or HatchFill instance or type of hatch fill.
colorstring
Color.
thicknessnumber
Thickness.
sizenumber
Pattern size.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

selectLabel

Getter for the pointer select label.

Returns:

anychart.core.ui.LabelsFactory - Labels factory instance.
Setter for the pointer select label.

Params:

NameTypeDescription
valueanychart.core.ui.LabelsFactory | ObjectPointer select label.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

selectStroke

Getter for the pointer select stroke.

Returns:

anychart.graphics.vector.Stroke | function - The pointer select stroke.
Setter for the pointer select stroke using function. Learn more about selectStroke settings.

Params:

NameTypeDefaultDescription
valuefunction
// return selectStroke from the default palette.
function() {
  return anychart.color.darken(this.sourceColor);
};
or Stroke, or Stroke-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Stroke - selectStroke of the current point // } return myStroke; //anychart.graphics.vector.Stroke };.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Setter for the pointer select stroke using several parameters. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to selectStroke paths.
lineJoinanychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapanychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

stroke

Getter for the pointer stroke.

Returns:

anychart.graphics.vector.Stroke | function - The pointer stroke.
Setter for the pointer stroke using function. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
valueanychart.graphics.vector.Stroke | function
// return stroke from the default palette.
function() {
  return anychart.color.darken(this.sourceColor);
};
or Stroke, or stroke-function, which should look like:function() { // this: { // index : number - the index of the current point // sourceColor : anychart.graphics.vector.Stroke - stroke of the current point // } return myStroke; //anychart.graphics.vector.Stroke };.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.
Setter for the pointer stroke using several parameters. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinanychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapanychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

unhover

Removes hover from the pointer.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

unselect

Deselects a pointer.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

width

Getter for the pointer width.

Returns:

string - The pointer width.
Setter for the pointer width.

Params:

NameTypeDefaultDescription
valuestring
"10%"
Pointer width

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
valuenumber
0
Value to set.

Returns:

anychart.core.linearGauge.pointers.Thermometer - Self instance for method chaining.