highcharts
Version:
JavaScript charting framework
1,352 lines • 9.94 MB
TypeScript
/*!*
*
* Copyright (c) Highsoft AS. All rights reserved.
*
*!*/
import * as globals from "./globals.src";
/**
* The horizontal alignment of an element.
*/
export type AlignValue = ("center"|"left"|"right");
/**
* Creates a frame for the animated SVG element.
*
* @param this
* The SVG element to animate.
*/
export type AnimationStepCallbackFunction = (this: SVGElement) => void;
/**
* (Highstock) Options for crosshairs on axes.
*/
export type AxisCrosshairOptions = (XAxisCrosshairOptions|YAxisCrosshairOptions);
export type AxisEventCallbackFunction = (this: Axis) => void;
export type AxisExtremesTriggerValue = ("navigator"|"pan"|"scrollbar"|"zoom"|"rangeSelectorButton"|"rangeSelectorInput"|"traverseUpButton");
/**
* Options for axes.
*/
export type AxisOptions = (XAxisOptions|YAxisOptions|ZAxisOptions);
/**
* Options for plot band labels on axes.
*/
export type AxisPlotBandsLabelOptions = (XAxisPlotBandsLabelOptions|YAxisPlotBandsLabelOptions|ZAxisPlotBandsLabelOptions);
/**
* Options for plot bands on axes.
*/
export type AxisPlotBandsOptions = (XAxisPlotBandsOptions|YAxisPlotBandsOptions|ZAxisPlotBandsOptions);
/**
* Options for plot line labels on axes.
*/
export type AxisPlotLinesLabelOptions = (XAxisPlotLinesLabelOptions|YAxisPlotLinesLabelOptions|ZAxisPlotLinesLabelOptions);
/**
* Options for plot lines on axes.
*/
export type AxisPlotLinesOptions = (XAxisPlotLinesOptions|YAxisPlotLinesOptions|ZAxisPlotLinesOptions);
export type AxisPointBreakEventCallbackFunction = (this: Axis, evt: AxisPointBreakEventObject) => void;
export type AxisSetExtremesEventCallbackFunction = (this: Axis, evt: AxisSetExtremesEventObject) => void;
export type AxisTickPositionerCallbackFunction = (this: Axis) => Array<number>;
export type AxisTitleAlignValue = ("high"|"low"|"middle");
export type AxisTypeValue = ("category"|"datetime"|"linear"|"logarithmic"|"treegrid");
export type BubbleSizeByValue = ("area"|"width");
export type ButtonRelativeToValue = ("plotBox"|"spacingBox");
/**
* Gets fired when a series is added to the chart after load time, using the
* `addSeries` method. Returning `false` prevents the series from being added.
*
* @param this
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ChartAddSeriesCallbackFunction = (this: Chart, event: ChartAddSeriesEventObject) => void;
/**
* Callback for chart constructors.
*
* @param chart
* Created chart.
*/
export type ChartCallbackFunction = (chart: Chart) => void;
/**
* Gets fired when clicking on the plot background.
*
* @param this
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ChartClickCallbackFunction = (this: Chart, event: PointerEventObject) => void;
/**
* Gets fired when the chart is finished loading.
*
* @param this
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ChartLoadCallbackFunction = (this: Chart, event: Event) => void;
/**
* Fires when the chart is redrawn, either after a call to `chart.redraw()` or
* after an axis, series or point is modified with the `redraw` option set to
* `true`.
*
* @param this
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ChartRedrawCallbackFunction = (this: Chart, event: Event) => void;
/**
* Gets fired after initial load of the chart (directly after the `load` event),
* and after each redraw (directly after the `redraw` event).
*
* @param this
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ChartRenderCallbackFunction = (this: Chart, event: Event) => void;
/**
* 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.
*
* @param this
* The chart on which the event occured.
*
* @param event
* Event informations
*
* @return Return false to prevent the default action, usually zoom.
*/
export type ChartSelectionCallbackFunction = (this: Chart, event: ChartSelectionContextObject) => (boolean|undefined);
/**
* A clipping rectangle that can be applied to one or more SVGElement instances.
* It is instanciated with the SVGRenderer#clipRect function and applied with
* the SVGElement#clip function.
*/
export type ClipRectElement = SVGElement;
/**
* Color axis types
*/
export type ColorAxisTypeValue = ("linear"|"logarithmic");
/**
* 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.
*/
export type ColorString = string;
/**
* All possible cursor styles.
*/
export type CursorValue = ('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');
/**
* All possible dash styles.
*/
export type DashStyleValue = ('Dash'|'DashDot'|'Dot'|'LongDash'|'LongDashDot'|'LongDashDotDot'|'ShortDash'|'ShortDashDot'|'ShortDashDotDot'|'ShortDot'|'Solid');
/**
* Callback function to modify the CSV before parsing it by the data module.
*
* @param csv
* The CSV to modify.
*
* @return The CSV to parse.
*/
export type DataBeforeParseCallbackFunction = (csv: string) => string;
/**
* Callback function that gets called after parsing data.
*
* @param chartOptions
* The chart options that were used.
*/
export type DataCompleteCallbackFunction = (chartOptions: ChartOptions) => void;
export type DataGroupingApproximationValue = ("average"|"averages"|"close"|"high"|"low"|"open"|"sum");
/**
* The operator to compare by in the filter.
*/
export type DataLabelsFilterOperatorValue = ("=="|"==="|">"|">="|"<"|"<=");
/**
* Callback JavaScript function to format the data label as a string. Note that
* if a `format` is defined, the format takes precedence and the formatter is
* ignored.
*
* @param this
* Data label context to format
*
* @return Formatted data label text
*/
export type DataLabelsFormatterCallbackFunction = (this: DataLabelsFormatterContextObject) => string;
/**
* Values for handling data labels that flow outside the plot area.
*/
export type DataLabelsOverflowValue = ("allow"|"justify");
/**
* Callback function to parse string representations of dates into JavaScript
* timestamps (milliseconds since 1.1.1970).
*
* @return Timestamp (milliseconds since 1.1.1970) as integer for Date class.
*/
export type DataParseDateCallbackFunction = (dateValue: string) => number;
/**
* Callback function to access the parsed columns, the two-dimentional input
* data array directly, before they are interpreted into series data and
* categories.
*
* @param columns
* The parsed columns by the data module.
*
* @return Return `false` to stop completion, or call `this.complete()` to
* continue async.
*/
export type DataParsedCallbackFunction = (columns: Array<Array<any>>) => (boolean|undefined);
/**
* 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.
*
* @param this
* The chart where the event occurs.
*
* @param e
* The drilldown event.
*/
export type DrilldownCallbackFunction = (this: Chart, e: DrilldownEventObject) => void;
/**
* This gets fired after all the series have been drilled up. This is especially
* usefull in a chart with multiple drilldown series.
*
* @param this
* The chart where the event occurs.
*
* @param e
* The final drillup event.
*/
export type DrillupAllCallbackFunction = (this: Chart, e: DrillupAllEventObject) => void;
/**
* Gets fired when drilling up from a drilldown series.
*
* @param this
* The chart where the event occurs.
*
* @param e
* The drillup event.
*/
export type DrillupCallbackFunction = (this: Chart, e: DrillupEventObject) => void;
/**
* The function callback to execute when the event is fired. The `this` context
* contains the instance, that fired the event.
*
* @param eventArguments
* Event arguments.
*/
export type EventCallbackFunction<T> = (this: T, eventArguments?: (Event|Dictionary<any>)) => (boolean|void);
/**
* Gets fired after a chart is printed through the context menu item or the
* Chart.print method.
*
* @param chart
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ExportingAfterPrintCallbackFunction = (chart: Chart, event: Event) => void;
/**
* Gets fired before a chart is printed through the context menu item or the
* Chart.print method.
*
* @param chart
* The chart on which the event occured.
*
* @param event
* The event that occured.
*/
export type ExportingBeforePrintCallbackFunction = (chart: Chart, event: Event) => void;
/**
* Function to call if the offline-exporting module fails to export a chart on
* the client side.
*
* @param options
* The exporting options.
*
* @param err
* The error from the module.
*/
export type ExportingErrorCallbackFunction = (options: ExportingOptions, err: Error) => void;
/**
* Possible MIME types for exporting.
*/
export type ExportingMimeTypeValue = ("application/pdf"|"image/jpeg"|"image/png"|"image/svg+xml");
export type FlagShapeValue = ("circlepin"|"flag"|"squarepin");
/**
* Formats data as a string. Usually the data is accessible throught the `this`
* keyword.
*
* @param this
* Context to format
*
* @return Formatted text
*/
export type FormatterCallbackFunction<T> = (this: T) => string;
/**
* An object of key-value pairs for HTML attributes.
*/
export type HTMLAttributes = Dictionary<(boolean|number|string|Function)>;
/**
* An HTML DOM element. The type is a reference to the regular HTMLElement in
* the global scope.
*/
export type HTMLDOMElement = HTMLElement;
/**
* The iterator callback.
*
* @param this
* The context.
*
* @param value
* The property value.
*
* @param key
* The property key.
*
* @param obj
* The object that objectEach is being applied to.
*/
export type ObjectEachCallbackFunction<T> = (this: T, value: any, key: string, obj: any) => void;
export type OptionsApproximationValue = ("barnes-hut"|"none");
export type OptionsBoostBlendingValue = ("add"|"darken"|"multiply");
export type OptionsDataClassColorValue = ("category"|"tween");
export type OptionsDateFormatValue = ("dd/mm/YY"|"dd/mm/YYYY"|"mm/dd/YY"|"mm/dd/YYYY"|"YYYY/mm/dd");
export type OptionsDraggableValue = (""|"x"|"xy"|"y");
export type OptionsFindNearestPointByValue = ("x"|"xy");
export type OptionsGapUnitValue = ("relative"|"value");
export type OptionsGridLineInterpolationValue = ("circle"|"polygon");
export type OptionsHeaderShapeValue = ("callout"|"square");
export type OptionsIntegrationValue = ("euler"|"verlet");
export type OptionsLandmarkVerbosityValue = ("all"|"disabled"|"one");
export type OptionsLayoutAlgorithmValue = ("squarified"|"strip"|"stripes"|"sliceAndDice");
export type OptionsLayoutStartingDirectionValue = ("horizontal"|"vertical");
export type OptionsLayoutValue = ("horizontal"|"proximate"|"vertical");
export type OptionsLinecapValue = ("round"|"square");
export type OptionsMarkerEndValue = ("arrow"|"none");
export type OptionsMinorTickPositionValue = ("inside"|"outside");
export type OptionsModeValue = ("normal"|"serialize");
export type OptionsOnKeyValue = ("close"|"high"|"low"|"open"|"y");
export type OptionsOverflowValue = ("allow"|"justify");
export type OptionsPanKeyValue = ("alt"|"ctrl"|"meta"|"shift");
export type OptionsPinchTypeValue = ("x"|"xy"|"y");
export type OptionsPointIntervalUnitValue = ("day"|"month"|"year");
export type OptionsPointValKeyValue = ("close"|"high"|"low"|"open");
export type OptionsPosition3dValue = ("chart"|"flap"|"offset"|"ortho");
export type OptionsRotationOriginValue = ("center"|"end"|"start");
export type OptionsStackingValue = ("normal"|"percent");
export type OptionsStepValue = ("center"|"left"|"right");
export type OptionsTextAlignValue = ("center"|"left"|"right");
export type OptionsTickmarkPlacementValue = ("between"|"on");
export type OptionsTickPositionValue = ("inside"|"outside");
export type OptionsUnitValue = ("percentage"|"pixels"|"weight");
export type OptionsZoomKeyValue = ("alt"|"ctrl"|"meta"|"shift");
export type OptionsZoomTypeValue = ("x"|"xy"|"y");
export type PaneBackgroundShapeValue = ("arc"|"circle"|"solid");
/**
* The default pathfinder algorithm to use for a chart. It is possible to define
* your own algorithms by adding them to the
* `Highcharts.Pathfinder.prototype.algorithms` object before the chart has been
* created.
*
* The default algorithms are as follows:
*
* `straight`: Draws a straight line between the connecting points. Does not
* avoid other points when drawing.
*
* `simpleConnect`: Finds a path between the points using right angles only.
* Takes only starting/ending points into account, and will not avoid other
* points.
*
* `fastAvoid`: Finds a path between the points using right angles only. Will
* attempt to avoid other points, but its focus is performance over accuracy.
* Works well with less dense datasets.
*/
export type PathfinderTypeValue = ("straight"|"fastAvoid"|"simpleConnect"|string);
/**
* Gets fired when the legend item belonging to a point is clicked. The default
* action is to toggle the visibility of the point. This can be prevented by
* returning `false` or calling `event.preventDefault()`.
*
* @param this
* The point on which the event occured.
*
* @param event
* The event that occured.
*/
export type PointLegendItemClickCallbackFunction = (this: Point, event: PointLegendItemClickEventObject) => void;
/**
* Define the time span for the button
*/
export type RangeSelectorButtonTypeValue = ("all"|"day"|"hour"|"millisecond"|"minute"|"month"|"second"|"week"|"year"|"ytd");
/**
* Callback function to react on button clicks.
*
* @param e
* Event arguments.
*
* @param Return
* false to cancel the default button event.
*/
export type RangeSelectorClickCallbackFunction = (e: Event, Return: (boolean|undefined)) => void;
/**
* Callback function to parse values entered in the input boxes and return a
* valid JavaScript time as milliseconds since 1970.
*
* @param value
* Input value to parse.
*
* @return Parsed JavaScript time value.
*/
export type RangeSelectorParseCallbackFunction = (value: string) => number;
/**
* 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.
*/
export type RelativeSize = (number|string);
/**
* A callback function to gain complete control on when the responsive rule
* applies.
*
* @return Return `true` if it applies.
*/
export type ResponsiveCallbackFunction = () => boolean;
/**
* @param evt
* Mouse click event
*/
export type ScreenReaderClickCallbackFunction = (evt: MouseEvent) => void;
/**
* Creates a formatted string for the screen reader module.
*
* @param context
* Context to format
*
* @return Formatted string for the screen reader module.
*/
export type ScreenReaderFormatterCallbackFunction<T> = (context: T) => string;
/**
* Function callback when a series has been animated.
*
* @param this
* The series where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesAfterAnimateCallbackFunction = (this: Series, event: SeriesAfterAnimateEventObject) => void;
/**
* Function callback when the checkbox next to the series' name in the legend is
* clicked.
*
* @param this
* The series where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesCheckboxClickCallbackFunction = (this: Series, event: SeriesCheckboxClickEventObject) => void;
/**
* Function callback when a series is clicked. Return false to cancel toogle
* actions.
*
* @param this
* The series where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesClickCallbackFunction = (this: Series, event: SeriesClickEventObject) => void;
/**
* Gets fired when the series is hidden after chart generation time, either by
* clicking the legend item or by calling `.hide()`.
*
* @param this
* The series where the event occured.
*
* @param event
* The event that occured.
*/
export type SeriesHideCallbackFunction = (this: Series, event: Event) => void;
/**
* Gets fired when the legend item belonging to a series is clicked. The default
* action is to toggle the visibility of the series. This can be prevented by
* returning `false` or calling `event.preventDefault()`.
*
* @param this
* The series where the event occured.
*
* @param event
* The event that occured.
*/
export type SeriesLegendItemClickCallbackFunction = (this: Series, event: SeriesLegendItemClickEventObject) => void;
/**
* The SVG value used for the `stroke-linecap` and `stroke-linejoin` of a line
* graph.
*/
export type SeriesLinecapValue = ("butt"|"round"|"square"|string);
/**
* Gets fired when the mouse leaves the graph.
*
* @param this
* Series where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesMouseOutCallbackFunction = (this: Series, event: Event) => void;
/**
* Gets fired when the mouse enters the graph.
*
* @param this
* Series where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesMouseOverCallbackFunction = (this: Series, event: Event) => void;
/**
* Formatter callback function.
*
* @param this
* Data label context to format
*
* @return Formatted data label text
*/
export type SeriesNetworkDataLabelsFormatterCallbackFunction = (this: (DataLabelsFormatterContextObject|SeriesNetworkDataLabelsFormatterContextObject)) => string;
/**
* The possible types of series options.
*/
export type SeriesOptionsType = (SeriesAbandsOptions|SeriesAdOptions|SeriesAoOptions|SeriesApoOptions|SeriesAreaOptions|SeriesArearangeOptions|SeriesAreasplineOptions|SeriesAreasplinerangeOptions|
SeriesAroonOptions|SeriesAroonoscillatorOptions|SeriesAtrOptions|SeriesBarOptions|SeriesBbOptions|SeriesBellcurveOptions|SeriesBoxplotOptions|SeriesBubbleOptions|SeriesBulletOptions|
SeriesCandlestickOptions|SeriesCciOptions|SeriesChaikinOptions|SeriesCmfOptions|SeriesColumnOptions|SeriesColumnpyramidOptions|SeriesColumnrangeOptions|SeriesCylinderOptions|SeriesDemaOptions|
SeriesDependencywheelOptions|SeriesDpoOptions|SeriesEmaOptions|SeriesErrorbarOptions|SeriesFlagsOptions|SeriesFunnel3dOptions|SeriesFunnelOptions|SeriesGanttOptions|SeriesGaugeOptions|
SeriesHeatmapOptions|SeriesHistogramOptions|SeriesIkhOptions|SeriesItemOptions|SeriesKeltnerchannelsOptions|SeriesLinearregressionangleOptions|SeriesLinearregressioninterceptOptions|
SeriesLinearregressionOptions|SeriesLinearregressionslopeOptions|SeriesLineOptions|SeriesMacdOptions|SeriesMapbubbleOptions|SeriesMaplineOptions|SeriesMapOptions|SeriesMappointOptions|
SeriesMfiOptions|SeriesMomentumOptions|SeriesNatrOptions|SeriesNetworkgraphOptions|SeriesOhlcOptions|SeriesOrganizationOptions|SeriesPackedbubbleOptions|SeriesParetoOptions|SeriesPcOptions|
SeriesPieOptions|SeriesPivotpointsOptions|SeriesPolygonOptions|SeriesPpoOptions|SeriesPriceenvelopesOptions|SeriesPsarOptions|SeriesPyramid3dOptions|SeriesPyramidOptions|SeriesRocOptions|
SeriesRsiOptions|SeriesSankeyOptions|SeriesScatter3dOptions|SeriesScatterOptions|SeriesSmaOptions|SeriesSolidgaugeOptions|SeriesSplineOptions|SeriesStochasticOptions|SeriesStreamgraphOptions|
SeriesSunburstOptions|SeriesSupertrendOptions|SeriesTemaOptions|SeriesTilemapOptions|SeriesTimelineOptions|SeriesTreemapOptions|SeriesTrixOptions|SeriesVariablepieOptions|SeriesVariwideOptions|
SeriesVbpOptions|SeriesVectorOptions|SeriesVennOptions|SeriesVwapOptions|SeriesWaterfallOptions|SeriesWilliamsrOptions|SeriesWindbarbOptions|SeriesWmaOptions|SeriesWordcloudOptions|
SeriesXrangeOptions|SeriesZigzagOptions);
/**
* Layout value for the child nodes in an organization chart. If `hanging`, this
* node's children will hang below their parent, allowing a tighter packing of
* nodes in the diagram.
*/
export type SeriesOrganizationNodesLayoutValue = ("hanging"|"normal");
/**
* Formatter callback function.
*
* @param this
* Data label context to format
*
* @return Formatted data label text
*/
export type SeriesPackedBubbleDataLabelsFormatterCallbackFunction = (this: (DataLabelsFormatterContextObject|SeriesPackedBubbleDataLabelsFormatterContextObject)) => string;
/**
* Function callback when a series point is clicked. Return false to cancel the
* action.
*
* @param this
* The point where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesPointClickCallbackFunction = (this: Point, event: SeriesPointClickEventObject) => void;
/**
* Function callback to execute while series points are dragged. Return false to
* stop the default drag action.
*
* @param this
* Point where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesPointDragCallbackFunction = (this: Point, event: SeriesPointDragEventObject) => void;
/**
* Function callback to execute when a series point is dragged.
*
* @param this
* Point where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesPointDragStartCallbackFunction = (this: Point, event: SeriesPointDragStartEventObject) => void;
/**
* Function callback to execute when series points are dropped.
*
* @param this
* Point where the event occured.
*
* @param event
* Event arguments.
*/
export type SeriesPointDropCallbackFunction = (this: Point, event: SeriesPointDropEventObject) => void;
/**
* Gets fired when the mouse leaves the area close to the point.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointMouseOutCallbackFunction = (this: Point, event: Event) => void;
/**
* Gets fired when the mouse enters the area close to the point.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointMouseOverCallbackFunction = (this: Point, event: Event) => void;
/**
* Gets fired when the point is removed using the `.remove()` method.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointRemoveCallbackFunction = (this: Point, event: Event) => void;
/**
* Gets fired when the point is selected either programmatically or following a
* click on the point.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointSelectCallbackFunction = (this: Point, event: SeriesPointSelectEventObject) => void;
/**
* Fires when the point is unselected either programmatically or following a
* click on the point.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointUnselectCallbackFunction = (this: Point, event: SeriesPointUnselectEventObject) => void;
/**
* Gets fired when the point is updated programmatically through the `.update()`
* method.
*
* @param this
* Point where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesPointUpdateCallbackFunction = (this: Point, event: SeriesPointUpdateEventObject) => void;
/**
* Gets fired when the series is shown after chart generation time, either by
* clicking the legend item or by calling `.show()`.
*
* @param this
* Series where the event occured.
*
* @param event
* Event that occured.
*/
export type SeriesShowCallbackFunction = (this: Series, event: Event) => void;
/**
* Possible rotation options for data labels in the sunburst series.
*/
export type SeriesSunburstDataLabelsRotationValue = ("auto"|"parallel"|"perpendicular");
/**
* An SVG DOM element. The type is a reference to the regular SVGElement in the
* global scope.
*/
export type SVGDOMElement = globals.GlobalSVGElement;
/**
* Array of path commands, that will go into the `d` attribute of an SVG
* element.
*/
export type SVGPathArray = Array<(number|SVGPathCommand)>;
/**
* Possible path commands in a SVG path array.
*/
export type SVGPathCommand = ("a"|"c"|"h"|"l"|"m"|"q"|"s"|"t"|"v"|"z"|"A"|"C"|"H"|"L"|"M"|"Q"|"S"|"T"|"V"|"Z");
/**
* Can be one of `arc`, `callout`, `circle`, `diamond`, `square`, `triangle`,
* and `triangle-down`. Symbols are used internally for point markers, button
* and label borders and backgrounds, or custom shapes. Extendable by adding to
* SVGRenderer#symbols.
*/
export type SymbolKeyValue = ("arc"|"callout"|"circle"|"diamond"|"square"|"triangle"|"triangle-down");
export type TilemapShapeValue = ("circle"|"diamond"|"hexagon"|"square");
/**
* Function of an additional date format specifier.
*
* @param timestamp
* The time to format.
*
* @return The formatted portion of the date.
*/
export type TimeFormatCallbackFunction = (timestamp: number) => string;
/**
* Callback function to format the text of the tooltip from scratch.
*
* In case of single or shared tooltips, a string should be be returned. In case
* of splitted tooltips, it should return an array where the first item is the
* header, and subsequent items are mapped to the points. Return `false` to
* disable tooltip for a specific point on series.
*
* @param this
* Context to format
*
* @return Formatted text or false
*/
export type TooltipFormatterCallbackFunction = (this: TooltipFormatterContextObject) => (false|string|Array<string>);
/**
* A callback function to place the tooltip in a specific position.
*
* @param labelWidth
* Width of the tooltip.
*
* @param labelHeight
* Height of the tooltip.
*
* @param point
* Point information for positioning a tooltip.
*
* @return New position for the tooltip.
*/
export type TooltipPositionerCallbackFunction = (labelWidth: number, labelHeight: number, point: TooltipPositionerPointObject) => PositionObject;
export type TooltipShapeValue = ("callout"|"circle"|"square");
export type VariablePieSizeByValue = ("area"|"radius");
/**
* The vertical alignment of an element.
*/
export type VerticalAlignValue = ("bottom"|"middle"|"top");
/**
* Proceed function to call original (wrapped) function.
*
* @param arg1
* Optional argument. Without any arguments defaults to first argument of
* the wrapping function.
*
* @param arg2
* Optional argument. Without any arguments defaults to second argument
* of the wrapping function.
*
* @param arg3
* Optional argument. Without any arguments defaults to third argument of
* the wrapping function.
*
* @return Return value of the original function.
*/
export type WrapProceedFunction = (arg1?: any, arg2?: any, arg3?: any) => any;
/**
* Formatter function for the text of a crosshair label.
*
* @param this
* Axis context
*
* @param value
* Y value of the data point
*/
export type XAxisCrosshairLabelFormatterCallbackFunction = (this: Axis, value: number) => string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for announcing new data to
* screen reader users. Useful for dynamic data applications and drilldown.
*
* Keep in mind that frequent announcements will not be useful to users, as they
* won't have time to explore the new data. For these applications, consider
* making snapshots of the data accessible, and do the announcements in batches.
*/
export interface AccessibilityAnnounceNewDataOptions {
/**
* (Highcharts, Highstock, Highmaps, Gantt) Optional formatter callback for
* the announcement. Receives up to three arguments. The first argument is
* always an array of all series that received updates. If an announcement
* is already queued, the series that received updates for that announcement
* are also included in this array. The second argument is provided if
* `chart.addSeries` was called, and there is a new series. In that case,
* this argument is a reference to the new series. The third argument,
* similarly, is provided if `series.addPoint` was called, and there is a
* new point. In that case, this argument is a reference to the new point.
*
* The function should return a string with the text to announce to the
* user. Return empty string to not announce anything. Return `false` to use
* the default announcement format.
*/
announcementFormatter?: Function;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Enable announcing new data to
* screen reader users
*/
enabled?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Choose whether or not the
* announcements should interrupt the screen reader. If not enabled, the
* user will be notified once idle. It is recommended not to enable this
* setting unless there is a specific reason to do so.
*/
interruptUser?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Minimum interval between
* announcements in milliseconds. If new data arrives before this amount of
* time has passed, it is queued for announcement. If another new data event
* happens while an announcement is queued, the queued announcement is
* dropped, and the latest announcement is queued instead. Set to 0 to allow
* all announcements, but be warned that frequent announcements are
* disturbing to users.
*/
minAnnounceInterval?: number;
}
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for the focus border drawn
* around elements while navigating through them.
*/
export interface AccessibilityKeyboardNavigationFocusBorderOptions {
/**
* (Highcharts, Highstock, Highmaps, Gantt) Enable/disable focus border for
* chart.
*/
enabled?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Hide the browser's default focus
* indicator.
*/
hideBrowserFocusOutline?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Focus border margin around the
* elements.
*/
margin?: number;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Style options for the focus
* border drawn around elements while navigating through them. Note that
* some browsers in addition draw their own borders for focused elements.
* These automatic borders can not be styled by Highcharts.
*
* In styled mode, the border is given the `.highcharts-focus-border` class.
*/
style?: CSSObject;
}
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for keyboard navigation.
*/
export interface AccessibilityKeyboardNavigationOptions {
/**
* (Highcharts, Highstock, Highmaps, Gantt) Enable keyboard navigation for
* the chart.
*/
enabled?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for the focus border
* drawn around elements while navigating through them.
*/
focusBorder?: AccessibilityKeyboardNavigationFocusBorderOptions;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Set the keyboard navigation mode
* for the chart. Can be "normal" or "serialize". In normal mode, left/right
* arrow keys move between points in a series, while up/down arrow keys move
* between series. Up/down navigation acts intelligently to figure out which
* series makes sense to move to from any given point.
*
* In "serialize" mode, points are instead navigated as a single list.
* Left/right behaves as in "normal" mode. Up/down arrow keys will behave
* like left/right. This can be useful for unifying navigation behavior
* with/without screen readers enabled.
*/
mode?: OptionsModeValue;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Order of tab navigation in the
* chart. Determines which elements are tabbed to first. Available elements
* are: `series`, `zoom`, `rangeSelector`, `chartMenu`, `legend`. In
* addition, any custom components can be added here.
*/
order?: Array<string>;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Skip null points when navigating
* through points with the keyboard.
*/
skipNullPoints?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Whether or not to wrap around
* when reaching the end of arrow-key navigation for an element in the
* chart.
*/
wrapAround?: boolean;
}
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for configuring
* accessibility for the chart. Requires the accessibility module to be loaded.
* For a description of the module and information on its features, see
* Highcharts Accessibility.
*/
export interface AccessibilityOptions {
/**
* (Highcharts, Highstock, Highmaps, Gantt) Whether or not to add a shortcut
* button in the screen reader information region to show the data table.
*/
addTableShortcut?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for announcing new data
* to screen reader users. Useful for dynamic data applications and
* drilldown.
*
* Keep in mind that frequent announcements will not be useful to users, as
* they won't have time to explore the new data. For these applications,
* consider making snapshots of the data accessible, and do the
* announcements in batches.
*/
announceNewData?: AccessibilityAnnounceNewDataOptions;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Date format to use to describe
* range of datetime axes.
*
* For an overview of the replacement codes, see dateFormat.
*/
axisRangeDateFormat?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) A hook for adding custom
* components to the accessibility module. Should be an object mapping
* component names to instances of classes inheriting from the
* Highcharts.AccessibilityComponent base class. Remember to add the
* component to the keyboardNavigation.order for the keyboard navigation to
* be usable.
*/
customComponents?: object;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Whether or not to add series
* descriptions to charts with a single series.
*/
describeSingleSeries?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) A text description of the chart.
*
* If the Accessibility module is loaded, this is included by default as a
* long description of the chart in the hidden screen reader information
* region.
*
* Note: It is considered a best practice to make the description of the
* chart visible to all users, so consider if this can be placed in text
* around the chart instead.
*/
description?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Enable accessibility
* functionality for the chart.
*/
enabled?: boolean;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for keyboard navigation.
*/
keyboardNavigation?: AccessibilityKeyboardNavigationOptions;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Amount of landmarks/regions to
* create for screen reader users. More landmarks can make navigation with
* screen readers easier, but can be distracting if there are lots of charts
* on the page. Three modes are available:
*
* - `all`: Adds regions for all series, legend, menu, information region.
*
* - `one`: Adds a single landmark per chart.
*
* - `disabled`: No landmarks are added.
*/
landmarkVerbosity?: OptionsLandmarkVerbosityValue;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Function to run upon clicking
* the "View as Data Table" link in the screen reader region.
*
* By default Highcharts will insert and set focus to a data table
* representation of the chart.
*/
onTableAnchorClick?: ScreenReaderClickCallbackFunction;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Date format to use for points on
* datetime axes when describing them to screen reader users.
*
* Defaults to the same format as in tooltip.
*
* For an overview of the replacement codes, see dateFormat.
*/
pointDateFormat?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Formatter function to determine
* the date/time format used with points on datetime axes when describing
* them to screen reader users. Receives one argument, `point`, referring to
* the point to describe. Should return a date format string compatible with
* dateFormat.
*/
pointDateFormatter?: ScreenReaderFormatterCallbackFunction<Point>;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Formatter function to use
* instead of the default for point descriptions. Receives one argument,
* `point`, referring to the point to describe. Should return a string with
* the description of the point for a screen reader user. If `false` is
* returned, the default formatter will be used for that point.
*/
pointDescriptionFormatter?: ScreenReaderFormatterCallbackFunction<Point>;
/**
* (Highcharts, Highstock, Highmaps, Gantt) When a series contains more
* points than this, we no longer expose information about individual points
* to screen readers.
*
* Set to `false` to disable.
*/
pointDescriptionThreshold?: (boolean|number);
/**
* (Highcharts, Highstock, Highmaps, Gantt) Decimals to use for the values
* in the point descriptions. Uses tooltip.valueDecimals if not defined.
*/
pointValueDecimals?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Prefix to add to the values in
* the point descriptions. Uses tooltip.valuePrefix if not defined.
*/
pointValuePrefix?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Suffix to add to the values in
* the point descriptions. Uses tooltip.valueSuffix if not defined.
*/
pointValueSuffix?: string;
/**
* (Highcharts, Highstock, Highmaps, Gantt) A formatter function to create
* the HTML contents of the hidden screen reader information region.
* Receives one argument, `chart`, referring to the chart object. Should
* return a string with the HTML content of the region. By default this
* returns an automatic description of the chart.
*
* The button to view the chart as a data table will be added automatically
* after the custom HTML content if enabled.
*/
screenReaderSectionFormatter?: ScreenReaderFormatterCallbackFunction<Chart>;
/**
* (Highcharts, Highstock, Highmaps, Gantt) Formatter function to use
* instead of the default for series descriptions. Receives one argument,
* `series`, referring to the series to describe. Should return a string
* with the description of the series for a screen reader user. If `false`
* is returned, the default formatter will be used for that series.
*/
seriesDescriptionFormatter?: ScreenReaderFormatterCallbackFunction<Series>;
/**
* (Highcharts, Highstock, Highmaps, Gantt) A text description of the chart
* type.
*
* If the Accessibility module is loaded, this will be included in the
* description of the chart in the screen reader information region.
*
* Highcharts will by default attempt to guess the chart type, but for more
* complex charts it is recommended to specify this property for clarity.
*/
typeDescription?: string;
}
/**
* Options to align the element relative to the chart or another box.
*/
export interface AlignObject {
/**
* Horizontal alignment. Can be one of `left`, `center` and `right`.
*/
align?: AlignValue;
/**
* Use the `transform` attribute with translateX and translateY custom
* attributes to align this elements rather than `x` and `y` attributes.
*/
alignByTranslate?: boolean;
/**
* Vertical alignment. Can be one of `top`, `middle` and `bottom`.
*/
verticalAlign?: VerticalAlignValue;
/**
* Horizontal pixel offset from alignment.
*/
x?: number;
/**
* Vertical pixel offset from alignment.
*/
y?: number;
}
/**
* An animation configuration. Animation configurations can also be defined as
* booleans, where `false` turns off animation and `true` defaults to a duration
* of 500ms.
*/
export interface AnimationOptionsObject {
/**
* A callback function to exectute when the animation finishes.
*/
complete?: Function;
/**
* The animation duration in milliseconds.
*/
duration?: number;
/**
* The name of an easing function as defined on the `Math` object.
*/
easing?: (string|Function);
/**
* A callback function to execute on each step of each attribute or CSS
* property that's being animated. The first argument contains information
* about the animation and progress.
*/
step?: Function;
}
/**
* (Highcharts, Highstock, Highmaps, Gantt) Options for annotation's control
* points. Each control point inherits options from controlPointOptions object.
* Options from the controlPointOptions can be overwritten by options in a
* specific control point.
*/
export interface AnnotationsControlPointOptions {
height?: number;
positioner?: any;
style?: AnnotationsControlPointStyleOptions;
symbol?: string;
visible?: boolean;
width?: number;
}
export interface AnnotationsControlPointStyleOptions {
fill?: string;
stroke?: string;
"stroke-width"?: number;
}
export interface AnnotationsCrookedLineControlPointOptions {
events?: any;
}
/**
* (Highstock) Options for annotation's labels. Each label inherits options from
* the labelOptions object. An option from the labelOptions can be overwritten
* by config for a specific label.
*/
export interface AnnotationsCrookedLineLabelOptions {
/**
* (Highstock) The alignment of the annotation's label. If right, the right
* side of the label should be touching the point.
*/
align?: AlignValue;
/**
* (Highstock) Whether to allow the annotation's labels to overlap. To make
* the labels less sensitive for overlapping, the can be set to 0.
*/
allowOverlap?: boolean;
/**
* (Highstock) The background color or gradient for the annotation's label.
*/
backgroundColor?: (ColorString|GradientColorObject|PatternObject);
/**
* (Highstock) The border color for the annotation's label.
*/
borderColor?: ColorString;
/**
* (Highstock) The border radius in pixels for the annotaiton's label.
*/
borderRadius?: number;
/**
* (Highstock) The border width in pixels for the annotation's label
*/
borderWidth?: number;
/**
* (Highstock) A class name for styling by CSS.
*/
className?: string;
/**
* (Highstock) Whether to hide the annotation's label that is outside the
* plot area.
*/
crop?: boolean;
/**
* (Highstock) The label's pixel distance from the point.
*/
distance?: number;
/**
* (Highstock) A format string for the data label.
*/
format?: string;
/**
* (Highstock) Callback JavaScript function to format the annotation's
* label. Note that if a `format` or `text` are defined, the format or text
* take precedence and the formatter is ignored. `This` refers to a point
* object.
*/
formatter?: FormatterCallbackFunction<Point>;
/**
* (Highstock) How to handle the annotation's label that flow outside the
* plot area. The justify option aligns the label inside the plot area.
*/
overflow?: OptionsOverflowValue;
/**
* (Highstock) When either the borderWidth or the backgroundColor is set,
* this is the padding within the box.
*/
padding?: number;
/**
* (Highstock) The shadow of the box. The shadow can be an object
* configuration containing `color`, `offsetX`, `offsetY`, `opacity` and
* `width`.
*/
shadow?: (boolean|ShadowOptionsObject);
/**
* (Highstock) The name of a symbol to use for the border around the label.
* Symbols are predefined functions on the Renderer object.
*/
shape?: string;
/**
* (Highstock) Styles for the annotation's label.
*/
style?: CSSObject;
/**
* (Highstock) Alias for the format option.
*/
text?: string;
/**
* (Highstock) Whether to use HTML to render the annotation's label.
*/
useHTML?: boolean;
/**
* (Highstock) The vertical alignment of the annotation's label.
*/
verticalAlign?: VerticalAlignValue;
/**
* (Highstock) The x position offset of the label relative to the point.
* Note that if a `distance` is defined, the distance takes precedence over
* `x` and `y` options.
*/
x?: number;
/**
* (Highstock) The y position offset of the label relative to the point.
* Note that if a `distance` is defined, the distance takes precedence over
* `x` and `y` options.
*/
y?: number;
}
/**
* (Highstock) A crooked line annotation.
*/
export interface AnnotationsCrookedLineOptions {
controlPointOptions?: AnnotationsCrookedLineControlPointOptions;
/**
* (Highstock) Options for annotation's labels. Each label inherits options
* from the labelOptions object. An option from the labelOptions can be
* overwritten by config for a specific label.
*/
labelOptions?: AnnotationsCrookedLineLabelOptions;
/**
* (Highstock) Options for annotation's shapes. Each shape inherits options
* from the shapeOptions object. An option from the shapeOptions can be
* overwritten by config for a specific shape.
*/
shapeOptions?: AnnotationsCrookedLineShapeOptions;
/**
* (Highstock) Additional options for an annotation with the type.
*/
typeOptions?: AnnotationsCrookedLineTypeOptions;
}
/**
* (Highstock) Options for annotation's shapes. Each shape inherits options from
* the shapeOptions object. An option from the shapeOptions can be overwritten
* by config for a specific shape.
*/
export interface AnnotationsCrookedLineShapeOptions {
/**
* (Highstock) The color of the shape's fill.
*/
fill?: (ColorString|GradientColorObject|PatternObject);
/**
* (Highstock) The height of the shape.
*/
height?: number;
/**
* (Highstock) The radius of the shape.
*/
r?: number;
/**
* (Highstock) Defines additional snapping area around an annotation making
* this annotation to focus. Defined in pixels.
*/
snap?: number;
/**
* (Highstock) The color of the shape's stroke.
*/
stroke?: ColorString;
/**
* (Highstock) The pixel stroke width of the shape.
*/
strokeWidth?: number;
/**
* (Highstock) The type of the shape, e.g. circle or rectangle.
*/
type?: string;
/**
* (Highstock) The width of the shape.
*/
width?: number;
}
/**
* (Highstock) Line options.
*/
export interface AnnotationsCrookedLineTypeLineOptions {
fill?: string;
}
/**
* (Highstock) Additional options for an annotation with the type.
*/
export interface AnnotationsCrookedLineTypeOptions {
/**
* (Highstock) Line options.
*/
line?: AnnotationsCrookedLineTypeLineOptions;
points?: Array<AnnotationsCrookedLineTypePointsOptions>;
/**
* (Highstock) This number defines which xAxis the point is connected to. It
* refers to either the axis id or the index of the axis in the xAxis array.
*/
xAxis?: number;
/**
* (Highstock) This number defines which yAxis the point is connected to. It
* refers to either the axis id or the index of the axis in the xAxis array.
*/
yAxis?: number;
}
export interface AnnotationsCrookedLineTypePointsOptions {
controlPoint?: number;
/**
* (Highstock) The x position of the point.
*/
x?: number;
/**
* (Highstock) The y position of the point.
*/
y?: number;
}
export interface AnnotationsElliottWaveControlPointOptions {
events?: any;
}
/**
* (Highstock) Options for annotation's labels. Each label inherits options from
* the labelOptions object. An option from the labelOptions can be overwritten
* by config for a specific label.
*/
export interface AnnotationsElliottWaveLabelOptions {
/**
* (Highstock) The alignment of the annotation's label. If right, the right
* side of the label should be touching