AnyChart
API Reference
Still have questions?
Contact support
Top

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

Extends: anychart.core.linearGauge.pointers.Base

Led pointer class.

Methods Overview

Specific Settings
id()Pointer id.
Specific settings
count()Interval settings.
labels()Labels settings.
legendItem()Legend item settings.
Axes and Scales
colorScale()Color scale settings.
scale()Scale settings.
Coloring
color()Color settings.
dimmer()Dimmer settings.
fill()Fill settings.
hatchFill()Hatch fill settings.
stroke()Stroke settings.
Data
data()Data for pointers.
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.
hovered()Hovered state settings.
normal()Normal state settings.
select()Selects a pointer.
selected()Selected state settings.
unhover()Removes hover from the pointer.
unselect()Deselects a pointer.
Size and Position
gap()Gap settings.
offset()Offset settings.
size()Size settings.
width()Width settings
zIndex()Z-index of the element.

Methods Description

color

Getter for the pointer color.

Returns:

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

Params:

NameTypeDescription
colorstringColor as a string.

Returns:

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

colorScale

Getter for the led color scale.
See listing
var ledPointer = chart.led(2);
var colorScale = ledPointer.colorScale();
Setter for the led color scale.

Params:

NameTypeDescription
colorScaleanychart.scales.LinearColor | anychart.scales.OrdinalColorLed color scale.

Returns:

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

count

Getter for the led interval.

Returns:

number - The led interval.
See listing
var ledPointer = chart.led(2);
var count = ledPointer.count();
Setter for the led interval.

Params:

NameTypeDefaultDescription
countnumber
null
Led interval.

Returns:

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

data

Getter for pointers data.

Returns:

anychart.data.View - Pointers data.
See listing
var pointer = pointer.data();
Getter for pointers data.

Params:

NameTypeDescription
dataanychart.data.View | anychart.data.Set | Array | stringData to set.
csvSettingsanychart.enums.TextParsingMode | anychart.data.TextParsingSettingsIf CSV string is passed, you can pass CSV parser settings here as a hash map.

Returns:

anychart.core.linearGauge.pointers.Led - 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.Led - Self instance for method chaining.

dimmer

Getter for the dimmer.
See listing
var ledPointer = chart.led(2);
var dimmer = ledPointer.dimmer();
Setter for the dimmer.

Params:

NameTypeDescription
dimmerFunctionfunction(fill:anychart.graphics.vector.Fill):anychart.graphics.vector.FillDimmer function.

Returns:

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

enabled

Getter for the element state (enabled or disabled).

Returns:

boolean - Element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
enabledboolean
true
Enabled state to set.

Returns:

anychart.core.linearGauge.pointers.Led - 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, an object or a string. Learn more about coloring.

Params:

NameTypeDescription
coloranychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)>Color as an object, an array or a string.

Returns:

anychart.core.linearGauge.pointers.Led - 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.Led - 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.Led - 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.Led - Self instance for method chaining.

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

gap

Getter for the led gap.

Returns:

number | string - The led gap.
Setter for the led gap.

Params:

NameTypeDefaultDescription
gapnumber | string
'1%'
Led gap.

Returns:

anychart.core.linearGauge.pointers.Led - 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
typeanychart.graphics.vector.HatchFill.HatchFillType | string
false
Type of hatch fill.
colorstring
Color.
thicknessnumber
Thickness.
sizenumber
Pattern size.

Returns:

anychart.core.linearGauge.pointers.Led - Self instance for method chaining.
Setter for hatch fill settings using function. Learn more about coloring.

Params:

NameTypeDescription
hatchFillFunctionfunctionHatchFill function.

Returns:

anychart.core.linearGauge.pointers.Led - Self instance for method chaining.
Setter for hatch fill settings using pattern fill. Learn more about coloring.

Params:

NameTypeDescription
patternFillanychart.graphics.vector.PatternFillPattern fill to set.

Returns:

anychart.core.linearGauge.pointers.Led - Self instance for method chaining.
Setter for hatch fill settings using an instance. Learn more about coloring.

Params:

NameTypeDescription
settingsanychart.graphics.vector.HatchFillHatch fill instance.

Returns:

anychart.core.linearGauge.pointers.Led - Self instance for method chaining.
Setter for hatch fill using boolean. Learn more about hatch fill settings.

Params:

NameTypeDefaultDescription
enabledboolean
false
Whether to enable hatch fill or no.

Returns:

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

hover

Hovers a pointer.

Returns:

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

hovered

Getter for hovered state settings.

Returns:

anychart.core.StateSettings - Hovered state settings
Setter for hovered state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

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

id

Getter for the pointer id.

Returns:

anychart.core.gauge.pointers.Base - Self instance for method chaining.
See listing
var id = pointer.id();
Setter for the pointer id.

Params:

NameTypeDefaultDescription
idstring | number
0
Pointer id to set.

Returns:

anychart.core.gauge.pointers.Base - Self instance for method chaining.

labels

Getter for the pointer labels.

Returns:

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

Params:

NameTypeDescription
settingsanychart.core.ui.LabelsFactory | Object | booleanPointer labels settings.

Returns:

anychart.core.linearGauge.pointers.Led - 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
settingsObjectLegend item settings to set.

Returns:

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

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
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(e:Object)
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
namestringPointer name to set.

Returns:

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

normal

Getter for normal state settings.

Returns:

anychart.core.StateSettings - Normal state settings.
Setter for normal state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

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

offset

Getter for the pointer offset.

Returns:

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

Params:

NameTypeDefaultDescription
offsetstring | number
'0%'
Pointer offset to set.

Returns:

anychart.core.linearGauge.pointers.Led - 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:

NameTypeDefaultDescription
scaleanychart.scales.Base
anychart.scales.Linear
Pointer scale.

Returns:

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

select

Selects a pointer.

Params:

NameTypeDescription
eventanychart.core.MouseEventEvent that initiate point selecting.

Returns:

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

selected

Getter for selected state settings.

Returns:

anychart.core.StateSettings - Selected state settings
Setter for selected state settings.

Params:

NameTypeDescription
settingsObjectState settings to set.

Returns:

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

size

Getter for the led size.

Returns:

number | string - The led size.
Setter for the led size.

Params:

NameTypeDefaultDescription
sizenumber | string
'2%'
Led size.

Returns:

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

stroke

Setter for the pointer stroke using function. Learn more about stroke settings.

Params:

NameTypeDefaultDescription
strokeFunctionfunction():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill
// 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.Led - 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 | null
Stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line join style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.linearGauge.pointers.Led - Self instance for method chaining.
Setter for the pointer stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

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

unhover

Removes hover from the pointer.

Returns:

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

unlisten

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

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object):boolean|undefined
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.Led - Self instance for method chaining.

width

Getter for the pointer width.

Returns:

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

Params:

NameTypeDefaultDescription
widthstring
'10%'
Pointer width

Returns:

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

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

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