Namespace: Highcharts

Highcharts

The Highcharts object is the placeholder for all other members, and various utility functions. The most important member of the namespace would be the chart constructor.

Example

var chart = Highcharts.chart('container', { ... });

Classes

Axis
Chart
Data
Earcon
Instrument
Legend
PlotLineOrBand
Point
Pointer
Series
SVGElement
SVGRenderer
Time

Members

<static> charts :Array.<Highcharts.Chart>

An array containing the current chart objects in the page. A chart's position in the array is preserved throughout the page's lifetime. When a chart is destroyed, the array item becomes undefined.

Type:

<static> dateFormats :Highcharts.Dictionary.<Highcharts.TimeFormatCallbackFunction>

A hook for defining additional date format specifiers. New specifiers are defined as key-value pairs by using the specifier as key, and a function which takes the timestamp as value. This function returns the formatted portion of the date.

Type:
Try it

<static> defaultOptions :Highcharts.Options

Global default settings.

Type:
  • Highcharts.Options

<static> maps :Highcharts.Dictionary.<Highcharts.MapDataObject>

Contains all loaded map data for Highmaps.

Type:

<static> sonification :Highcharts.SonificationObject

Global classes and objects related to sonification.

Type:

<static> time :Highcharts.Time

Global Time object with default options. Since v6.0.5, time settings can be applied individually for each chart. If no individual settings apply, this Time object is shared by all instances.

Type:

Methods

<static> addEvent(el, type, fn, options)

Add an event listener.

Parameters:
Name Type Description
el T

The element or object to add a listener to. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object.

type string

The event type.

fn Highcharts.EventCallbackFunction.<T>

The function callback to execute when the event is fired.

options Highcharts.Dictionary.<*>

Event options

Properties
Name Type Description
order number

The order the event handler should be called. This opens for having one handler be called before another, independent of in which order they were added.

Returns:
function .

A callback function to remove the added event.

<static> animate(el, params [, opt])

The global animate method, which uses Fx to create individual animators.

Parameters:
Name Type Argument Description
el Highcharts.HTMLDOMElement | Highcharts.SVGElement

The element to animate.

params Highcharts.HTMLAttributes | Highcharts.SVGAttributes

An object containing key-value pairs of the properties to animate. Supports numeric as pixel-based CSS properties for HTML objects and attributes for SVGElements.

opt Highcharts.AnimationOptionsObject <optional>

Animation options.

<static> animObject(animation)

Get the animation in object form, where a disabled animation is always returned as { duration: 0 }.

Parameters:
Name Type Description
animation boolean | Highcharts.AnimationOptionsObject

An animation setting. Can be an object with duration, complete and easing properties, or a boolean to enable or disable.

Returns:
Highcharts.AnimationOptionsObject .

An object with at least a duration property.

<static> arrayMax(data)

Non-recursive method to find the lowest member of an array. Math.max raises a maximum call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This method is slightly slower, but safe.

Parameters:
Name Type Description
data Array

An array of numbers.

Returns:
number .

The highest number.

<static> arrayMin(data)

Non-recursive method to find the lowest member of an array. Math.min raises a maximum call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This method is slightly slower, but safe.

Parameters:
Name Type Description
data Array

An array of numbers.

Returns:
number .

The lowest number.

<static> attr(elem [, prop] [, value])

Set or get an attribute or an object of attributes. To use as a setter, pass a key and a value, or let the second argument be a collection of keys and values. To use as a getter, pass only a string as the second argument.

Parameters:
Name Type Argument Description
elem Highcharts.HTMLDOMElement | Highcharts.SVGDOMElement

The DOM element to receive the attribute(s).

prop string | Highcharts.HTMLAttributes | Highcharts.SVGAttributes <optional>

The property or an object of key-value pairs.

value string <optional>

The value if a single property is set.

Returns:
* .

When used as a getter, return the value.

<static> chart( [renderTo], options [, callback])

Factory function for basic charts.

Parameters:
Name Type Argument Description
renderTo string | Highcharts.HTMLDOMElement <optional>

The DOM element to render to, or its id.

options Highcharts.Options

The chart options structure.

callback Highcharts.ChartCallbackFunction <optional>

Function to run when the chart has loaded and and all external images are loaded. Defining a chart.event.load handler is equivalent.

Returns:
Highcharts.Chart .

Returns the Chart object.

Example
// Render a chart in to div#container
var chart = Highcharts.chart('container', {
    title: {
        text: 'My chart'
    },
    series: [{
        data: [1, 3, 2, 4]
    }]
});

<static> clearTimeout(id)

Internal clear timeout. The function checks that the id was not removed (e.g. by chart.destroy()). For the details see issue #7901.

Parameters:
Name Type Description
id number

Id of a timeout.

<static> correctFloat(num [, prec])

Fix JS round off float errors.

Parameters:
Name Type Argument Default Description
num number

A float number to fix.

prec number <optional>
14

The precision.

Returns:
number .

The corrected float number.

<static> createElement(tag [, attribs] [, styles] [, parent] [, nopad])

Utility function to create an HTML element with attributes and styles.

Parameters:
Name Type Argument Default Description
tag string

The HTML tag.

attribs Highcharts.HTMLAttributes <optional>

Attributes as an object of key-value pairs.

styles Highcharts.CSSObject <optional>

Styles as an object of key-value pairs.

parent Highcharts.HTMLDOMElement <optional>

The parent HTML object.

nopad boolean <optional>
false

If true, remove all padding, border and margin.

Returns:
Highcharts.HTMLDOMElement .

The created DOM element.

<static> css(el, styles)

Set CSS on a given element.

Parameters:
Name Type Description
el Highcharts.HTMLDOMElement

An HTML DOM element.

styles Highcharts.CSSObject

Style object with camel case property names.

<static> data(dataOptions [, chartOptions] [, chart])

Creates a data object to parse data for a chart.

Parameters:
Name Type Argument Description
dataOptions Highcharts.DataOptions
chartOptions Highcharts.Options <optional>
chart Highcharts.Chart <optional>
Returns:

<static> dateFormat(format, timestamp [, capitalize])

Formats a JavaScript date timestamp (milliseconds since Jan 1st 1970) into a human readable date string. The format is a subset of the formats for PHP's strftime function. Additional formats can be given in the Highcharts.dateFormats hook.

Since v6.0.5, all internal dates are formatted through the Highcharts.Chart#time instance to respect chart-level time settings. The Highcharts.dateFormat function only reflects global time settings set with setOptions.

Parameters:
Name Type Argument Default Description
format string

The desired format where various time representations are prefixed with %.

timestamp number

The JavaScript timestamp.

capitalize boolean <optional>
false

Upper case first letter in the return.

Returns:
string .

The formatted date.

<static> defined(obj)

Check if an object is null or undefined.

Parameters:
Name Type Description
obj *

The object to check.

Returns:
boolean .

False if the object is null or undefined, otherwise true.

<static> destroyObjectProperties(obj [, except])

Utility method that destroys any SVGElement instances that are properties on the given object. It loops all properties and invokes destroy if there is a destroy method. The property is then delete.

Parameters:
Name Type Argument Description
obj *

The object to destroy properties on.

except * <optional>

Exception, do not destroy this property, only delete it.

<static> discardElement(element)

Discard a HTML element by moving it to the bin and delete.

Parameters:
Name Type Description
element Highcharts.HTMLDOMElement

The HTML node to discard.

<static> downloadSVGLocal(svg, options, failCallback, successCallback)

Get data URL to an image of an SVG and call download on it options object:

  • filename: Name of resulting downloaded file without extension. Default is chart.

  • type: File type of resulting download. Default is image/png.

  • scale: Scaling factor of downloaded image compared to source. Default is 1.

  • libURL: URL pointing to location of dependency scripts to download on demand. Default is the exporting.libURL option of the global Highcharts options pointing to our server.

Parameters:
Name Type Description
svg string
options Highcharts.ExportingOptions
failCallback function
successCallback function

<static> each(arr, fn [, ctx])

Iterate over an array.

Parameters:
Name Type Argument Description
arr Array.<*>

The array to iterate over.

fn function

The iterator callback. It passes three arguments:

   - `item`: The array item.
   - `index`: The item's index in the array.
   - `arr`: The array that each is being applied to.
ctx * <optional>

The context.

Deprecated:
  • Yes

<static> erase(arr, item)

Remove the last occurence of an item from an array.

Parameters:
Name Type Description
arr Array

The array.

item *

The item to remove.

<static> error(code [, stop])

Provide error messages for debugging, with links to online explanation. This function can be overridden to provide custom error handling.

Parameters:
Name Type Argument Default Description
code number | string

The error code. See errors.xml for available codes. If it is a string, the error message is printed directly in the console.

stop boolean <optional>
false

Whether to throw an error or just log a warning in the console.

Try it

<static> extend(a, b)

Utility function to extend an object with the members of another.

Parameters:
Name Type Description
a Highcharts.Dictionary.<*>

The object to be extended.

b Highcharts.Dictionary.<*>

The object to add to the first one.

Returns:
Highcharts.Dictionary.<*> .

Object a, the original object.

<static> extendClass(parent, members)

Extend a prototyped class by new members.

Parameters:
Name Type Description
parent *

The parent prototype to inherit.

members Highcharts.Dictionary.<*>

A collection of prototype members to add or override compared to the parent prototype.

Returns:
* .

A new prototype.

<static> find(arr, callback)

Return the value of the first element in the array that satisfies the provided testing function.

Parameters:
Name Type Description
arr Array

The array to test.

callback function

The callback function. The function receives the item as the first argument. Return true if this item satisfies the condition.

Returns:
* .

The value of the element.

<static> fireEvent(el, type [, eventArguments] [, defaultFunction])

Fire an event that was registered with Highcharts#addEvent.

Parameters:
Name Type Argument Description
el *

The object to fire the event on. It can be a HTMLDOMElement, an Highcharts.SVGElement or any other object.

type string

The type of event.

eventArguments Highcharts.Dictionary.<*> <optional>

Custom event arguments that are passed on as an argument to the event handler.

defaultFunction function <optional>

The default function to execute if the other listeners haven't returned false.

<static> format(str, ctx [, time])

Format a string according to a subset of the rules of Python's String.format method.

Parameters:
Name Type Argument Description
str string

The string to format.

ctx *

The context, a collection of key-value pairs where each key is replaced by its value.

time Highcharts.Time <optional>

A Time instance that determines the date formatting, for example for applying time zone corrections to the formatted date.

Returns:
string .

The formatted string.

Example
var s = Highcharts.format(
    'The {color} fox was {len:.2f} feet long',
    { color: 'red', len: Math.PI }
);
// => The red fox was 3.14 feet long

<static> formatSingle(format, val [, time])

Format a single variable. Similar to sprintf, without the % prefix.

Parameters:
Name Type Argument Description
format string

The format string.

val *

The value.

time Highcharts.Time <optional>

A Time instance that determines the date formatting, for example for applying time zone corrections to the formatted date.

Returns:
string .

The formatted representation of the value.

Example
formatSingle('.2f', 5); // => '5.00'.

<static> ganttChart( [renderTo], options [, callback])

Factory function for Gantt charts.

Parameters:
Name Type Argument Description
renderTo string | Highcharts.HTMLDOMElement <optional>

The DOM element to render to, or its id.

options Highcharts.Options

The chart options structure.

callback Highcharts.ChartCallbackFunction <optional>

Function to run when the chart has loaded and and all external images are loaded. Defining a chart.event.load handler is equivalent.

Returns:
Highcharts.Chart .

Returns the Chart object.

Example
// Render a chart in to div#container
var chart = Highcharts.ganttChart('container', {
    title: {
        text: 'My chart'
    },
    series: [{
        data: ...
    }]
});

<static> geojson(geojson [, hType])

Highmaps only. Restructure a GeoJSON object in preparation to be read directly by the series.mapData option. The GeoJSON will be broken down to fit a specific Highcharts type, either map, mapline or mappoint. Meta data in GeoJSON's properties object will be copied directly over to Highcharts.Point.properties in Highmaps.

Parameters:
Name Type Argument Default Description
geojson object

The GeoJSON structure to parse, represented as a JavaScript object rather than a JSON string.

hType string <optional>
map

The Highmaps series type to prepare for. Setting "map" will return GeoJSON polygons and multipolygons. Setting "mapline" will return GeoJSON linestrings and multilinestrings. Setting "mappoint" will return GeoJSON points and multipoints.

Requires:
  • module:modules/map
Returns:
Array.<object> .

An object ready for the mapData option.

Try it

<static> getMagnitude(number)

Get the magnitude of a number.

Parameters:
Name Type Description
number number

The number.

Returns:
number .

The magnitude, where 1-9 are magnitude 1, 10-99 magnitude 2 etc.

<static> getOptions()

Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules wasn't enough because the setOptions method created a new object.

Returns:

<static> getStyle(el, prop [, toInt])

Get the computed CSS value for given element and property, only for numerical properties. For width and height, the dimension of the inner box (excluding padding) is returned. Used for fitting the chart within the container.

Parameters:
Name Type Argument Default Description
el Highcharts.HTMLDOMElement

An HTML element.

prop string

The property name.

toInt boolean <optional>
true

Parse to integer.

Returns:
number .

The numeric value.

<static> grep(arr, callback)

Filter an array by a callback.

Parameters:
Name Type Description
arr Array.<*>

The array to filter.

callback function

The callback function. The function receives the item as the first argument. Return true if the item is to be preserved.

Deprecated:
  • Yes
Returns:
Array.<*> .

A new, filtered array.

<static> inArray(item, arr [, fromIndex])

Search for an item in an array.

Parameters:
Name Type Argument Default Description
item *

The item to search for.

arr Array

The array or node collection to search in.

fromIndex number <optional>
0

The index to start searching from.

Deprecated:
  • Yes
Returns:
number .

The index within the array, or -1 if not found.

<static> isArray(obj)

Utility function to check if an item is an array.

Parameters:
Name Type Description
obj *

The item to check.

Returns:
boolean .

True if the argument is an array.

<static> isClass(obj)

Utility function to check if an Object is an class.

Parameters:
Name Type Description
obj *

The item to check.

Returns:
boolean .

True if the argument is an class.

<static> isDOMElement(obj)

Utility function to check if an Object is a HTML Element.

Parameters:
Name Type Description
obj *

The item to check.

Returns:
boolean .

True if the argument is a HTML Element.

<static> isNumber(n)

Utility function to check if an item is a number and it is finite (not NaN, Infinity or -Infinity).

Parameters:
Name Type Description
n *

The item to check.

Returns:
boolean .

True if the item is a finite number

<static> isObject(obj [, strict])

Utility function to check if an item is of type object.

Parameters:
Name Type Argument Default Description
obj *

The item to check.

strict boolean <optional>
false

Also checks that the object is not an array.

Returns:
boolean .

True if the argument is an object.

<static> isString(s)

Utility function to check for string type.

Parameters:
Name Type Description
s *

The item to check.

Returns:
boolean .

True if the argument is a string.

<static> keys(obj)

Returns an array of a given object's own properties.

Parameters:
Name Type Description
obj *

The object of which the properties are to be returned.

Deprecated:
  • Yes
Returns:
Array.<string> .

An array of strings that represents all the properties.

<static> map(arr, fn)

Map an array by a callback.

Parameters:
Name Type Description
arr Array.<*>

The array to map.

fn function

The callback function. Return the new value for the new array.

Deprecated:
  • Yes
Returns:
Array.<*> .

A new array item with modified items.

<static> mapChart( [renderTo], options [, callback])

The factory function for creating new map charts. Creates a new Chart object with different default options than the basic Chart.

Parameters:
Name Type Argument Description
renderTo string | Highcharts.HTMLDOMElement <optional>

The DOM element to render to, or its id.

options Highcharts.Options

The chart options structure as described in the options reference.

callback Highcharts.ChartCallbackFunction <optional>

A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initialized before the document is ready, and in these cases the chart object will not be finished synchronously. As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent.

Requires:
  • module:modules/map
Returns:
Highcharts.Chart .

The chart object.

<static> merge(extend, a [, n])

Utility function to deep merge two or more objects and return a third object. If the first argument is true, the contents of the second object is copied into the first object. The merge function can also be used with a single object argument to create a deep copy of an object.

Parameters:
Name Type Argument Description
extend boolean

Whether to extend the left-side object (a) or return a whole new object.

a *

The first object to extend. When only this is given, the function returns a deep copy.

n * <optional>

An object to merge into the previous one.

Returns:
* .

The merged object. If the first argument is true, the return is the same as the second argument.

<static> merge(a [, n])

Utility function to deep merge two or more objects and return a third object. The merge function can also be used with a single object argument to create a deep copy of an object.

Parameters:
Name Type Argument Description
a *

The first object to extend. When only this is given, the function returns a deep copy.

n * <optional>

An object to merge into the previous one.

Returns:
* .

The merged object. If the first argument is true, the return is the same as the second argument.

<static> normalizeTickInterval(interval [, multiples] [, magnitude] [, allowDecimals] [, hasTickAmount])

Take an interval and normalize it to multiples of round numbers.

Parameters:
Name Type Argument Description
interval number

The raw, un-rounded interval.

multiples Array <optional>

Allowed multiples.

magnitude number <optional>

The magnitude of the number.

allowDecimals boolean <optional>

Whether to allow decimals.

hasTickAmount boolean <optional>

If it has tickAmount, avoid landing on tick intervals lower than original.

Deprecated:
  • Yes
To Do:
  • Move this function to the Axis prototype. It is here only for historical reasons.
Returns:
number .

The normalized interval.

<static> numberFormat(number, decimals [, decimalPoint] [, thousandsSep])

Format a number and return a string based on input settings.

Parameters:
Name Type Argument Description
number number

The input number to format.

decimals number

The amount of decimals. A value of -1 preserves the amount in the input number.

decimalPoint string <optional>

The decimal point, defaults to the one given in the lang options, or a dot.

thousandsSep string <optional>

The thousands separator, defaults to the one given in the lang options, or a space character.

Returns:
string .

The formatted number.

Try it

<static> objectEach(obj, fn [, ctx])

Iterate over object key pairs in an object.

Parameters:
Name Type Argument Description
obj *

The object to iterate over.

fn Highcharts.ObjectEachCallbackFunction

The iterator callback. It passes three arguments:

   * value - The property value.
   * key - The property key.
   * obj - The object that objectEach is being applied to.
ctx * <optional>

The context.

<static> offset(el)

Get the element's offset position, corrected for overflow: auto.

Parameters:
Name Type Description
el Highcharts.HTMLDOMElement

The HTML element.

Returns:
Highcharts.OffsetObject .

An object containing left and top properties for the position in the page.

<static> pad(number, length [, padder])

Left-pad a string to a given length by adding a character repetetively.

Parameters:
Name Type Argument Default Description
number number

The input string or number.

length number

The desired string length.

padder string <optional>
0

The character to pad with.

Returns:
string .

The padded string.

<static> pick(items)

Return the first value that is not null or undefined.

Parameters:
Name Type Argument Description
items * <repeatable>

Variable number of arguments to inspect.

Returns:
* .

The value of the first argument that is not null or undefined.

<static> reduce(arr, fn, initialValue)

Reduce an array to a single value.

Parameters:
Name Type Description
arr Array

The array to reduce.

fn function

The callback function. Return the reduced value. Receives 4 arguments: Accumulated/reduced value, current value, current array index, and the array.

initialValue *

The initial value of the accumulator.

Deprecated:
  • Yes
Returns:
* .

The reduced value.

<static> relativeLength(value, base [, offset])

Return a length based on either the integer value, or a percentage of a base.

Parameters:
Name Type Argument Default Description
value Highcharts.RelativeSize

A percentage string or a number.

base number

The full length that represents 100%.

offset number <optional>
0

A pixel offset to apply for percentage values. Used internally in axis positioning.

Returns:
number .

The computed length.

<static> removeEvent(el [, type] [, fn])

Remove an event that was added with Highcharts#addEvent.

Parameters:
Name Type Argument Description
el T

The element to remove events on.

type string <optional>

The type of events to remove. If undefined, all events are removed from the element.

fn Highcharts.EventCallbackFunction.<T> <optional>

The specific callback to remove. If undefined, all events that match the element and optionally the type are removed.

<static> seriesType(type, parent, options, props [, pointProps])

Factory to create new series prototypes.

Parameters:
Name Type Argument Description
type string

The series type name.

parent string

The parent series type name. Use line to inherit from the basic Highcharts.Series object.

options *

The additional default options that is merged with the parent's options.

props *

The properties (functions and primitives) to set on the new prototype.

pointProps * <optional>

Members for a series-specific extension of the Highcharts.Point prototype if needed.

Returns:
Highcharts.Series .

The newly created prototype as extended from Highcharts.Series or its derivatives.

<static> setAnimation(animation, chart)

Set the global animation to either a given value, or fall back to the given chart's animation option.

Parameters:
Name Type Description
animation boolean | Highcharts.AnimationOptionsObject

The animation object.

chart Highcharts.Chart

The chart instance.

To Do:
  • This function always relates to a chart, and sets a property on the renderer, so it should be moved to the SVGRenderer.

<static> setOptions(options)

Merge the default options with custom options and return the new options structure. Commonly used for defining reusable templates.

Parameters:
Name Type Description
options Highcharts.Options

The new custom chart options.

Returns:
Highcharts.Options .

Updated options.

Try it

<static> some(arr, fn, ctx)

Test whether at least one element in the array passes the test implemented by the provided function.

Parameters:
Name Type Description
arr Array.<*>

The array to test

fn function

The function to run on each item. Return truty to pass the test. Receives arguments currentValue, index and array.

ctx *

The context.

Deprecated:
  • Yes
Returns:

<static> splat(obj)

Check if an element is an array, and if not, make it into an array.

Parameters:
Name Type Description
obj *

The object to splat.

Returns:
Array .

The produced or original array.

<static> splitPath(path)

Utility for reading SVG paths directly.

Parameters:
Name Type Description
path string
Requires:
  • module:modules/map
Returns:

<static> stableSort(arr, sortFunction)

Sort an object array and keep the order of equal items. The ECMAScript standard does not specify the behaviour when items are equal.

Parameters:
Name Type Description
arr Array

The array to sort.

sortFunction function

The function to sort it with, like with regular Array.prototype.sort.

<static> stockChart( [renderTo], options [, callback])

Factory function for creating new stock charts. Creates a new Chart object with different default options than the basic Chart.

Parameters:
Name Type Argument Description
renderTo string | Highcharts.HTMLDOMElement <optional>

The DOM element to render to, or its id.

options Highcharts.Options

The chart options structure as described in the options reference.

callback Highcharts.ChartCallbackFunction <optional>

A function to execute when the chart object is finished loading and rendering. In most cases the chart is built in one thread, but in Internet Explorer version 8 or less the chart is sometimes initialized before the document is ready, and in these cases the chart object will not be finished synchronously. As a consequence, code that relies on the newly built Chart object should always run in the callback. Defining a chart.event.load handler is equivalent.

Returns:
Highcharts.Chart .

The chart object.

Example
var chart = Highcharts.stockChart('container', {
    series: [{
        data: [1, 2, 3, 4, 5, 6, 7, 8, 9],
        pointInterval: 24 * 60 * 60 * 1000
    }]
});

<static> stop(el [, prop])

Stop running animation.

Parameters:
Name Type Argument Description
el Highcharts.SVGElement

The SVGElement to stop animation on.

prop string <optional>

The property to stop animating. If given, the stop method will stop a single property from animating, while others continue.

To Do:
  • A possible extension to this would be to stop a single property, when we want to continue animating others. Then assign the prop to the timer in the Fx.run method, and check for the prop here. This would be an improvement in all cases where we stop the animation from .attr. Instead of stopping everything, we can just stop the actual attributes we're setting.

<static> syncTimeout(fn, delay [, context])

Set a timeout if the delay is given, otherwise perform the function synchronously.

Parameters:
Name Type Argument Description
fn function

The function callback.

delay number

Delay in milliseconds.

context * <optional>

The context.

Returns:
number .

An identifier for the timeout that can later be cleared with Highcharts.clearTimeout.

<static> uniqueKey()

Get a unique key for using in internal element id's and pointers. The key is composed of a random hash specific to this Highcharts instance, and a counter.

Returns:
string .

A unique key.

Example
var id = H.uniqueKey(); // => 'highcharts-x45f6hp-0'

<static> wrap(obj, method, func)

Wrap a method with extended functionality, preserving the original function.

Parameters:
Name Type Description
obj *

The context object that the method belongs to. In real cases, this is often a prototype.

method string

The name of the method to extend.

func function

A wrapper function callback. This function is called with the same arguments as the original function, except that the original function is unshifted and passed as the first argument.

Type Definitions

AxisCrosshairOptions

Options for crosshairs on axes.

Type:
  • Highcharts.XAxisCrosshairOptions | Highcharts.YAxisCrosshairOptions

AxisEventCallbackFunction(this)

Parameters:
Name Type Description
this Highcharts.Axis

AxisOptions

Options for axes.

Type:
  • Highcharts.XAxisOptions | Highcharts.YAxisOptions | Highcharts.ZAxisOptions

AxisPlotBandsLabelOptions

Options for plot band labels on axes.

Type:
  • Highcharts.XAxisPlotBandsLabelOptions | Highcharts.YAxisPlotBandsLabelOptions | Highcharts.ZAxisPlotBandsLabelOptions

AxisPlotBandsOptions

Options for plot bands on axes.

Type:
  • Highcharts.XAxisPlotBandsOptions | Highcharts.YAxisPlotBandsOptions | Highcharts.ZAxisPlotBandsOptions

AxisPlotLinesLabelOptions

Options for plot line labels on axes.

Type:
  • Highcharts.XAxisPlotLinesLabelOptions | Highcharts.YAxisPlotLinesLabelOptions | Highcharts.ZAxisPlotLinesLabelOptions

AxisPlotLinesOptions

Options for plot lines on axes.

Type:
  • Highcharts.XAxisPlotLinesOptions | Highcharts.YAxisPlotLinesOptions | Highcharts.ZAxisPlotLinesOptions

AxisPointBreakEventCallbackFunction(this, event)

Parameters:
Name Type Description
this Highcharts.Axis
event Highcharts.AxisPointBreakEventObject

AxisSetExtremesEventCallbackFunction(this, event)

Parameters:
Name Type Description
this Highcharts.Axis
event Highcharts.AxisSetExtremesEventObject

AxisTickPositionerCallbackFunction(this)

Parameters:
Name Type Description
this Highcharts.Axis
Returns:

ChartCallbackFunction(chart)

Callback for chart constructors.

Parameters:
Name Type Description
chart Highcharts.Chart

Created chart.

ChartSelectionCallbackFunction(event)

Gets fired when an area of the chart has been selected. The default action for the selection event is to zoom the chart to the selected area. It can be prevented by calling event.preventDefault() or return false.

Parameters:
Name Type Description
event global.Event

Event informations

Returns:
boolean | undefined .

Return false to prevent the default action, usually zoom.

ClipRectElement

A clipping rectangle that can be applied to one or more Highcharts.SVGElement instances. It is instanciated with the Highcharts.SVGRenderer#clipRect function and applied with the Highcharts.SVGElement#clip function.

Type:
Example
var circle = renderer.circle(100, 100, 100)
    .attr({ fill: 'red' })
    .add();
var clipRect = renderer.clipRect(100, 100, 100, 100);

// Leave only the lower right quarter visible
circle.clip(clipRect);

ColorString

A valid color to be parsed and handled by Highcharts. Highcharts internally supports hex colors like #ffffff, rgb colors like rgb(255,255,255) and rgba colors like rgba(255,255,255,1). Other colors may be supported by the browsers and displayed correctly, but Highcharts is not able to process them and apply concepts like opacity and brightening.

Type:
  • string

CursorType

All possible cursor styles.

Type:
  • "alias" | "all-scroll" | "auto" | "cell" | "col-resize" | "context-menu" | "copy" | "crosshair" | "default" | "e-resize" | "ew-resize" | "grab" | "grabbing" | "help" | "move" | "n-resize" | "ne-resize" | "nesw-resize" | "no-drop" | "none" | "not-allowed" | "ns-resize" | "nw-resize" | "nwse-resize" | "pointer" | "progress" | "row-resize" | "s-resize" | "se-resize" | "sw-resize" | "text" | "vertical-text" | "w-resize" | "wait" | "zoom-in" | "zoom-out"

DataBeforeParseCallbackFunction(csv)

Callback function to modify the CSV before parsing it by the data module.

Parameters:
Name Type Description
csv string

The CSV to modify.

Returns:
string .

The CSV to parse.

DataCompleteCallbackFunction(chartOptions)

Callback function that gets called after parsing data.

Parameters:
Name Type Description
chartOptions Highcharts.ChartOptions

The chart options that were used.

DataDateFormatCallbackFunction(match)

Callback function that returns the correspondig Date object to a match.

Parameters:
Name Type Description
match Array.<number>
Returns:

DataParseDateCallbackFunction(dateValue)

Callback function to parse string representations of dates into JavaScript timestamps (milliseconds since 1.1.1970).

Parameters:
Name Type Description
dateValue string
Returns:
number .

Timestamp (milliseconds since 1.1.1970) as integer for Date class.

DataParsedCallbackFunction(columns)

Callback function to access the parsed columns, the two-dimentional input data array directly, before they are interpreted into series data and categories.

Parameters:
Name Type Description
columns Array.<Array.<*>>

The parsed columns by the data module.

Returns:
boolean | undefined .

Return false to stop completion, or call this.complete() to continue async.

DrilldownCallbackFunction(this, e)

Gets fired when a drilldown point is clicked, before the new series is added. Note that when clicking a category label to trigger multiple series drilldown, one drilldown event is triggered per point in the category.

Parameters:
Name Type Description
this Highcharts.Chart

The chart where the event occurs.

e Highcharts.DrilldownEventObject

The drilldown event.

DrillupAllCallbackFunction(this, e)

This gets fired after all the series have been drilled up. This is especially usefull in a chart with multiple drilldown series.

Parameters:
Name Type Description
this Highcharts.Chart

The chart where the event occurs.

e Highcharts.DrillupAllEventObject

The final drillup event.

DrillupCallbackFunction(this, e)

Gets fired when drilling up from a drilldown series.

Parameters:
Name Type Description
this Highcharts.Chart

The chart where the event occurs.

e Highcharts.DrillupEventObject

The drillup event.

EventCallbackFunction(this [, eventArguments])

The function callback to execute when the event is fired. The this context contains the instance, that fired the event.

Parameters:
Name Type Argument Description
this T
eventArguments Highcharts.Dictionary.<*> <optional>

Event arguments.

ExportingErrorCallbackFunction(options, err)

Function to call if the offline-exporting module fails to export a chart on the client side.

Parameters:
Name Type Description
options Highcharts.ExportingOptions

The exporting options.

err global.Error

The error from the module.

FormatterCallbackFunction(this)

Formats data as a string. Usually the data is accessible throught the this keyword.

Parameters:
Name Type Description
this T
Returns:

HTMLAttributes

An object of key-value pairs for HTML attributes.

Type:
  • Highcharts.Dictionary.<(boolean|number|string)>

HTMLDOMElement

An HTML DOM element. The type is a reference to the regular HTMLElement in the global scope.

Type:
  • global.HTMLElement
See also:

ObjectEachCallbackFunction(value, key, obj)

The iterator callback.

Parameters:
Name Type Description
value *

The property value.

key string

The property key.

obj *

The object that objectEach is being applied to.

RelativeSize

If a number is given, it defines the pixel length. If a percentage string is given, like for example '50%', the setting defines a length relative to a base size, for example the size of a container.

Type:
  • number | string

SeriesAfterAnimateCallbackFunction(e)

Function callback when a series has been animated.

Parameters:
Name Type Description
e Highcharts.SeriesAfterAnimateEventObject

Event arguments.

SeriesCheckboxClickCallbackFunction(e)

Function callback when the checkbox next to the series' name in the legend is clicked.

Parameters:
Name Type Description
e Highcharts.SeriesCheckboxClickEventObject

Event arguments.

SeriesClickCallbackFunction(e)

Function callback when a series is clicked. Return false to cancel toogle actions.

Parameters:
Name Type Description
e Highcharts.SeriesClickEventObject

Event arguments.

SeriesPointClickCallbackFunction(e)

Function callback when a series point is clicked. Return false to cancel the action.

Parameters:
Name Type Description
e Highcharts.SeriesPointClickEventObject

Event arguments.

SVGDOMElement

An SVG DOM element. The type is a reference to the regular SVGElement in the global scope.

Type:
  • globals.GlobalSVGElement
See also:

SVGPathArray

Array of path commands, that will go into the d attribute of an SVG element.

Type:

SVGPathCommand

Possible path commands in a SVG path array.

Type:
  • string

SymbolDictionary

An extendable collection of functions for defining symbol paths.

Properties:
Name Type Argument Description
key:Highcharts.SymbolKey function | undefined <optional>

SymbolKey

Can be one of arc, callout, circle, diamond, square, triangle, triangle-down. Symbols are used internally for point markers, button and label borders and backgrounds, or custom shapes. Extendable by adding to Highcharts.SVGRenderer#symbols.

Type:
  • string

TimeFormatCallbackFunction(timestamp)

Function of an additional date format specifier.

Parameters:
Name Type Description
timestamp number

The time to format.

Returns:
string .

The formatted portion of the date.