AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.utils.Error Improve this Doc

Extends: anychart.core.Base

Class representing series error.
Learn more about error chart.

Methods Overview

Specific settings
mode()Error mode settings.
valueError()Value error settings.
valueErrorWidth()Value width settings.
valueLowerError()Value lower error settings.
valueUpperError()Value upper error settings.
xError()X-error settings.
xErrorWidth()X-error width settings.
xLowerError()X lower error settings.
xUpperError()X upper error settings.
Coloring
valueErrorStroke()Value error stroke settings.
xErrorStroke()X-error stroke 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.

Methods Description

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.

mode

Getter for error mode.

Returns:

anychart.enums.ErrorMode | string - Returns error mode.
Setter for error mode.
Error mode defines the rule to parse values for series with an error.

Params:

NameTypeDefaultDescription
modeanychart.enums.ErrorMode | string
'both'
Value to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

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.

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.

valueError

Getter for value error.

Returns:

string | number - Returns value error.
Setter for value error.

Params:

NameTypeDefaultDescription
valueErrorstring | number
null
Value error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

valueErrorStroke

Getter for value error stroke settings.

Returns:

anychart.graphics.vector.Stroke - Stroke settings.
Setter for value error stroke using a function.

Params:

NameTypeDefaultDescription
strokeFunctionfunction():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like:
function(){
   // this.index - series index.
   // this.sourceColor - color returned by fill() getter.
   // this.iterator - series point iterator.
   return strokeValue; // type anychart.graphics.vector.Fill or anychart.graphics.vector.Stroke
}

Returns:

anychart.core.utils.Error - Self instance for method chaining.
Setter for value error stroke settings.

Params:

NameTypeDefaultDescription
strokeOrFillanychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null
'#1D8BD1'
Fill settings or stroke settings.
thicknessnumber
1
Line thickness.
dashpatternstring
Controls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoin
Line joint style.
lineCapstring | anychart.graphics.vector.StrokeLineCap
Line cap style.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

valueErrorWidth

Getter for value error width settings.

Returns:

number - Returns value error width.
Setter for value error width settings. Length pins for value axis in pixels.

Params:

NameTypeDefaultDescription
widthnumber
10
Value error width.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

valueLowerError

Getter for value lower error.

Returns:

string | number | undefined - Returns value lower error.
Setter for value lower error.

Params:

NameTypeDefaultDescription
valueLowerErrorstring | number
null
Value lower error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

valueUpperError

Getter for value upper error.

Returns:

string | number | undefined - Returns value lower error.
Setter for value upper error.

Params:

NameTypeDefaultDescription
valueUpperErrorstring | number
null
Value upper error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

xError

Getter for X error.

Returns:

string | number - Returns X error.
Setter for X error.

Params:

NameTypeDefaultDescription
xErrorstring | number
null
X Error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

xErrorStroke

Getter for X error stroke settings.

Returns:

anychart.graphics.vector.Stroke - Stroke settings.
Setter for the X error stroke using a function.

Params:

NameTypeDefaultDescription
strokeFunctionfunction():anychart.graphics.vector.Stroke|anychart.graphics.vector.ColoredFill
function() {
 return anychart.color.darken(this.sourceColor);
}
Function that looks like:
function(){
   // this.index - series index.
   // this.sourceColor - color returned by fill() getter.
   // this.iterator - series point iterator.
   return strokeValue; // type anychart.graphics.vector.Fill or anychart.graphics.vector.Stroke
}

Returns:

anychart.core.utils.Error - Self instance for method chaining.
Setter for X error stroke settings. Learn more about stroke settings.

Params:

NameTypeDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | nullStroke color.
thicknessnumberLine thickness.
dashpatternstringControls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoinLine joint style.
lineCapstring | anychart.graphics.vector.StrokeLineCapLine cap style.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

xErrorWidth

Getter for X error width settings.

Returns:

number - Returns X error width.
Setter for X error width settings. Length pins for X axis in pixels.

Params:

NameTypeDefaultDescription
widthnumber
10
X error width.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

xLowerError

Getter for X lower error.

Returns:

string | number | undefined - Returns X lower error.
Setter for X lower error.

Params:

NameTypeDefaultDescription
xLowerErrorstring | number
null
X lower error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.

xUpperError

Getter for X upper error.

Returns:

string | number | undefined - Returns X upper error.
Setter for X upper error.

Params:

NameTypeDefaultDescription
xUpperErrorstring | number
null
X upper error to set.

Returns:

anychart.core.utils.Error - Self instance for method chaining.