///
///
///
///
///
///
///
///
///
///
declare module FintaChart {
/**
* Interface contains method to cleanup internal resources
*/
interface IDisposable {
/**
* Cleanup memory and dispose class instance
*/
dispose(): void;
}
}
declare module FintaChart {
/**
* Supports state operations.
*
* @template T The type of the state instance.
*/
interface IStateable {
/**
* Returns state of current instance.
*
* @return The state of current instance.
*/
saveState(): T;
/**
* Restores instance state.
*
* @param state The previously saved state.
*/
restoreState(state: T): void;
}
}
declare module FintaChart {
}
declare module FintaChart {
interface BBRun {
text: string;
bold: boolean;
italic: boolean;
underline: boolean;
color?: string;
}
class BBCode {
private static readonly MAX_LEN;
private static readonly MAX_TAGS;
private static readonly MAX_DEPTH;
private static readonly MAX_COLOR_LEN;
private static readonly NAMED_COLORS;
static parse(text: string): BBRun[][];
private static literal;
private static parseInternal;
private static readTag;
private static safeColor;
private static inByteRange;
}
}
declare module FintaChart {
}
interface Math {
round(value: string): number;
roundToDecimals(value: number, decimals: number): number;
trunc(value: number): number;
}
declare module FintaChart {
const state2 = "PAYVFBpUSGwYCBwTagMaBxMPERc3Gk8HBgNIIhgIXQQtCxQ=";
type IAction1 = (arg: T) => void;
/**
* @description Represents string padding options
* @export
* @interface IStringPaddingOptions
*/
interface IStringPaddingOptions {
/**
* @description Align left
* @type {boolean}
* @memberof IStringPaddingOptions
*/
alignLeft: boolean;
/**
* @description Padding
*/
padding: string;
/**
* @description Width
* @type {number}
* @memberof IStringPaddingOptions
*/
width: number;
}
/**
* @description Represents java script extensions
* @export
* @class ExtensionJavaScript
*/
class ExtensionJavaScript {
/**
* @description Applies mixins
* @static
* @param {*} derivedCtor
* @param {any[]} baseCtors
* @memberof ExtensionJavaScript
*/
static applyMixins(derivedCtor: any, baseCtors: any[]): void;
/**
* @description Compare approx
* @static
* @param {number} number1
* @param {number} number2
* @returns {number}
* @memberof ExtensionJavaScript
*/
static approxCompare(number1: number, number2: number): number;
/**
* @description Binary search
* @static
* @param {number[]} data
* @param {number} searchElement
* @returns {number}
* @memberof ExtensionJavaScript
*/
static binarySearch(data: number[], searchElement: number): number;
/**
* @description Calculates digits by tick size
* @static
* @param {number} tickSize
* @returns {number}
* @memberof ExtensionJavaScript
*/
static calculateDigitsByTickSize(tickSize: number): number;
/**
* @description Clones
* @static
* @template T
* @param {T} obj
* @returns {T}
* @memberof ExtensionJavaScript
*/
static clone(obj: T): T;
/**
* @description Equals
* @static
* @param {number} left
* @param {number} right
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static equals(left: number, right: number): boolean;
/**
* @description Extends
* @static
* @param {ObjectConstructor} dst
* @param {ObjectConstructor} src
* @memberof ExtensionJavaScript
*/
static extend(dst: ObjectConstructor, src: ObjectConstructor): void;
/**
* @description Filters text
* @static
* @param {string} text
* @returns {string}
* @memberof ExtensionJavaScript
*/
static filterText(text: string): string;
/**
* @description Returns flatten array
* @static
* @template T
* @param {T[]} array
* @returns {T[]}
* @memberof ExtensionJavaScript
*/
static flattenArray(array: T[]): T[];
/**
* @description Returns flatten array
* @static
* @template T
* @param {(T | T[] | T[][] | T[][][])} array
* @param {(item: T) => void} callback
* @memberof ExtensionJavaScript
*/
static flattenedArray(array: T | T[] | T[][] | T[][][], callback: (item: T) => void): void;
/**
* @description Returns is finite number
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isFiniteNumber(value: any): boolean;
/**
* @description Returns is finite number or NaN
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isFiniteNumberOrNaN(value: any): boolean;
/**
* @description Returns is function
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isFunction(value: any): boolean;
/**
* @description Returns is negative number
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isNegativeNumber(value: any): boolean;
/**
* @description Returns is number
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isNumber(value: any): boolean;
/**
* @description Returns is positive number
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isPositiveNumber(value: any): boolean;
/**
* @description Returns is positive number or NaN
* @static
* @param {*} value
* @returns {boolean}
* @memberof ExtensionJavaScript
*/
static isPositiveNumberOrNaN(value: any): boolean;
/**
* @description Returns log
* @static
* @param {number} value
* @returns {number}
* @memberof ExtensionJavaScript
*/
static log(value: number): number;
/**
* @description Returns pad string
* @static
* @param {string} str
* @param {IStringPaddingOptions} options
* @returns {string}
* @memberof ExtensionJavaScript
*/
static padStr(str: string, options: IStringPaddingOptions): string;
/**
* @description Returns shallow clone
* @static
* @template T
* @param {T} obj
* @returns {T}
* @memberof ExtensionJavaScript
*/
static shallowClone(obj: T): T;
/**
* @description Sorts
* @static
* @template T
* @param {T[]} array
* @param {(left: T, right: T) => number} comparer
* @memberof ExtensionJavaScript
*/
static sort(array: T[], comparer: (left: T, right: T) => number): void;
/**
* @description Truncates
* @static
* @param {number} value
* @returns
* @memberof ExtensionJavaScript
*/
static truncateEx(value: number): number;
static generateGUID(): string;
static hashCode(str: string): number;
static singleActivePromise Promise, U>(fn: T, result: (arr: U) => void): (...args: Parameters) => void;
}
}
declare module FintaChart {
/**
* Provides color helper functions.
*
* @category Utils
*/
class Color {
/**
* Determines whether specified color is a dark color.
*
* @param color The color
* @return true if provided color is a dark color; otherwise, false.
*/
static isDark(color: string): boolean;
/**
* Determines whether specified color is a light color.
*
* @param color The color
* @return true if provided color is a light color; otherwise, false.
*/
static isLight(color: string): boolean;
/**
* Generates color that is visible on specified color(s).
*
* @param value The color or list of colors.
* @return Color that is visible on specified color(s).
*/
static visibleColor(value: string | string[]): string;
/**
* Converts color to hexadecimal format.
*
* @param color The color.
* @return Color in hexadecimal format.
*/
static toHex(color: string): string;
/**
* Converts color to RGB format.
*
* @param color The color.
* @return Color in RGB format.
*/
static toRgb(color: string | ColorFormats.RGBA): string;
/**
* Makes color lighten.
*
* @param colorString The color.
* @param luminosity The luminosity.
* @return Color, lighten than a given color.
*/
static lighten(colorString: string, luminosity?: number): string;
/**
* Returns random color.
*
* @return Random color.
*/
static random(): string;
/**
* Compares two color turning them to hex.
*
* @param firstColor First color to compare.
* @param secondColor Second color to compare.
* @return boolean.
*/
static compare(firstColor: string, secondColor: string): boolean;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
interface Document {
mozFullScreenElement?: Element;
mozFullScreenEnabled?: boolean;
msFullscreenElement?: Element;
msFullscreenEnabled?: boolean;
webkitFullscreenEnabled?: boolean;
querySelector(selectors: string): E | null;
querySelectorAll(selectors: string): NodeListOf;
mozCancelFullScreen(): any;
msExitFullscreen(): any;
webkitExitFullscreen(): any;
}
interface Element {
ALLOW_KEYBOARD_INPUT?: number;
mozFullScreenElement: Element | undefined;
msFullscreenElement: Element | undefined;
querySelector(selectors: string): E | null;
querySelectorAll(selectors: string): NodeListOf;
closest(selectors: string): E | null;
mozRequestFullScreen(): any;
msRequestFullscreen(): any;
webkitRequestFullscreen(flag?: number): any;
}
interface Event {
key?: string;
}
declare module FintaChart {
/**
* Represents html extensions
*
* @category Utils
*/
class HtmlHelper {
/**
* Retina canvas
*
* @param canvas
* @param context
* @param width
* @param height
*/
/**
* Upper bound for the device pixel ratio used when sizing canvases.
* Lower values trade sharpness for far cheaper fills on mobile.
*/
static dprCap: number;
static canvasRetina(canvas: HTMLCanvasElement, context: CanvasRenderingContext2D, width: number, height: number): void;
/**
* Returns full screen is enabled
*
* @return
*/
static fullscreenEnabled(): boolean;
/**
* Enters full screen
*
* @param element
*/
static enterFullscreen(element?: HTMLElement): void;
/**
* Exits full screen
*/
static exitFullscreen(): void;
/**
* Cleans up html code
*
* @param value
* @return
*/
static cleanupHtmlCode(value: string | HTMLElement): HTMLElement;
/**
* Sets back ground color
*
* @param control
* @param backgroundColors
*/
static background(control: HTMLElement, backgroundColors: string[] | string): void;
/**
* Sets back ground color
*
* @param control
* @param color
*/
static backgroundColor(control: HTMLElement, color: string): void;
/**
* Set background color with gradient
*
* @param control
* @param colors
*/
static gradientBackground(control: HTMLElement, colors: string[]): void;
/**
* Sets visibility
*
* @param control
* @param visible
*/
static visibility(control: HTMLElement, visible: boolean): void;
/**
* Updates canvas size
*
* @param canvas
* @param width
* @param height
*/
static updateCanvasSize(canvas: HTMLCanvasElement, width: number, height: number): void;
static toBorderStyle(lineStyle: LineStyle): string;
static downloadFile(data: string, fileName: string, fileType?: string): void;
}
}
declare module FintaChart {
/**
* Native DOM utility functions replacing legacy patterns.
*
* @category Utils
*/
class DomUtils {
/**
* Creates an HTMLElement from an HTML string.
* If the string contains multiple root elements, wraps them in a div.
*
* @param html The HTML string to parse.
* @return The created element.
*/
static createElement(html: string): HTMLElement;
/**
* Creates an array of HTMLElements from an HTML string.
* Unlike createElement, this preserves multiple root elements
* without wrapping them in a container div.
*
* @param html The HTML string to parse.
* @return Array of created elements.
*/
static createElements(html: string): HTMLElement[];
/**
* Creates and appends a child element with optional CSS classes.
*
* @param parent The parent element.
* @param tag The tag name for the new element.
* @param classes CSS classes to add.
* @return The created element.
*/
static appendElement(parent: HTMLElement, tag: string, ...classes: string[]): HTMLElement;
/**
* Creates and prepends a child element with optional CSS classes.
*
* @param parent The parent element.
* @param tag The tag name for the new element.
* @param classes CSS classes to add.
* @return The created element.
*/
static prependElement(parent: HTMLElement, tag: string, ...classes: string[]): HTMLElement;
/**
* Creates and appends an absolutely-positioned canvas element.
*
* @param parent The parent element.
* @return The created canvas element.
*/
static appendCanvas(parent: HTMLElement): HTMLCanvasElement;
/**
* Applies border style from a stroke theme.
*
* @param el The target element.
* @param border The CSS border property name (e.g. 'border', 'border-top').
* @param theme The stroke theme.
*/
static applyBorder(el: HTMLElement, border: string, theme: IStrokeTheme): void;
/**
* Applies border style with fixed 0.05em width from a stroke theme.
*
* @param el The target element.
* @param border The CSS border property name.
* @param theme The stroke theme.
*/
static applyBorderBFT(el: HTMLElement, border: string, theme: IStrokeTheme): void;
/**
* Applies fill background color from a fill theme.
*
* @param el The target element.
* @param theme The fill theme.
*/
static applyFill(el: HTMLElement, theme: IFillTheme): void;
/**
* Applies text style from a text theme.
*
* @param el The target element.
* @param theme The text theme.
*/
static applyTextStyle(el: HTMLElement, theme: ITextTheme): void;
/**
* Sets a CSS property on an element.
*
* @param el The target element.
* @param prop The CSS property name.
* @param value The CSS property value.
*/
static css(el: HTMLElement, prop: string, value: string | number): void;
private static _rectCache;
private static _rectCacheStamp;
/**
* Bounding rect cached within an 8ms frame bucket.
*
* @param el The element.
* @return The (possibly cached) bounding rect.
*/
static cachedBoundingRect(el: HTMLElement): DOMRect;
/**
* Converts client (viewport) coordinates to local element coordinates.
*
* @param el The reference element.
* @param clientX Client X coordinate.
* @param clientY Client Y coordinate.
* @return Local point coordinates.
*/
static clientToLocalPoint(el: HTMLElement, clientX: number, clientY: number): IPoint;
/**
* Converts local element coordinates to client (viewport) coordinates.
*
* @param el The reference element.
* @param localX Local X coordinate.
* @param localY Local Y coordinate.
* @return Client point coordinates.
*/
static localToClientPoint(el: HTMLElement, localX: number, localY: number): IPoint;
/**
* Returns the content size (inner dimensions excluding borders, including padding).
* Equivalent to legacy innerWidth/innerHeight helpers.
*
* @param el The element.
* @return The content size.
*/
static contentSize(el: HTMLElement): ISize;
/**
* Returns the outer size including borders.
* Equivalent to legacy outerWidth/outerHeight helpers.
*
* @param el The element.
* @return The outer size.
*/
static outerSize(el: HTMLElement): ISize;
/**
* Sets the position and size of an element.
*
* @param el The target element.
* @param frame The bounds to apply.
*/
static setFrame(el: HTMLElement, frame: IBounds): void;
/**
* Sets the CSS position (left, top) of an element.
*
* @param el The target element.
* @param left Left offset in pixels.
* @param top Top offset in pixels.
*/
static setPosition(el: HTMLElement, left: number, top: number): void;
/**
* Centers element horizontally in the viewport with a given top offset.
* Replaces legacy jqTop extension.
*
* @param el The target element.
* @param topOffset The top CSS value (e.g. '6rem').
*/
static centerHorizontally(el: HTMLElement, topOffset: string): void;
/**
* Binds a tap handler firing once on touch or click.
*
* @param el The target element.
* @param handler The tap handler.
*/
static onTap(el: HTMLElement, handler: (e: Event) => void): void;
/**
* Shows an element by clearing its display style.
*
* @param el The element to show.
*/
static show(el: HTMLElement | null): void;
/**
* Hides an element by setting display to none.
*
* @param el The element to hide.
*/
static hide(el: HTMLElement | null): void;
/**
* Toggles element visibility.
*
* @param el The element to toggle.
* @param visible If provided, forces visible/hidden state.
*/
static toggle(el: HTMLElement | null, visible?: boolean): void;
/**
* Sets the i18n data attribute and optional default text.
*
* @param el The target element.
* @param key The i18n key.
* @param defaultValue Optional default text.
*/
static localize(el: HTMLElement, key: string, defaultValue?: string): void;
/**
* Finds a single descendant matching the selector.
*
* @param el The parent element.
* @param selector CSS selector.
* @return The matching element or null.
*/
static find(el: HTMLElement, selector: string): HTMLElement | null;
/**
* Finds all descendants matching the selector.
*
* @param el The parent element.
* @param selector CSS selector.
* @return Array of matching elements.
*/
static findAll(el: HTMLElement, selector: string): HTMLElement[];
/**
* Returns the document owning a node. Falls back to the main
* document for detached nodes, so dropdowns keep working when the
* chart is moved between documents (e.g. Document Picture-in-Picture).
*
* @param node The node whose document is required.
* @return The owning document.
*/
static ownerDocumentOf(node: Node | null | undefined): Document;
/**
* Returns the window owning a node. Falls back to the main window
* for detached nodes.
*
* @param node The node whose window is required.
* @return The owning window.
*/
static ownerWindowOf(node: Node | null | undefined): Window;
/**
* Removes all child elements matching a tag from an element.
* Used for HTML sanitization.
*
* @param el The parent element.
* @param tags Tag names to remove.
*/
static removeChildrenByTag(el: HTMLElement, ...tags: string[]): void;
/**
* Inserts an element after a reference element.
*
* @param newElement The element to insert.
* @param referenceElement The reference element.
* @return The inserted element.
*/
static insertAfter(newElement: HTMLElement, referenceElement: HTMLElement): HTMLElement;
/**
* Deep clones an object. Replaces $.extend(true, {}, obj).
*
* @param obj The object to clone.
* @return The cloned object.
*/
static deepClone(obj: T): T;
}
}
declare module FintaChart {
/**
* Draggable position info passed to callbacks.
*/
interface IDraggablePosition {
left: number;
top: number;
}
/**
* Configuration options for makeDraggable.
*/
interface IDraggableOptions {
/** Element used as drag handle. If not set, the element itself is the handle. */
handle?: HTMLElement | string;
/** Constrains dragging within the given element, or "window" for viewport. */
containment?: HTMLElement | string;
/** Restricts dragging to a single axis: 'x' or 'y'. */
axis?: 'x' | 'y';
/** Called when dragging starts. */
onStart?: () => void;
/** Called during dragging. */
onDrag?: (position: IDraggablePosition) => void;
/** Called when dragging stops. */
onStop?: (position: IDraggablePosition) => void;
}
/**
* Controller returned by makeDraggable for managing the draggable instance.
*/
interface IDraggableController {
/** Destroys the draggable behavior, removing all event listeners. */
destroy(): void;
/** Enables or disables dragging. */
setEnabled(enabled: boolean): void;
/** Re-clamps the element inside its containment (e.g. after a resize). */
reclamp(): void;
}
/**
* Makes an element draggable using native pointer events.
* Replaces legacy UI .draggable().
*
* @param el The element to make draggable.
* @param options Configuration options.
* @return A controller for managing the draggable.
*/
function makeDraggable(el: HTMLElement, options?: IDraggableOptions): IDraggableController;
}
declare module FintaChart {
/**
* Configuration options for makeResizable.
*/
interface IResizableOptions {
/** Direction of resizing: 'horizontal' or 'vertical'. */
direction: 'horizontal' | 'vertical';
/** Minimum width in pixels (for horizontal). */
minWidth?: number;
/** Minimum height in pixels (for vertical). */
minHeight?: number;
/** Container element for boundary constraints. */
container?: HTMLElement;
/** Called when resizing starts. */
onStart?: () => void;
/** Called during resizing. */
onResize?: () => void;
/** Called when resizing stops. */
onStop?: () => void;
}
/**
* Controller returned by makeResizable for managing the resizable instance.
*/
interface IResizableController {
/** Destroys the resizable behavior, removing all event listeners. */
destroy(): void;
}
/**
* Makes an element resizable by adding drag handles on its edges.
* Replaces legacy UI .resizable() with custom implementation.
*
* @param el The element to make resizable.
* @param options Configuration options.
* @return A controller for managing the resizable.
*/
function makeResizable(el: HTMLElement, options: IResizableOptions): IResizableController;
}
declare module FintaChart {
}
declare module FintaChart {
}
/**
* @hidden
*/
interface Math {
round(value: string): number;
roundToDecimals(value: number, decimals: number): number;
trunc(value: number): number;
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
function createChart(container: HTMLElement, config: IChartConfig): Chart;
}
declare module FintaChart {
/**
* Represents string padding options.
*
* @category Utils
*/
interface IStringPaddingOptions {
/**
* The flag that indicates whether text should be aligned on left.
*/
alignLeft: boolean;
/**
* The padding symbol.
*/
padding: string;
/**
* The desired text length.
*/
width: number;
}
/**
* Provides string helper functions.
*/
class StringHelper {
/**
* Applies html encoding to given text.
*
* @param text The text to encode.
* @return HTML encoded text.
*/
static htmlEncode(text: string): string;
/**
* Aligns characters in the string by padding them.
*
* @param str The string to pad.
* @param options The padding options.
* @return A new string that is equivalent to the given string but aligned and padded with as many characters
* as needed to create a desired length.
*/
static pad(str: string, options: IStringPaddingOptions): string;
static reverse(str: string): string;
}
}
declare module FintaChart {
/**
* Represents a chainable DOM helper
*
*/
interface ITcdDomHelper {
/**
* Returns shape settings drag panel
*
* @param chart
* @return
*/
shapeSettingsDragPane(chart?: Chart): ShapeSettingsDragPane;
/**
* Returns chart context menu
*
* @param config
* @return
*/
chartContextMenu(config: IChartContextMenuConfig): ChartContextMenu;
/**
* Returns color picker
*
* @param config
* @return
*/
colorPicker(config: Spectrum.Options): ColorPicker;
/**
* Returns comparing context menu
*
* @param config
* @return
*/
compareInstrumentContextMenu(config: ICompareInstrumentContextMenuConfig): CompareInstrumentContextMenu;
/**
* Returns indicator context menu
*
* @param config
* @return
*/
indicatorContextMenu(config: IIndicatorContextMenuConfig): IndicatorContextMenu;
/**
* Returns instrument search
*
* @param config
* @return
*/
instrumentSearch(config: IInstrumentSearchConfig): InstrumentSearch;
/**
* Returns numeric field
*
* @param config
* @return
*/
numericField(config: INumericFieldConfig): HTMLElement;
/**
* Returns scroll bar
*
* @param chart
* @return
*/
scrollbar(chart?: Chart): Scrollbar;
/**
* Returns simple drop down
*
* @return
*/
simpleDropdown(): DropDown;
/**
* Returns template manager
*
* @param config
* @return
*/
templatesManager(config: ITemplatesConfig): TemplatesManager;
/**
* Returns time frame picker
*
* @param config
* @return
*/
timeFramePicker(config: ITimeFramePickerConfig): TimeFramePicker;
/**
* Returns Toolbar
*
* @param chart
* @return
*/
toolbar(chart?: Chart | IToolbarConfig): Toolbar;
/**
* Returns toolbar drop down button
*
* @param config
* @return
*/
toolbarDropDownButton(config: IToolbarDropDownButtonConfig): ToolbarDropDownButton;
/**
* Returns waiting bar
*
* @return
*/
waitingBar(chart: Chart): IWaitingBar;
}
/**
* Standalone native-element factory. Replaces $(el).tcd() pattern.
*/
function tcd(el: HTMLElement): ITcdDomHelper;
}
declare module FintaChart {
type TDataRowsValue = Date | number;
type TDataRowsValues = Date[] | number[];
/**
* Represents Data Rows Config
*/
interface IDataRowsConfig {
/**
* Data Rows Config name
*/
name: string;
/**
* Data Rows Config values
*/
values: TDataRowsValues;
}
/**
* Represents Data Rows
*/
interface IDataRows {
/**
* Data Row's first value
*/
firstValue: TDataRowsValue;
/**
* Data Row's date data rows
*/
dateDataRows: boolean;
/**
* Data Row's prices data rows
*/
pricesDataRows: boolean;
/**
* Data Row's last value
*/
lastValue: TDataRowsValue;
/**
* Data Row's length
*/
length: number;
/**
* Data Row's name
*/
name: string;
/**
* Data Row's name marker
*/
nameMarker: string;
/**
* Data Row's records count
*/
recordsCount: number;
/**
* Adds Data Rows
*
* @param value
*/
add(...value: (TDataRowsValue | TDataRowsValues)[]): void;
/**
* Ceils Data Row's index
*
* @param searchValue
* @return Data Row's index
*/
ceilIndex(searchValue: TDataRowsValue): number;
/**
* Clears Data Row
*/
clear(): void;
/**
* Floors Data Row's index
*
* @param search
* @return Data Row's index
*/
floorIndex(search: TDataRowsValue): number;
/**
* Retrieves data from Data Rows
*
* @param row
* @param startIndex
*/
fromDataRow(row: DataRows, startIndex: number): any;
/**
* Initializes Data Rows
*
* @param recordsCount
* @param rowName
*/
initialize(recordsCount: number, rowName: string): void;
/**
* Retrieves Data Row's left visible index value
*
* @param index
* @return Data Row's left visible index value
*/
leftVisibleIndexValue(index: number): number;
/**
* Retrieves Data Row's min max values
*
* @param startIndex
* @param count
* @return Data Row's min max values
*/
minMaxValues(startIndex: number, count: number): IMinMax;
/**
* Retrieves Data Row's right visible index value
*
* @param index
* @return Data Row's right visible index value
*/
rightVisibleIndexValue(index: number): number;
/**
* Sets Data Row's value
*
* @param index
* @param value
*/
setValue(index: number, value: number): any;
/**
* Converts to Data Rows
*
* @param name
* @return Data Rows
*/
toDataRow(name: string): DataRows;
/**
* Trims Data Rows
*
* @param maxLength
* @return Data Rows
*/
trim(maxLength: number): number;
/**
* Updates Data Row's last
*
* @param value
*/
updateLast(value: TDataRowsValue): void;
/**
* Retrieves Data Row's value
*
* @param index
* @return Data Row's value
*/
value(index: number): number;
/**
* Retrieves Data Row's value at index
*
* @param index
* @param value
* @return Data Row's value at index
*/
valueAtIndex(index: number, value?: TDataRowsValue): TDataRowsValue;
}
/**
* Represents Min Max
*/
interface IMinMax {
/**
* Min Max's min
*/
min?: T;
/**
* Min Max's max
*/
max?: T;
}
const DataRowsMarker: {
DATE: string;
OPEN: string;
HIGH: string;
LOW: string;
CLOSE: string;
VOLUME: string;
HEIKIN_ASHI: string;
RENKO: string;
RANGE_BAR: string;
LINE_BREAK: string;
POINT_AND_FIGURE: string;
KAGI: string;
MEDIAN: string;
TYPICAL: string;
WEIGHTED: string;
};
/**
* Provides model of Data Rows
*/
class DataRows implements IDataRows {
private _name;
private _values;
/**
* Data Row's records count
*/
recordsCount: number;
/**
* Creates an instance of DataRows.
*
* @param config
*/
constructor(config?: string | IDataRowsConfig);
get firstValue(): TDataRowsValue;
get dateDataRows(): boolean;
get pricesDataRows(): boolean;
get lastValue(): TDataRowsValue;
get length(): number;
get name(): string;
set name(value: string);
get nameMarker(): string;
/**
* Get Data Row's values
*/
get values(): TDataRowsValues;
set values(value: TDataRowsValues);
/**
* Retrieves Data Row's data row from
*
* @param row
* @param startIndex
* @return Data Row's data row from
*/
static fromDataRow(row: DataRows, startIndex: number): DataRows;
add(...value: (TDataRowsValue | TDataRowsValues)[]): void;
/**
* Retrieves Data Row's binary index of
*
* @param searchElement
* @return Data Row's binary index of
*/
binaryIndexOf(searchElement: TDataRowsValue): number;
ceilIndex(searchValue: TDataRowsValue): number;
clear(): void;
floorIndex(search: TDataRowsValue): number;
fromDataRow(row: DataRows, startIndex: number): void;
initialize(recordsCount: number, rowName: string): void;
/**
* Inserts Data Rows
*
* @param index
* @param value
*/
insert(index: number, value: TDataRowsValue | TDataRowsValues): void;
/**
* Retrieves Data Row's items count between values
*
* @param startValue
* @param endValue
* @return Data Row's items count between values
*/
itemsCountBetweenValues(startValue: number, endValue: number): number;
leftVisibleIndexValue(index: number): number;
minMaxValues(startIndex?: number, count?: number): IMinMax;
rightVisibleIndexValue(index: number): number;
setValue(index: number, value: number): void;
toDataRow(name: string): DataRows;
trim(maxLength: number): number;
updateLast(value: TDataRowsValue): void;
value(index: number): number;
valueAtIndex(index: number, value?: TDataRowsValue): TDataRowsValue;
}
}
declare module FintaChart {
import DataRows = FintaChart.DataRows;
/**
* Represents Bar
*/
interface IBar {
/**
* Bar's date
*/
date: Date;
/**
* Bar's open
*/
open: number;
/**
* Bar's hight
*/
high: number;
/**
* Bar's low
*/
low: number;
/**
* Bar's close
*/
close: number;
/**
* Bar's volume
*/
volume: number;
}
/**
* Represents OHLC Data Rows
*/
interface IOHLCDataRows {
/**
* OHLC Data Row's date
*/
date: DataRows;
/**
* OHLC Data Row's open
*/
open: DataRows;
/**
* OHLC Data Row's hight
*/
high: DataRows;
/**
* OHLC Data Row's low
*/
low: DataRows;
/**
* OHLC Data Row's close
*/
close: DataRows;
}
/**
* Represents OHLC Data Rows
*/
interface IBarDataRows extends IOHLCDataRows {
/**
* OHLC Data Row's volume
*/
volume: DataRows;
}
/**
* Raw OHLC arrays (used for cloned/RTH session history, before wrapping into DataRows)
*/
interface IOhlcArrays {
date: Date[];
open: number[];
high: number[];
low: number[];
close: number[];
volume: number[];
}
/**
* Provides model of Data Context
*/
class DataContext {
private _dataRows;
get dataRows(): {
[key: string]: DataRows;
};
/**
* Get Data Context's date data rows
*/
get dateDataRows(): DataRows;
get dateRowsNames(): string[];
dataRowsCopy: IOhlcArrays | null;
/**
* Adds Data Context's bar data rows
*
* @param symbol
* @return Data Context's bar data rows
*/
addBarDataRows(symbol?: string): IBarDataRows;
/**
* Adds Data Context's data rows
*
* @param dataRows
* @param replaceIfExists
* @return Data Context's data rows
*/
addDataRows(dataRows: string | DataRows, replaceIfExists?: boolean): DataRows;
/**
* Appends Data Context's bars
*
* @param bars
*/
appendBars(...bars: (IBar | IBar[])[]): void;
/**
* Appends Data Context's instruments bars
*
* @param instrument
* @param bars
*/
appendInstrumentBars(instrument: IInstrument | null, ...bars: (IBar | IBar[])[]): void;
/**
* Retrieves Data Context's bar
*
* @param indexOrDate
* @param barDataRows
* @return Data Context's bar
*/
bar(indexOrDate: number | Date, barDataRows?: IBarDataRows): IBar;
/**
* Retrieves Data Context's bar data rows
*
* @param prefix
* @param createIfNotFound
* @return Data Context's bar data rows
*/
barDataRows(prefix?: string, createIfNotFound?: boolean): IBarDataRows;
/**
* Clears Data Context's bar data rows
*
* @param instrument
*/
clearBarDataRows(instrument?: IInstrument | null): void;
/**
* Clears Data Context's data rows
*
* @param dataRows
*/
clearDataRows(dataRows?: string | DataRows): void;
/**
* Cuts Data Context's data rows
*
* @param record
* @param length
*/
cutDataRows(record: number, length: number): void;
cutBarDataRows(record: number, length: number): void;
/**
* Finds Data Context's data rows
*
* @param rowMarker
* @return Data Context's data rows
*/
findDataRows(rowMarker: string): DataRows;
/**
* Retrieves Data Context's data rows
*
* @param name
* @param addIfNotFound
* @return Data Context's data rows
*/
getDataRows(name: string, addIfNotFound?: boolean): DataRows;
/**
* Retrieves Data Context's index by date
*
* @param date
* @return Data Context's index by date
*/
indexByDate(date: Date): number;
/**
* Inserts Data Context's bars
*
* @param index
* @param bars
*/
insertBars(index: number, bars: IBar | IBar[]): void;
/**
* Inserts Data Context's instruments bars
*
* @param instrument
* @param index
* @param bars
*/
insertInstrumentBars(instrument: IInstrument | null, index: number, bars: IBar | IBar[]): void;
/**
* Retrieves Data Context's OHLC data rows
*
* @param prefix
* @param createIfNotFound
* @return Data Context's OHLC data rows
*/
ohlcDataRows(prefix?: string, createIfNotFound?: boolean): IOHLCDataRows;
/**
* Removes Data Context's data rows
*
* @param dataRows
*/
removeDataRows(dataRows?: string | DataRows): void;
/**
* Trims Data Context's data rows
*
* @param maxLength
*/
trimDataRows(maxLength: number): void;
private eachDataRows;
}
}
declare module FintaChart {
const TimeSpan: {
MILLISECONDS_IN_YEAR: number;
MILLISECONDS_IN_MONTH: number;
MILLISECONDS_IN_WEEK: number;
MILLISECONDS_IN_DAY: number;
MILLISECONDS_IN_HOUR: number;
MILLISECONDS_IN_MINUTE: number;
MILLISECONDS_IN_SECOND: number;
};
enum Periodicity {
TICK = "t",
SECOND = "s",
MINUTE = "",
HOUR = "h",
DAY = "d",
WEEK = "w",
MONTH = "m",
YEAR = "y"
}
/**
* Represents Time Frame
*/
interface ITimeFrame {
/**
* Time Frame's interval
*/
interval: number;
/**
* Time Frame's periodicity
*/
periodicity: string;
}
const TimeUnits: {
secondsInMinute: number;
minutesInHour: number;
minutesInDay: number;
hoursInDay: number;
daysInWeek: number;
daysInMonth: number;
daysInYear: number;
weeksInYear: number;
monthsInYear: number;
};
/**
* Provides model of Time Frame
*/
class TimeFrame implements ITimeFrame {
interval: number;
periodicity: string;
/**
* Creates an instance of TimeFrame.
*
* @param periodicity
* @param interval
*/
constructor(periodicity?: string, interval?: number);
/**
* Retrieves Time Frame's periodicity name
*
* @param periodicityCode
* @return Time Frame's periodicity name
*/
static periodicityName(periodicityCode: string): string;
/**
* Retrieves Time Frame's periodicity short name
*
* @param periodicityCode
* @return Time Frame's periodicity short name
*/
static periodicityShortName(periodicityCode: string): string;
/**
* Retrieves Time Frame's interval
*
* @param timeFrame
* @return Time Frame's interval
*/
static toInterval(timeFrame: ITimeFrame): number;
/**
* Retrieves Time Frame's interval time frame
*
* @param timeInterval
* @return Time Frame's interval time frame
*/
static fromInterval(timeInterval: number): TimeFrame;
static shortName(timeFrame: ITimeFrame | number): string;
static equals(left: TimeFrame, right: TimeFrame): boolean;
/**
* Converts Time Frame to string
*
* @return Converted Time Frame to string
*/
toString(): string;
private static periodicityCode;
}
}
declare module FintaChart {
/**
*
*/
interface IBoxDateReversed {
date: Date;
price: number;
}
}
declare module FintaChart {
/**
*
*/
class TimeFrameBarsManager implements IDisposable {
private readonly _chart;
private _store;
constructor(chart: Chart);
getTimeFrameBars(timeFrame: ITimeFrame): IBarDataRows;
dispose(): void;
private getStoredTimeFrameBars;
private storeBars;
private clearStore;
private subscribe;
private unsubscribe;
private onLastBarUpdated;
private onBarsAppended;
private recalculateDataRows;
private static getEmptyBarDataRows;
}
}
declare module FintaChart {
/**
* Represents Formatter Date Time
*
*/
interface IDateTimeFormatter extends IStateable {
/**
* Formatter Date Time locale
*/
locale: string;
/**
* Formatter Date Time time interval
*/
timeInterval?: number;
/**
* Retrieves Formatter Date Time's format
*
* @param date
* @return
*/
format(date: Date): string;
}
/**
* Represents Formatter Date Time State
*
*/
interface IDateTimeFormatterState {
/**
* Formatter Date Time State's instance type name
*/
type: string;
/**
* Formatter Date Time State's locale
*/
locale: string;
}
/**
* Provides model of Formatter Date Time
*/
abstract class DateTimeFormatter implements IDateTimeFormatter {
/**
* Get name on instance type
*/
static get type(): string;
private _locale;
/**
* Get Formatter Date Time locale
*/
get locale(): string;
set locale(value: string);
saveState(): IDateTimeFormatterState;
restoreState(state: IDateTimeFormatterState): void;
abstract format(date: Date): string;
/**
* On locale changed event emit
*/
protected onLocaleChanged(): void;
}
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents Formatter Number
*
*/
interface INumberFormatter extends IStateable {
/**
* Formatter Number's locale
*/
locale: string;
/**
* Retrieves Formatter Number's format
*
* value
* @return Formatter Number's format
*/
format(value: number, tickSize: number): string;
}
/**
* Represents Formatter Number State
*
*/
interface INumberFormatterState {
/**
* Formatter Number State's instance type name
*/
type: string;
/**
* Formatter Number State's locale
*/
locale: string;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents Local Storage
*/
interface ILocalStorage {
/**
* Saves Local Storage
*
* @param key
* @param data
* @return
*/
save(key: string, data: string): void;
/**
* Loads Local Storage
*
* @param key
* @return
*/
load(key: string): Promise;
/**
* Clears Local Storage
*
* @param key
* @return
*/
clear(key?: string): Promise;
}
}
declare module FintaChart {
/**
* Provides model of Local Storage Wrapper
*/
class LocalStorage implements ILocalStorage {
/**
* Clears Local Storage
*
* @param key
*/
clear(key?: string): Promise;
/**
* Loads Local Storage
*
* @param key
* @return Loaded data from storage
*/
load(key: string): Promise;
/**
* Saves Local Storage
*
* @param key
* @param data
*/
save(key: string, data: string): void;
private static ensureLocalStorageAvailable;
}
}
declare module FintaChart {
/**
* Describes datafeed.
*/
interface IDatafeedBase extends IDisposable {
/**
* Sends request to load data
*
* @param request
*/
send(request: IRequest): void;
/**
* Cancels load data request
*
* @param request
*/
cancel(request: IRequest): void;
/**
* Returns is request in progress
*
* @param request
*/
isBusy(request: IRequest): boolean;
/**
* Notifies about compare error
*
* @param message
* @param symbol
*/
notifyCompareError(message: string, symbol?: string): void;
}
/**
* Represents base data feed
*
* @category Datafeeds
*/
abstract class DatafeedBase implements IDatafeedBase {
private static _requestId;
private _requestPerId;
/**
* Increments request id
*/
static createRequestNumber(): number;
dispose(): void;
send(request: IRequest): void;
/**
* Notifies about compare error
*
* @param message
* @param symbol
*/
notifyCompareError(message: string, symbol?: string): void;
cancel(request: IRequest): void;
isBusy(request: IRequest): boolean;
/**
* Handles request completing
*
* @param request
* @param bars
*/
protected onCompleteRequest(request: IBarsRequest, bars: IBar[]): void;
/**
* Handles request canceling
*
* @param request
*/
protected onCancelRequest(request: IBarsRequest): void;
}
}
declare module FintaChart {
/**
* Represents data feed core config
*/
interface IDatafeedConfig {
/**
* Returns instruments
*/
instruments(): Promise;
/**
* Loads data
*
* @param request
* @return
*/
loadData(request: IBarsRequest): Promise;
/**
* Handles real time subscription
*
* @param instrumentName
* @param exchange
*/
onSubscribeRealtime(instrumentName: string, exchange: string): void;
/**
* handles real time unsubscription
*
* @param instrumentName
* @param exchange
*/
onUnsubscribeRealtime(instrumentName: string, exchange: string): void;
}
/**
* Describes realtime tick data.
*/
interface ITick {
/**
* The symbol name.
*/
symbol: string;
/**
* The timestamp.
*/
timeStamp: number;
/**
* The ask price
*/
ask: number;
/**
* The ask size.
*/
askSize: number;
/**
* The bid price.
*/
bid: number;
/**
* The bid size.
*/
bidSize: number;
/**
* The last price.
*/
price: number;
/**
* The last volume.
*/
volume: number;
}
/**
* Represents data feed core
*
* @category Datafeeds
*/
class DatafeedCore extends DatafeedBase {
private _chart;
private _config;
private _currentInstrument;
/**
* Creates an instance of DatafeedCore.
*
* @param config
*/
constructor(config: IDatafeedConfig);
/**
* Handles real time tick
*
* @param tick
*/
onRealtimeTick(tick: ITick): void;
send(request: IBarsRequest): void;
private static getLastBar;
private static initBar;
private static updateLastBar;
private loadData;
}
}
declare module FintaChart {
/**
* The kind of datafeed request.
*/
enum RequestKind {
/**
* The request to load bars.
*/
BARS = "bars",
/**
* The request to load additional portion of bars for the chart.
*/
MORE_BARS = "moreBars"
}
/**
* Describes datafeed request.
*/
interface IRequest {
/**
* The chart associated with the request.
*/
chart?: Chart;
/**
* The unique request number.
*/
requestNumber?: number;
/**
* The request kind.
*/
kind: RequestKind;
}
/**
* Describes request to load bar data.
*/
interface IBarsRequest extends IRequest {
/**
* The instrument.
*/
instrument?: IInstrument;
/**
* The number of bars to load.
*/
count: number;
/**
* The ending date to load bars.
*/
endDate?: Date;
/**
* Reset visible range to default view after load.
*/
resetVisibleRange?: boolean;
}
}
declare module FintaChart.Formatters {
/**
* Provides external data formatter csv
*
*/
class ExternalDataFormatterCsv implements IFileDatafeedFormatter {
/**
* Parses bars
*
* @param data
* @param request
* @return
*/
parseBars(data: string, request: IBarsRequest): Promise;
}
}
declare module FintaChart.Formatters {
}
declare module FintaChart {
/**
* Represents file data feed instrument
*/
interface IFileDatafeedInstruments {
[name: string]: {
instrument: IInstrument;
info: IFileInstrumentDescriptionExtended[];
};
}
/**
* Represents file instrument description extended
*/
interface IFileInstrumentDescriptionExtended {
/**
* Path
*/
path: string;
/**
* Interval
*/
interval: number;
/**
* Periodicity
* Supported codes:
* TICK: "t",
* SECOND: "s",
* MINUTE: "",
* HOUR: "h",
* DAY: "d",
* WEEK: "w",
* MONTH: "m",
* YEAR: "y"
*/
periodicity: string;
}
/**
* Represents file data feed formatter
*/
interface IFileDatafeedFormatter {
/**
* Parsers bars
*
* @param data
* @param request
* @return
*/
parseBars(data: string | object[], request: IBarsRequest): Promise;
}
/**
* Represents file data feed config
*/
interface IFileDatafeedConfig {
/**
* External data formatter
*/
externalDataFormatter: IFileDatafeedFormatter;
/**
* Instruments
*/
instruments: IFileDatafeedInstruments;
}
/**
* Represents file data feed
*
* @category Datafeeds
*/
class FileDatafeed extends DatafeedBase {
private readonly _config;
/**
* Creates an instance of FileDatafeed.
*
* @param config
*/
constructor(config: IFileDatafeedConfig);
/**
* Inits
*
* @return
*/
init(): Promise;
send(request: IBarsRequest): void;
private compareBars;
private loadData;
private processResult;
}
}
declare module FintaChart {
/**
* Represents rest request adapter
*/
interface IRestRequestAdapter {
/**
* Returns format history
*
* @param request
* @return
*/
formatGetHistory(request: IBarsRequest): {
path: string;
config: RequestInit;
};
/**
* Returns format instruments
*
* @return
*/
formatGetInstruments(): {
path: string;
config: RequestInit;
};
/**
* Returns format ticks
*
* @param name
* @param exchange
* @return
*/
formatGetLastTick(name: string, exchange: string): {
path: string;
config: RequestInit;
};
}
/**
* Rest response adapter
*/
interface IRestResponseAdapter {
/**
* Returns bars
*
* @param data
* @return
*/
formatBars(data: any): IBar[];
/**
* Return format instruments
*
* @param data
* @return
*/
formatInstruments(data: any): IInstrument[];
/**
* Returns format real time
*
* @param data
* @return
*/
formatRealtime(data: any): ITick;
}
/**
* Configuration shape accepted by the generic `Datafeed` wrapper.
*/
interface IGenericDatafeedConfig {
/**
* Base URI of the REST data source.
*/
url: string;
/**
* Polling interval for realtime updates, in milliseconds.
* Defaults to 5000 ms when omitted.
*/
realtimeUpdateInterval?: number;
}
/**
* Provides rest data feed
*
* @category Datafeeds
*/
class RestDatafeed {
private _datafeed;
private _instruments;
private _requestFormatter;
private _responseFormatter;
private readonly _datasourceApiUri;
private readonly _realtimeUpdateInterval;
currentInstrument: string;
/**
* Creates an instance of RestDatafeed.
*
* @param baseApiUri
* @param realtimeUpdateInterval
*/
constructor(baseApiUri: string, realtimeUpdateInterval: number);
/**
* Get request formatter
*/
get requestFormatter(): IRestRequestAdapter;
/**
* Set request formatter
*/
set requestFormatter(value: IRestRequestAdapter);
/**
* Get response formatter
*/
get responseFormatter(): IRestResponseAdapter;
/**
* Set response formatter
*/
set responseFormatter(value: IRestResponseAdapter);
/**
* Inits
*
* @return
*/
init(): Promise;
private getInstruments;
private getLastTick;
private loadHistorical;
private onSubscribe;
private onUnsubscribe;
}
/**
* Generic options-object datafeed used by the quick-start examples:
*
* ```javascript
* new FintaChart.Datafeed({ url: '/api/bars' });
* ```
*
* Thin wrapper over `RestDatafeed` that accepts a configuration
* object rather than positional arguments. The two-string positional
* form (`new Datafeed('/api', 5000)`) is also supported for parity
* with `RestDatafeed`.
*/
class Datafeed extends RestDatafeed {
constructor(config: IGenericDatafeedConfig | string, realtimeUpdateInterval?: number);
}
}
declare module FintaChart {
/**
* Represents web socket data feed
*/
interface IWebSocketDatafeedRequest {
/**
* Returns format history
*
* @param request
* @return
*/
formatGetHistory(request: IBarsRequest): string;
/**
* Returns format instruments
*
* @return
*/
formatGetInstruments(): string;
/**
* Returns format subscribe
*
* @param name
* @param exchange
* @return
*/
formatSubscribe(name: string, exchange: string): string;
/**
* Returns format unsubscribe
*
* @param name
* @param exchange
* @return
*/
formatUnsubscribe(name: string, exchange: string): string;
}
/**
* Represents web socket data feed response
*/
interface IWebSocketDatafeedResponse {
/**
* Formats bars
*
* @param response
* @return
*/
formatBars(response: string): IBar[];
/**
* Formats instruments
*
* @param response
* @return
*/
formatInstruments(response: string): IInstrument[];
/**
* Formats real time
*
* @param response
* @return
*/
formatRealtime(response: string): ITick;
}
/**
* Represents web socket data feed
*
* @category Datafeeds
*/
class WebsocketDatafeed {
private _datafeed;
private _instruments;
private _requestFormatter;
private _responseFromatter;
private _webSocket;
private readonly _datasourceApiUri;
/**
* Creates an instance of WebsocketDatafeed.
*
* @param datasourceApiUri
*/
constructor(datasourceApiUri: string);
/**
* Get request formatter
*/
get requestFormatter(): IWebSocketDatafeedRequest;
set requestFormatter(value: IWebSocketDatafeedRequest);
/**
* Get response formatter
*/
get responseFormatter(): IWebSocketDatafeedResponse;
set responseFormatter(value: IWebSocketDatafeedResponse);
/**
* Inits data feed
*
* @return
*/
init(): Promise;
private getInstruments;
private initWebSocket;
private loadHistorical;
private onSubscribe;
private onUnsubscribe;
}
}
declare module FintaChart {
abstract class Eventable {
private _preventPropagation;
private _chart;
private _targetSubscriptions;
/**
* Chart
*/
get chart(): Chart;
/**
* Invokes event
*
* @param event
* @param newValue
* @param oldValue
*/
invoke(event: string, newValue?: unknown, oldValue?: unknown): void;
/**
* Returns prevent propagation
*
* @param preventEvents
* @return
*/
preventPropagation(preventEvents?: boolean): boolean;
/**
* Subscribes to events fired with this object as their target.
*
* Routes through the chart's event emitter and filters to events
* whose `target === this`, so multiple instances of the same class
* (e.g. several shapes) each receive only their own events.
*
* @param events Space-delimited event name(s).
* @param handler Listener invoked with the matching event.
* @return This instance for chaining.
*/
on(events: string, handler: IEventHandler): Eventable;
/**
* Unsubscribes from events previously registered via `on`.
*
* Omitting `handler` removes every listener for `events`; omitting
* both removes every listener registered through this `Eventable`.
*/
off(events?: string, handler?: IEventHandler): Eventable;
}
}
declare module FintaChart {
/**
* Represents event container.
*/
class EventAgent {
private _listenersPerEvent;
/**
* Invokes specified event across all listeners.
*
* @param eventName The event name.
* @param event The event.
*/
invoke(eventName: string, event?: IEvent): void;
/**
* Subscribes to events.
*
* @param eventNames The event names delimited by space.
* @param handler The event handler.
* @param target The event target.
*/
on(eventNames: string, handler: IEventHandler, target?: unknown): void;
/**
* Unsubscribes from events.
*
* @param eventNames The event names.
* @param target The event target.
*/
off(eventNames: string, target?: unknown): void;
private static splitEvents;
private static parseEvent;
private remove;
}
}
declare module FintaChart {
/**
* Describes event.
*/
interface IEvent {
/**
* The event sender.
*/
sender: unknown;
/**
* The event target.
*/
target: unknown;
/**
* The event type.
*/
type: string;
}
/**
* Describes event that is sent if value changed.
*/
interface IValueChangedEvent extends IEvent {
/**
* The old value.
*/
oldValue?: T;
/**
* The new value.
*/
value?: T;
}
type IEventHandler = (eventObject: IEvent) => void;
/**
* Describes event emitter
*/
interface IEventEmitter {
/**
* Invokes specified event.
*
* @param eventType The event type.
* @param event The event.
*/
invoke(eventType: string, event: IEvent): void;
/**
* Invokes value changed event.
*
* @template T The type of the value.
* @param eventType The event type.
* @param newValue The new value.
* @param oldValue The old value.
*/
invokeValueChanged(eventType: string, newValue: T, oldValue?: T): void;
/**
* Prevents event from propagation.
*
* @param preventEvents The flag that indicates whether event propagation should be stopped.
*/
preventPropagation(preventEvents?: boolean): void;
}
/**
* Represents event emitter
*/
class EventEmitter implements IEventEmitter {
private _eventAgent;
private _preventPropagation;
invoke(eventName: string, data: IEvent): void;
invokeValueChanged(eventType: string, newValue?: T, oldValue?: T): void;
preventPropagation(preventEvents?: boolean): void;
/**
* Invokes value changed event for specified target.
*
* @template T The type of the value.
* @param target The target.
* @param eventType The event type.
* @param newValue The new value.
* @param oldValue The old value.
*/
invokeTargetValueChanged(target: unknown, eventType: string, newValue?: T, oldValue?: T): void;
/**
* Subscribes to events.
*
* @param events The events delimited by space.
* @param handler The event handler.
* @param target The event target.
* @return Current event emitter instance.
*/
on(events: string, handler: IEventHandler, target?: unknown): EventEmitter;
/**
* Unsubscribes from events.
*
* @param events The events delimited by space.
* @param target The event target.
* @return Current event emitter instance.
*/
off(events: string, target?: unknown): EventEmitter;
}
}
declare module FintaChart {
/**
* Represents property change event.
*/
class PropertyChangeEvent {
/**
* The property name.
*/
readonly key: string;
/**
* The property value.
*/
readonly value: unknown;
/**
* Initializes new instance of [[PropertyChangeEvent]] class.
*
* @param key The property name.
* @param value The property value.
*/
constructor(key: string, value: unknown);
}
}
declare module FintaChart {
/**
* Represents window event
*
* @category Motion events
*/
interface IWindowEvent {
/**
* Event object
*/
evt: Event;
/**
* Overrides the native (read-only) `which` button value.
*/
which?: number;
/**
* Pane
*/
pane?: Pane;
/**
* Pointer position
*/
pointerPosition: IPoint;
/**
* Stop propagation
*/
stopPropagation: boolean;
/**
* Touches
*/
touches?: TouchList;
}
/**
* Motion event config
*
* @category Motion events
*/
interface IMotionEventConfig {
/**
* Button
*/
button?: number;
/**
* Context
*/
context?: object;
/**
* Handler
*/
handler?: MotionEventHandler;
/**
* Hit test
*/
hitTest?: MotionEventHitTestHandler;
/**
* Keys
*/
keys?: number[];
}
/**
* @category Motion events
*/
type MotionEventHandler = (motionEvent: MotionEvent, event: IWindowEvent) => void;
/**
* @category Motion events
*/
type MotionEventHitTestHandler = (position: IPoint) => boolean;
/**
* @category Motion events
*/
enum MouseButton {
LEFT = 1,
SCROLL = 2,
RIGHT = 3
}
/**
* @category Motion events
*/
enum MouseEvent {
ENTER = "mouseenter",
LEAVE = "mouseleave",
MOVE = "mousemove",
DOWN = "mousedown",
UP = "mouseup",
CLICK = "click",
DOUBLE_CLICK = "dblclick",
CONTEXT_MENU = "contextmenu",
WHEEL = "mousewheel",
SCROLL = "DOMMouseScroll",
OVER = "mouseover"
}
/**
* @category Motion events
*/
enum TouchEvent {
START = "touchstart",
MOVE = "touchmove",
END = "touchend",
CANCEL = "touchcancel"
}
/**
* @category Motion events
*/
enum MotionEventState {
NONE = 0,
STARTED = 1,
CONTINUED = 2,
FINISHED = 3
}
/**
* @category Motion events
*/
enum PointerKind {
NONE = 0,
MOUSE = 1,
TOUCH = 2
}
/**
* Represents motion event
*
* @category Motion events
*/
class MotionEvent {
/**
* Keys
*/
private readonly _keys;
/**
* Pointer type
*/
private _pointerKind;
/**
* State
*/
private _state;
/**
* Button
*/
readonly button: MouseButton;
/**
* Context
*/
context: unknown;
/**
* Handler
*/
handler: MotionEventHandler;
/**
* Hit test
*/
hitTest: MotionEventHitTestHandler;
/**
* Gets pointer name
*/
get pointerKind(): PointerKind;
/**
* Gets event state
*/
get state(): MotionEventState;
protected set state(value: MotionEventState);
/**
* Creates an instance of MotionEvent.
*
* @param config The motion event config.
*/
constructor(config?: IMotionEventConfig);
/**
* Handles event
*
* @param event The window event to handle.
* @return true if event was handled; otherwise, false.
*/
handleEvent(event: IWindowEvent): boolean;
/**
* Determines whether motion event is active.
*
* @return true if motion event is active; otherwise, false.
*/
isActive(): boolean;
/**
* Resets motion event to initial state.
*/
reset(): void;
/**
* Checks button
*
* @param event
*/
protected checkButton(event: IWindowEvent): boolean;
/**
* Checks hit
*
* @param event
*/
protected checkHit(event: IWindowEvent): boolean;
/**
* Check keys
*
* @param event
*/
protected checkKeys(event: IWindowEvent): boolean;
/**
* Invokes handler
*
* @param event
*/
protected invokeHandler(event: IWindowEvent): void;
/**
* Updates pointer name
*
* @param event
*/
protected updatePointerKind(event: IWindowEvent): void;
}
}
declare module FintaChart {
/**
* Represents motion event array
*
* @category Motion events
*/
class MotionEventArray {
/**
* Motion events
*/
readonly motionEvents: MotionEvent[];
/**
* Creates an instance of MotionEventArray.
*
* @param motionEvents
* @param context
* @param hitTestFunc
*/
constructor(motionEvents?: MotionEvent | MotionEvent[], context?: unknown, hitTestFunc?: MotionEventHitTestHandler);
/**
* Adds events to the collection.
*
* @param motionEvents The motion event or an array of motion events to add.
*/
add(motionEvents: MotionEvent | MotionEvent[]): void;
/**
* Determines whether specified event is present in the collection.
*
* @param motionEvent The motion event to find.
* @return true if given motion event is present in the collection; otherwise, false.
*/
contains(motionEvent: MotionEvent): boolean;
/**
* Handles specified window event.
*
* @param event The window event to handle.
* @param inBounds
* @return true if event was handled; otherwise, false.
*/
handleEvent(event: IWindowEvent, inBounds?: boolean): boolean;
/**
* Resets all motion events to initial state.
*/
reset(): void;
}
}
declare module FintaChart {
/**
* Describes click motion event config.
*
* @category Motion events
*/
interface IClickMotionEventConfig extends IMotionEventConfig {
/**
* Max touch interval
*/
maxTouchInterval?: number;
/**
* Max touch offset
*/
maxTouchOffset?: number;
}
/**
* Motion event click
*
* @category Motion events
*/
class ClickMotionEvent extends MotionEvent {
private _isTouch;
private _maxTouchInterval;
private _maxTouchOffset;
private _startDate;
private _startPoint;
/**
* The max touch interval.
*/
get maxTouchInterval(): number;
set maxTouchInterval(value: number);
/**
* The max touch offset
*/
get maxTouchOffset(): number;
set maxTouchOffset(value: number);
/**
* Creates an instance of ClickMotionEvent.
*
* @param config
*/
constructor(config?: IClickMotionEventConfig);
handleEvent(event: IWindowEvent): boolean;
private finish;
}
}
declare module FintaChart {
/**
* Describes context menu motion event config.
*
* @category Motion events
*/
interface IContextMenuMotionEventConfig extends IMotionEventConfig {
/**
* Max touch offset
*/
maxTouchOffset?: number;
/**
* Touch interval
*/
touchInterval?: number;
}
/**
* Represents motion event context menu
*
* @category Motion events
*/
class ContextMenuMotionEvent extends MotionEvent {
private _isTouch;
private _lastEvent;
private _maxTouchOffset;
private _startPoint;
private _timeoutId;
private _touchInterval;
/**
* The max touch offset
*/
get maxTouchOffset(): number;
set maxTouchOffset(value: number);
/**
* The touch interval
*/
get touchInterval(): number;
set touchInterval(value: number);
/**
* Creates an instance of ContextMenuMotionEvent.
*
* @param config
*/
constructor(config?: IContextMenuMotionEventConfig);
handleEvent(event: IWindowEvent): boolean;
/**
* Creates lightweight event snapshot.
*/
private snapshot;
private finish;
private startTimer;
private stopTimer;
}
}
declare module FintaChart {
/**
* Represents motion event double click config
*
* @category Motion events
*/
interface IMotionEventDoubleClickConfig extends IMotionEventConfig {
/**
* Max touch interval
*/
maxTouchInterval?: number;
/**
* Max touch offset
*/
maxTouchOffset?: number;
}
/**
* Represents motion event double click
*
* @category Motion events
*/
class DoubleClickMotionEvent extends MotionEvent {
private _isSecondTouch;
private _maxTouchInterval;
private _maxTouchOffset;
private _startDate;
private _startPoint;
/**
* The max touch interval
*/
get maxTouchInterval(): number;
set maxTouchInterval(value: number);
/**
* The max touch offset
*/
get maxTouchOffset(): number;
set maxTouchOffset(value: number);
/**
* Creates an instance of DoubleClickMotionEvent.
*
* @param config
= */
constructor(config?: IMotionEventDoubleClickConfig);
handleEvent(event: IWindowEvent): boolean;
private finish;
}
}
declare module FintaChart {
/**
* Represents motion event mouse hover config
*
* @category Motion events
*/
interface IMouseHoverMotionEventConfig extends IMotionEventConfig {
/**
* Enter event enabled
*/
enterEventEnabled?: boolean;
/**
* Hover event enabled
*/
hoverEventEnabled?: boolean;
/**
* Leave event enabled
*/
leaveEventEnabled?: boolean;
}
/**
* Represents Motion event mouse hover
*
* @category Motion events
*/
class MouseHoverMotionEvent extends MotionEvent {
private readonly _optimization;
/**
* Enter enabled
*/
enterEnabled: boolean;
/**
* Hover enabled
*/
hoverEnabled: boolean;
/**
* Leave enabled
*/
leaveEnabled: boolean;
/**
* Creates an instance of MouseHoverMotionEvent.
*
* @param config
*/
constructor(config: IMouseHoverMotionEventConfig);
handleEvent(event: IWindowEvent): boolean;
}
}
declare module FintaChart {
/**
* Represents motion event mouse wheel
*
* @category Motion events
*/
class MouseWheelMotionEvent extends MotionEvent {
private _optimization;
private _wheelDeltaAccum;
/**
* Delta
*/
delta: number;
handleEvent(event: IWindowEvent): boolean;
reset(): void;
/**
* Accumulates wheel ticks and defers the handler.
*
* @param event
*/
private accumulate;
}
}
declare module FintaChart {
/**
* Represents motion event pencil device config
*
* @category Motion events
*/
interface IMoveMotionEventConfig extends IMotionEventConfig {
/**
* Horizontal move enabled
*/
horizontalMoveEnabled?: boolean;
/**
* Min move distance
*/
minMoveDistance?: number;
/**
* Vertical move enabled
*/
verticalMoveEnabled?: boolean;
}
/**
* Represents
*
* @category Motion events
*/
class MoveMotionEvent extends MotionEvent {
private readonly _optimization;
private _lastPoint;
private _minMoveDistance;
private _prevPoint;
private _which;
/**
* Horizontal move enabled
*/
horizontalMoveEnabled: boolean;
/**
* Move offset
*/
moveOffset: IPoint;
/**
* Vertical move enabled
*/
verticalMoveEnabled: boolean;
/**
* Get move distance
*/
get minMoveDistance(): number;
set minMoveDistance(value: number);
/**
* Creates an instance of MoveMotionEvent.
*
* @param config
*/
constructor(config?: IMoveMotionEventConfig);
handleEvent(event: IWindowEvent): boolean;
}
}
declare module FintaChart {
/**
* Represents motion event pinch config
*
* @category Motion events
*/
interface IMotionEventPinchConfig extends IMotionEventConfig {
/**
* Min distance
*/
minDistance?: number;
/**
* Min scale change
*/
minScaleStep?: number;
}
/**
* Represents motion event pinch
*
* @category Motion events
*/
class PinchMotionEvent extends MotionEvent {
private _minDistance;
private _minScaleStep;
private _smoothing;
private _startDistance;
private _lastDistance;
private _samples;
/**
* Scale relative to gesture start
*/
scale: number;
/**
* Scale relative to previous move
*/
scaleDelta: number;
/**
* Midpoint between touches, in local coordinates
*/
center: IPoint;
/**
* The min distance
*/
get minDistance(): number;
set minDistance(value: number);
/**
* The min scale step
*/
get minScaleStep(): number;
set minScaleStep(value: number);
/**
* Creates an instance of PinchMotionEvent.
*
* @param config
*/
constructor(config?: IMotionEventPinchConfig);
handleEvent(event: IWindowEvent): boolean;
reset(): void;
/**
* Begins gesture once a second touch lands.
*
* @param event
* @param touches
*/
private start;
/**
* Updates scale while both touches move.
*
* @param event
* @param touches
*/
private move;
/**
* Ends gesture and clears state.
*
* @param event
* @param touches
*/
private finish;
/**
* Marks gesture finished and clears measurements.
*/
private cancel;
/**
* Returns median of the last three distances.
*
* @param distance The newest measured distance.
*/
private smooth;
/**
* Returns midpoint in local coordinates.
*
* @param event
* @param touches
*/
private centerOf;
private static distanceOf;
private static touchesOf;
}
}
declare module FintaChart {
/**
* @ignore
*/
class DemoModePopup {
private readonly _chart;
private _isShown;
private _element;
private _isClosable;
constructor(chart: Chart);
show(closable?: boolean): Promise;
hide(): void;
private init;
private onClose;
private onSubmit;
private collectFormData;
private validate;
private isValidEmail;
private sendPurchaseRequest;
private sendViaBackend;
private showError;
private showSuccess;
private clearMessages;
}
}
declare module FintaChart {
/**
* @ignore
*/
interface ICheckLicenseResponse {
expireAt: number;
state: string;
isValid: boolean;
}
/**
* @ignore
*/
function handleStates(chart: Chart, n?: number): void;
/**
* @ignore
*/
function getState2(): string;
/**
* @ignore
*/
function checkDialog(content: string): boolean;
/**
* @ignore
*/
function checkLicense(): Promise;
}
declare module FintaChart {
/**
* Represents environment theme
*/
interface IEnvironmentTheme {
/**
* bg color
*/
bgColor: string | string[];
/**
* Down candle border stroke color
*/
downCandleBorderStrokeColor: string;
/**
* Down candle border stroke enabled
*/
downCandleBorderStrokeEnabled: boolean;
/**
* Down candle fil color
*/
downCandleFillColor: string;
/**
* Down candle shadow stroke color
*/
downCandleShadowStrokeColor: string;
/**
* Font size
*/
fontSize?: number;
/**
* Line stroke color
*/
lineStrokeColor: string;
/**
* Pane grid stroke color
*/
paneGridStrokeColor: string;
/**
* Scale horizontal fill color
*/
horizontalScaleFillColor: string;
/**
* Scale Vertical fill color
*/
verticalScaleFillColor: string;
/**
* Scale vertical text fill color
*/
verticalScaleTextFillColor: string;
/**
* Scale vertical text font family
*/
verticalScaleTextFontFamily: string;
/**
* Up candle fill color
*/
upCandleFillColor: string;
/**
* Up candle stroke color
*/
upCandleStrokeColor: string;
/**
* Up candle stroke enabled
*/
upCandleStrokeEnabled: boolean;
/**
* Up candle shadow stroke color
*/
upCandleShadowStrokeColor: string;
useSmoothedLines: boolean;
verticalScaleLabelFillColor: string;
verticalScaleLabelTextColor: string;
showExecutionLabels: boolean;
showExecution: boolean;
/**
* Pre/Post market fill color
*/
preMarketFillColor: string;
afterMarketFillColor: string;
closeMarketFillColor: string;
}
}
declare const defaultTheme: Record;
declare const darkTheme: Record;
declare const fintatechDarkTheme: Record;
declare const beetTheme: Record;
declare const grayTheme: Record;
declare const oliveTheme: Record;
declare const orangeTheme: Record;
declare const purpleTheme: Record;
declare const skyTheme: Record;
declare const tealTheme: Record;
declare module FintaChart {
enum StrokePriority {
COLOR = "color"
}
enum FillPriority {
COLOR = "color"
}
enum LineStyle {
SOLID = "solid",
DASH = "dash",
DOT = "dot",
DASH_DOT = "dash-dot"
}
const FontDefaults: {
fontFamily: string;
fontSize: number;
fontStyle: string;
fontVariant: string;
fontWeight: string;
};
const StrokeDefaults: {
strokePriority: string;
strokeColor: string;
width: number;
lineStyle: LineStyle;
lineJoin: CanvasLineJoin;
lineCap: CanvasLineCap;
};
const DashArray: {
DOT: number[];
DASH: number[];
DASH_DOT: number[];
};
const Themes: {
readonly default: Record;
readonly light: Record;
readonly dark: Record;
readonly fintatechDark: Record;
readonly beet: Record;
readonly gray: Record;
readonly olive: Record;
readonly orange: Record;
readonly purple: Record;
readonly sky: Record;
readonly teal: Record;
/**
* Look up a built-in theme by string name (case-insensitive).
* Returns `null` if the name is unknown.
*/
byName(name: string): Record | null;
/**
* Sets the default theme applied to subsequent `new Chart(...)`
* instances that don't pass an explicit `theme` option. Accepts
* either a string name (`'Dark'`, `'Light'`, …) or a theme object.
*/
use(theme: string | Record): void;
/**
* @internal Returns the theme previously selected via `use()`,
* or `null` if no global override is set.
*/
readonly currentDefault: Record;
};
/**
* Capitalised alias surface — `FintaChart.Theme.Dark`,
* `FintaChart.Theme.Light`, `FintaChart.Theme.use('Dark')`.
* Resolves to the same theme objects as `FintaChart.Themes`.
*/
const Theme: {
readonly Default: Record;
readonly Light: Record;
readonly Dark: Record;
readonly FintatechDark: Record;
readonly Beet: Record;
readonly Gray: Record;
readonly Olive: Record;
readonly Orange: Record;
readonly Purple: Record;
readonly Sky: Record;
readonly Teal: Record;
byName(name: string): Record | null;
use(theme: string | Record): void;
};
/**
* Represents stroke theme
*/
interface IStrokeTheme {
/**
* Line cap
*/
lineCap?: CanvasLineCap;
/**
* Line join
*/
lineJoin?: CanvasLineJoin;
/**
* Line style
*/
lineStyle?: LineStyle;
/**
* Stroke color
*/
strokeColor?: string;
/**
* Weather the stroke color is default
*/
default?: boolean;
/**
* Stroke enabled
*/
strokeEnabled?: boolean;
/**
* Stroke priority
*/
strokePriority?: string;
/**
* Width
*/
width?: number;
}
/**
* Describes linear gradient color stop.
*/
interface ILinearGradientColorStop {
/**
* The color of the stop.
*/
color: string;
/**
* The offset of the stop.
*/
stop: number;
}
/**
* Describes radial gradient circle.
*/
interface IRadialGradientCircle {
/**
* The center point of the circle.
*/
center: IPoint;
/**
* The radius of the circle.
*/
radius: number;
/**
* The color of the stop.
*/
color: string;
/**
* The offset of the stop.
*/
stop?: number;
}
/**
* Represents Fill theme
*/
interface IFillTheme {
/**
* Fill color
*/
fillColor?: string;
/**
* Weather the fill color is default
*/
default?: boolean;
/**
* Fill enabled
*/
fillEnabled?: boolean;
/**
* Fill priority
*/
fillPriority?: string;
/**
* Line gradient
*/
linearGradient?: string[] | ILinearGradientColorStop[];
/**
* Radius gradient
*/
radialGradient?: IRadialGradientCircle[];
}
/**
* Represents text theme
*/
interface ITextTheme extends IStrokeTheme, IFillTheme {
/**
* Decoration
*/
decoration?: string;
/**
* Fill color
*/
fillColor: string;
/**
* Font family
*/
fontFamily: string;
/**
* Font size
*/
fontSize: number;
/**
* Font style
*/
fontStyle: string;
/**
* Font variant
*/
fontVariant?: string;
/**
* Font weight
*/
fontWeight?: string;
/**
* Line height
*/
lineHeight?: number;
}
/**
* Check box theme
*/
interface ICheckBoxTheme {
/**
* Fill
*/
fill: IFillTheme;
/**
* Line
*/
line: IStrokeTheme;
}
}
declare module FintaChart {
/**
* Represents html extensions
*/
class ThemeHelper {
/**
* Returns font size
*
* @param theme
* @return
*/
static fontSize(theme: ITextTheme): number;
/**
* Returns line width
*
* @param theme
* @return
*/
static lineWidth(theme: IStrokeTheme): number;
static isLight(chartTheme: any): boolean;
}
}
declare module FintaChart {
class ThemeUtils {
private static isObject;
static deepMerge(target: T, source: Partial): T;
private static mergeInto;
}
}
declare module FintaChart {
/**
* Represents container dislocation
*
*/
interface IContainerDislocation {
/**
* Height
*/
height: number;
/**
* Width
*/
width: number;
}
/**
* Represents chart container
*
*/
class ChartContainer implements IDisposable {
private readonly _parent;
private readonly _undoRedo;
private _shapeDragPane;
private _chartsItems;
private _dislocation;
private _inFullScreenMode;
private _inFullWindowMode;
private _scrollbar;
private _toolbar;
private _onFullscreenChanged;
private _onFullWindowChanged;
/**
* Creates an instance of ChartContainer.
*
* @param parent
*/
constructor(parent: HTMLElement);
/**
* Get shape settings drag pane
*/
get shapeSettingsDragPane(): ShapeSettingsDragPane;
/**
* Get charts
*/
get charts(): Chart[];
/**
* Get hot key controller
*/
get undoRedo(): UndoRedoController;
/**
* Get container dislocation
*/
get containerDislocation(): IContainerDislocation;
set containerDislocation(value: IContainerDislocation);
/**
* Get parent
*/
get parent(): HTMLElement;
/**
* Get scroll bar
*/
get scrollbar(): Scrollbar;
/**
* Get toolbar
*/
get toolbar(): Toolbar;
/**
* Adds chart
*
* @param config
* @return
*/
addChart(config?: IChartConfig): Chart;
/**
* Creates multiple charts
*
* @param configs
*/
createMultipleCharts(configs: IChartConfig[]): void;
dispose(): void;
private onFullScreenChange;
private onFullWindowChange;
}
/**
* Alias for `ChartContainer`. Both names appear in the public guides
* (`FintaChart.ChartContainer` and `FintaChart.ChartsContainer`); both
* resolve to the same class on the runtime.
*/
const ChartsContainer: typeof ChartContainer;
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents html content loader.
*/
class HtmlLoader {
private static readonly _htmlPerName;
/**
* Loads html resource.
*
* @param relativePath The path to the resource relative to the root HTML dialogs path.
* @return Promise which will be resolved with HTML content.
*/
static load(relativePath: string): Promise;
/**
* Loads html resource.
*
* @param relativePath The path to the resource relative to the root HTML dialogs path.
* @param clone The flag that indicates whether resulting element should be cloned.
* @return Promise which will be resolved with HTMLElement.
*/
static loadHtml(relativePath: string, clone?: boolean): Promise;
/**
* Loads html resource as native HTMLElement.
*
* @param relativePath The path to the resource relative to the root HTML dialogs path.
* @param clone The flag that indicates whether resulting element should be cloned.
* @return Promise which will be resolved with HTMLElement.
*/
static loadHtmlElement(relativePath: string, clone?: boolean): Promise;
private static getUri;
}
}
declare module FintaChart {
import TranslationOptions = I18next.TranslationOptions;
/**
* Provides localization.
*/
class Localizer {
private static initializedLocales;
/**
* Fallback locale
*/
static fallbackLocale: string;
/**
* Localizes specified element.
*
* @param chart The chart.
* @param element The element to localize.
*/
static localize(chart: Chart, element?: HTMLElement): Promise;
/**
* Localizes an HTMLElement using the internal localization adapter.
*
* @param element The element to localize.
*/
static localizeElement(element: HTMLElement): void;
/**
* @description Localizes text
* @static
* @param {(Chart | string)} chartOrLocale
* @param {string} [key]
* @param {TranslationOptions} [trlOptions]
* @returns {Promise}
* @memberof Localizator
*/
static localizeText(chartOrLocale: Chart | string, key?: string, trlOptions?: TranslationOptions): Promise;
/**
* Returns localized text with specified key in the translation dictionary.
*
* @param chart The chart.
* @param key The key of the text in the translation dictionary.
* @param options The translation options.
* @return Promise that is resolved with localized text.
*/
static get(chart: Chart, key: string, options?: TranslationOptions): Promise;
/**
* Returns localized text with specified key in the translation dictionary.
*
* @param locale The locale.
* @param key The key of the text in the translation dictionary.
* @param options The translation options.
* @return Promise that is resolved with localized text.
*/
static get(locale: string, key: string, options?: TranslationOptions): Promise;
/**
* Returns localized text with specified key in the translation dictionary.
*
* @param chart The chart.
* @param key The key of the text in the translation dictionary.
* @param defaultValue The default value if translation not found.
* @return Promise that is resolved with localized text.
*/
static getOrDefault(chart: Chart, key: string, defaultValue: string): Promise;
private static isInitialized;
private static init;
private static prepare;
private static _localizeElement;
private static _applyLocalization;
private static _applyLocalizedValue;
private static _localize;
}
}
declare module FintaChart {
/**
* Describes default resource paths.
*/
interface IResourcePathDefaults {
/**
* The resources root path.
*/
root: string;
/**
* The localization resources path.
*/
localization: string;
/**
* The HTML dialog resources path.
*/
htmlDialogs: string;
}
/**
* Represents ResourcePath
*/
class ResourcePath {
static defaults: IResourcePathDefaults;
private static _root;
private static _localization;
private static _htmlDialogs;
/**
* Get root
*/
static get root(): string;
static set root(value: string);
/**
* Get localization
*/
static get localization(): string;
static set localization(value: string);
/**
* Get html dialogs
*/
static get htmlDialogs(): string;
static set htmlDialogs(value: string);
}
}
declare module FintaChart {
/**
* Describes SVG graphics loader.
*/
interface ISvgLoaderConfig {
chart: Chart;
}
/**
* Represents SVG graphics loader.
*/
class SvgLoader {
static path: string;
private static readonly _svgAttr;
private static readonly _svgClass;
private static readonly _svgPerName;
private static readonly _htmlElementsPerSvgName;
private static _nativeContainer;
private static _config;
/**
* Initializes
*
* @param config
*/
static init(config: ISvgLoaderConfig): void;
/**
* Loads SVG graphics for specified HTML element.
*
* @param htmlElement The HTML element.
*/
static load(htmlElement?: HTMLElement): void;
private static getPath;
private static getContainer;
private static subscribe;
private static resolveNativeElement;
private static loadElement;
private static loadFile;
private static sanitizeSvg;
private static updateElements;
private static updateElement;
}
}
declare module FintaChart {
/**
* Provides enumeration of browser names.
*/
enum Browser {
UNKNOWN = 0,
IE = 1,
FIREFOX = 2,
OPERA = 3,
KONQUEROR = 4,
IRON = 5,
SAFARI = 6,
CHROME = 7,
EDGE = 8
}
/**
* Describes user agent information.
*/
interface IUserAgent {
/**
* The browser.
*/
browser: Browser;
/**
* The browser version.
*/
browserVersion: string;
/**
* The flag that indicates whether browser is run on Android.
*/
isAndroid: boolean;
/**
* The flag that indicates whether browser is run on iOS.
*/
isIOS: boolean;
/**
* The flag that indicates whether browser is run on tablet.
*/
isTablet: boolean;
/**
* The flag that indicates whether browser is run on phone.
*/
isPhone: boolean;
/**
* The flag that indicates whether browser is run on phone or tablet.
*/
isMobile: boolean;
/**
* The OS version.
*/
osVersion: string;
/**
* @description Directory
* @memberof IUserAgent
*/
directory: IDirectory;
}
const DEFAULT_DIRECTORY: {
root: string;
htmlDialogs: string;
localization: string;
};
interface IDirectory {
/**
* @description Localization
* @type {string}
* @memberof IDirectory
*/
localization: string;
/**
* @description Root
* @type {string}
* @memberof IDirectory
*/
root: string;
/**
* @description HTML dialogs
* @type {string}
* @memberof IDirectory
*/
htmlDialogs: string;
}
class Directory implements IDirectory {
private _localization;
private _root;
private _htmlDialogs;
/**
* @description Get localization
* @property {string} localization
* @memberof Directory
*/
get localization(): string;
/**
* @description Set localization
* @property {string} localization
* @memberof Directory
*/
set localization(value: string);
/**
* @description Get root
* @property {string} root
* @memberof Directory
*/
get root(): string;
/**
* @description Set root
* @property {string} root
* @memberof Directory
*/
set root(value: string);
/**
* @description Get html dialogs
* @property {string} htmlDialogs
* @memberof Directory
*/
get htmlDialogs(): string;
/**
* @description Set html dialogs
* @property {string} htmlDialogs
* @memberof Directory
*/
set htmlDialogs(value: string);
}
const UserAgent: IUserAgent;
/**
* Updates device mode at runtime.
*
* @param isMobile Whether the chart should behave as a mobile device.
*/
function setMobile(isMobile: boolean): void;
}
declare module FintaChart {
/**
* Describes bounds rectangle.
*/
interface IBounds {
/**
* The left X coordinate of the rectangle.
*/
left: number;
/**
* The top Y coordinate of the rectangle.
*/
top: number;
/**
* The width of the rectangle.
*/
width: number;
/**
* The height of the rectangle.
*/
height: number;
}
/**
* Represents bounds rectangle.
*/
class Bounds implements IBounds, ICloneable {
left: number;
top: number;
width: number;
height: number;
/**
* Creates an instance of Bounds.
*
* @param bounds The source bounds instance.
*/
constructor(bounds?: IBounds);
/**
* The bottom Y coordinate.
*/
get bottom(): number;
/**
* The right X coordinate.
*/
get right(): number;
/**
* Applies padding.
*
* @param padding The padding.
*/
applyPadding(padding: IPadding): void;
clone(): Bounds;
/**
* Determines whether point is inside the current rectangle.
*
* @param point The point.
* @return true if the point is inside the current rectangle, otherwise false.
*/
containsPoint(point: IPoint): boolean;
/**
* Copies from
*
* @param bounds
*/
copyFrom(bounds: IBounds): void;
/**
* Crop bottom
*
* @param bounds
*/
cropBottom(bounds: Bounds): void;
/**
* Crop left
*
* @param bounds
*/
cropLeft(bounds: Bounds): void;
/**
* Crop right
*
* @param bounds
*/
cropRight(bounds: Bounds): void;
/**
* Crop top
*
* @param bounds
*/
cropTop(bounds: Bounds): void;
/**
* Equals
*
* @param bounds
* @return
*/
equals(bounds: IBounds): boolean;
/**
* Returns string
*
* @return
*/
toString(): string;
}
}
declare module FintaChart {
/**
* Represents canvas render
*/
class CanvasRenderer implements IRenderer {
private _lineDashFunc;
private _canvas;
private _context;
private _linearGradientCache;
/**
* Get canvas
*/
get canvas(): HTMLCanvasElement;
set canvas(value: HTMLCanvasElement);
/**
* Get content
*/
get context(): CanvasRenderingContext2D;
clearRect(x: number, y: number, width: number, height: number): void;
clip(): void;
save(): void;
restore(): void;
beginPath(): void;
closePath(): void;
translate(x: number, y: number): void;
rotate(angle: number): void;
scale(x: number, y: number): void;
textOptions(options: ITextRenderingOptions): void;
moveTo(x: number, y: number): void;
moveToPoint(point: IPoint): void;
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
arcPath(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
bezierCurve(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
circle(centerX: number, centerY: number, radius: number): void;
circlePath(centerX: number, centerY: number, radius: number): void;
ellipse(centerX: number, centerY: number, horRadius: number, verRadius: number): void;
ellipsePath(centerX: number, centerY: number, horRadius: number, verRadius: number): void;
horizontalLine(x1: number, x2: number, y: number): void;
horizontalPath(x1: number, x2: number, y: number): void;
image(image: HTMLImageElement, dstX: number, dstY: number, dstWidth?: number, dstHeight?: number): void;
line(x1: number, y1: number, x2: number, y2: number): void;
linePath(x1: number, y1: number, x2: number, y2: number): void;
lineTo(x: number, y: number): void;
lineToPoint(point: IPoint): void;
polygon(...points: (number | IPoint)[]): void;
polygonPath(...coordinates: (number | IPoint)[]): void;
polyline(points: (number | IPoint)[]): void;
polylinePath(points: (number | IPoint)[]): void;
quadraticCurve(cpx: number, cpy: number, x: number, y: number): void;
rect(x: number, y: number, width: number, height: number): void;
rectRounded(x: number, y: number, width: number, height: number, radius: number): void;
rectPath(x: number, y: number, width: number, height: number): void;
textWidth(text: string): number;
verticalLine(x: number, y1: number, y2: number): void;
shadow(options: IShadowRenderingOptions): void;
strokeTheme(theme: IStrokeTheme, force?: boolean): void;
stroke(theme?: IStrokeTheme, force?: boolean): void;
fillTheme(theme: IFillTheme, force?: boolean): void;
fill(theme?: IFillTheme, force?: boolean, fillRule?: CanvasFillRule): void;
fillStrokeTheme(fillTheme: IFillTheme, strokeTheme: IStrokeTheme): void;
fillStroke(fillTheme?: IFillTheme, strokeTheme?: IStrokeTheme): void;
textTheme(theme: ITextTheme): void;
fillText(text: string, x: number, y: number, textTheme?: ITextTheme): void;
private static dashArray;
private static font;
private linearGradient;
private radialGradient;
private initLineDashFunc;
}
}
declare module FintaChart {
class Cartesian {
static readonly REGULAR_DEVIATION: number;
static readonly MAGNET_DEVIATION: number;
static DEVIATION: number;
/**
* Calculates length between specified points.
*
* @param point1 The first point.
* @param point2 The second point.
* @return Length between given points.
*/
static len(point1: IPoint, point2: IPoint): number;
/**
* Calculates x length between specified points.
*
* @param point1 The first point.
* @param point2 The second point.
* @return X length between given points.
*/
static xLength(point1: IPoint, point2: IPoint): number;
/**
* Calculates y length between specified points.
*
* @param point1 The first point.
* @param point2 The second point.
* @return Y length between given points.
*/
static yLength(point1: IPoint, point2: IPoint): number;
/**
* Returns is value near value
*
* @param value1
* @param value2
* @return
*/
static isValueNearValue(value1: number, value2: number): boolean;
/**
* Returns is value between or near value
*
* @param value
* @param value1
* @param value2
* @return
*/
static isValueBetweenOrNearValues(value: number, value1: number, value2: number): boolean;
/**
* Returns is point near point
*
* @param point
* @param checkPoint
* @return
*/
static isPointNearPoint(point: IPoint, checkPoint: IPoint | IPoint[]): boolean;
/**
* Returns is point near rect point
*
* @param point
* @param rectPoint1
* @param rectPoint2
* @return
*/
static isPointNearRectPoints(point: IPoint, rectPoint1: IPoint, rectPoint2: IPoint): boolean;
/**
* Returns is point inside or near rectangle
*
* @param point
* @param bounds
* @return
*/
static isPointInsideOrNearRect(point: IPoint, bounds: IBounds): boolean;
/**
* Returns is point inside or near rect points
*
* @param point
* @param rectPoint1
* @param rectPoint2
* @return
*/
static isPointInsideOrNearRectPoints(point: IPoint, rectPoint1: IPoint, rectPoint2: IPoint): boolean;
/**
* Returns is point near circle
*
* @param point
* @param centerPoint
* @param radius
* @return
*/
static isPointNearCircle(point: IPoint, centerPoint: IPoint, radius: number | IPoint): boolean;
/**
* Returns is point inside or dear circle
*
* @param point
* @param centerPoint
* @param radius
* @return
*/
static isPointInsideOrNearCircle(point: IPoint, centerPoint: IPoint, radius: number | IPoint): boolean;
/**
* Returns is point near polygon
*
* @param point
* @param polygonPoints
* @return
*/
static isPointNearPolygon(point: IPoint, polygonPoints: IPoint[]): boolean;
/**
* Returns is point near polygon
*
* @param point
* @param polygonPoints
* @return
*/
static isPointInsidePolygon(point: IPoint, polygonPoints: IPoint[]): boolean;
/**
* Returns is point near line
*
* @param point
* @param linePoint1
* @param linePoint2
* @return
*/
static isPointNearLine(point: IPoint, linePoint1: IPoint, linePoint2: IPoint): boolean;
/**
* Returns is point near polygon
*
* @param point
* @param polylinePoints
* @return
*/
static isPointNearPolyline(point: IPoint, polylinePoints: IPoint[]): boolean;
/**
* Returns is point near ellipse
*
* @param point
* @param centerPoint
* @param radiusPoint
* @return
*/
static isPointNearEllipse(point: IPoint, centerPoint: IPoint, radiusPoint: IPoint): boolean;
/**
* returns is point near ellipse with radiuses
*
* @param point
* @param center
* @param horRadius
* @param verRadius
* @return
*/
static isPointNearEllipseWithRadiuses(point: IPoint, center: IPoint, horRadius: number, verRadius: number): boolean;
/**
* Intersections point
*
* @param point1
* @param point2
* @param point3
* @param point4
* @return
*/
static intersectionPoints(point1: IPoint, point2: IPoint, point3: IPoint, point4: IPoint): IPoint;
}
}
declare module FintaChart {
/**
* Describes css size of the element.
*/
interface ICssSize {
/**
* The width of the element.
*/
width: number | string;
/**
* The height of the element.
*/
height: number | string;
}
}
declare module FintaChart {
/**
* Describes data point.
*/
interface IDataPoint {
/**
* The X as horizontal coordinate.
*/
x?: number;
/**
* The date as horizontal coordinate.
*/
date?: Date;
/**
* The record as horizontal coordinate.
*/
record?: number;
/**
* The Y as vertical coordinate.
*/
y?: number;
/**
* The value as vertical coordinate.
*/
value?: number;
}
/**
* Represents visual data point
*/
class DataPoint implements IDataPoint, ICloneable {
x: number;
date: Date;
record: number;
y: number;
value: number;
/**
* Creates an instance of DataPoint.
*
* @param config
*/
constructor(config?: IDataPoint);
/**
* Converts
*
* @param point
* @param behavior
* @param coordinateMapper
* @return
*/
static convert(point: IPoint, behavior: IPointBehavior, coordinateMapper: ScaleCoordinateMapper): DataPoint;
/**
* Clears
*/
clear(): void;
clone(): DataPoint;
/**
* Returns date
*
* @param coordinateMapper
* @return
*/
getDate(coordinateMapper: ScaleCoordinateMapper): Date;
/**
* Returns records
*
* @param coordinateMapper
* @return
*/
getRecord(coordinateMapper: ScaleCoordinateMapper): number;
/**
* Returns value
*
* @param coordinateMapper
* @return
*/
getValue(coordinateMapper: ScaleCoordinateMapper): number;
/**
* Returns x
*
* @param coordinateMapper
* @return
*/
getX(coordinateMapper: ScaleCoordinateMapper): number;
/**
* Returns y
*
* @param coordinateMapper
* @return
*/
getY(coordinateMapper: ScaleCoordinateMapper): number;
/**
* Moves to
*
* @param x
* @param y
* @param coordinateMapper
* @return
*/
moveTo(x: number, y: number, coordinateMapper: ScaleCoordinateMapper): DataPoint;
/**
* Moves to point
*
* @param point
* @param coordinateMapper
* @return
*/
moveToPoint(point: IPoint, coordinateMapper: ScaleCoordinateMapper): DataPoint;
/**
* moves to x
*
* @param x
* @param coordinateMapper
* @return
*/
moveToX(x: number, coordinateMapper: ScaleCoordinateMapper): DataPoint;
/**
* Moves to y
*
* @param y
* @param scaleCoordinateMapper
* @return
*/
moveToY(y: number, scaleCoordinateMapper: ScaleCoordinateMapper): DataPoint;
/**
* Returns point
*
* @param coordinateMapper
* @return
*/
toPoint(coordinateMapper: ScaleCoordinateMapper): IPoint;
/**
* Translates point to specified offset.
*
* @param offset The offset.
* @param coordinateMapper The coordinate mapper.
* @return Current point translated to given offset.
*/
translate(offset: IPoint, coordinateMapper: ScaleCoordinateMapper): DataPoint;
}
}
declare module FintaChart {
/**
* Provides text alignments.
*/
enum TextAlign {
/**
* The text is left-aligned.
*/
LEFT = "left",
/**
* The text is right-aligned.
*/
RIGHT = "right",
/**
* The text is centered.
*/
CENTER = "center"
}
/**
* Provides text baselines.
*/
enum TextBaseline {
/**
* The text baseline is the top of the rendering rectangle.
*/
TOP = "top",
/**
* The text baseline is the middle of the rendering rectangle.
*/
MIDDLE = "middle",
/**
* The text baseline is the bottom of the rendering rectangle.
*/
BOTTOM = "bottom",
/**
* The text baseline is the normal alphabetic baseline.
*/
ALPHABETIC = "alphabetic"
}
/**
* Describes text rendering options.
*/
interface ITextRenderingOptions {
/**
* The text alignment.
*/
align?: TextAlign;
/**
* The text baseline.
*/
baseline?: TextBaseline;
}
interface IShadowRenderingOptions {
color: string;
spread?: number;
xOffset?: number;
yOffset?: number;
}
/**
* Represents render
*/
interface IRenderer {
/**
* Clear rectangle
*
* @param x
* @param y
* @param width
* @param height
*/
clearRect(x: number, y: number, width: number, height: number): void;
/**
* Clip
*/
clip(): void;
/**
* Saves
*/
save(): void;
/**
* Restores
*/
restore(): void;
/**
* Begins path
*/
beginPath(): void;
/**
* Close path
*/
closePath(): void;
/**
* Translates
*
* @param x
* @param y
*/
translate(x: number, y: number): void;
/**
* Rotates
*
* @param angle
*/
rotate(angle: number): void;
/**
* Scales
*
* @param x
* @param y
*/
scale(x: number, y: number): void;
/**
* Text options
*
* @param options
*/
textOptions(options: ITextRenderingOptions): void;
/**
* Move to
*
* @param x
* @param y
*/
moveTo(x: number, y: number): void;
moveToPoint(point: IPoint): void;
/**
* Arc
*
* @param x
* @param y
* @param radius
* @param startAngle
* @param endAngle
* @param anticlockwise
*/
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
/**
* Arc path
*
* @param x
* @param y
* @param radius
* @param startAngle
* @param endAngle
* @param antiClockwise
*/
arcPath(x: number, y: number, radius: number, startAngle: number, endAngle: number, antiClockwise?: boolean): void;
/**
* Bezier curve
*
* @param cp1x
* @param cp1y
* @param cp2x
* @param cp2y
* @param x
* @param y
*/
bezierCurve(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;
/**
* Circle
*
* @param centerX
* @param centerY
* @param radius
*/
circle(centerX: number, centerY: number, radius: number): void;
/**
* Circle path
*
* @param x
* @param y
* @param radius
*/
circlePath(x: number, y: number, radius: number): void;
/**
* Ellipse
*
* @param centerX
* @param centerY
* @param horRadius
* @param verRadius
*/
ellipse(centerX: number, centerY: number, horRadius: number, verRadius: number): void;
/**
* Ellipse path
*
* @param centerX
* @param centerY
* @param horRadius
* @param verRadius
*/
ellipsePath(centerX: number, centerY: number, horRadius: number, verRadius: number): void;
/**
* Horizontal line
*
* @param x1
* @param x2
* @param y
*/
horizontalLine(x1: number, x2: number, y: number): void;
/**
* Horizontal path
*
* @param x1
* @param x2
* @param y
*/
horizontalPath(x1: number, x2: number, y: number): void;
/**
* Image
*
* @param image
* @param dstX
* @param dstY
* @param dstWidth
* @param dstHeight
*/
image(image: HTMLImageElement, dstX: number, dstY: number, dstWidth?: number, dstHeight?: number): void;
/**
* Line
*
* @param x1
* @param y1
* @param x2
* @param y2
*/
line(x1: number, y1: number, x2: number, y2: number): void;
/**
* Line path
*
* @param x1
* @param y1
* @param x2
* @param y2
*/
linePath(x1: number, y1: number, x2: number, y2: number): void;
/**
* line to
*
* @param x
* @param y
*/
lineTo(x: number, y: number): void;
lineToPoint(point: IPoint): void;
/**
* Polygon
*
* @param points
*/
polygon(...points: (number | IPoint)[]): void;
/**
* Polygon path
*
* @param points
*/
polygonPath(...points: (number | IPoint)[]): void;
/**
* Poly line
*
* @param points
*/
polyline(points: (number | IPoint)[]): void;
/**
* Poly line path
*
* @param points
*/
polylinePath(points: (number | IPoint)[]): void;
/**
* Quadratic curve
*
* @param cpx
* @param cpy
* @param x
* @param y
*/
quadraticCurve(cpx: number, cpy: number, x: number, y: number): void;
/**
* Rect
*
* @param x
* @param y
* @param width
* @param height
*/
rect(x: number, y: number, width: number, height: number): void;
/**
* Rect rounded
*
* @param x
* @param y
* @param width
* @param height
* @param radius
*/
rectRounded(x: number, y: number, width: number, height: number, radius: number): void;
/**
* Rect path
*
* @param x
* @param y
* @param width
* @param height
*/
rectPath(x: number, y: number, width: number, height: number): void;
/**
* Text width
*
* @param text
* @return
*/
textWidth(text: string): number;
/**
* Vertical line
*
* @param x
* @param y1
* @param y2
*/
verticalLine(x: number, y1: number, y2: number): void;
shadow(options: IShadowRenderingOptions): void;
/**
* Strokes theme
*
* @param stroke
*/
strokeTheme(stroke: IStrokeTheme): void;
/**
* Strokes
*
* @param theme
* @param force
*/
stroke(theme?: IStrokeTheme, force?: boolean): void;
fillTheme(theme: IFillTheme): void;
/**
* Fills
*
* @param theme
* @param force
* @param fillRule
*/
fill(theme?: IFillTheme, force?: boolean, fillRule?: CanvasFillRule): void;
/**
* Fills stroke theme
*
* @param fillTheme
* @param strokeTheme
*/
fillStrokeTheme(fillTheme: IFillTheme, strokeTheme: IStrokeTheme): void;
/**
* Fills stroke
*
* @param fillTheme
* @param strokeTheme
*/
fillStroke(fillTheme?: IFillTheme, strokeTheme?: IStrokeTheme): void;
/**
* Text theme
*
* @param textTheme
*/
textTheme(textTheme: ITextTheme): void;
/**
* Fills text
*
* @param text
* @param x
* @param y
* @param textTheme
*/
fillText(text: string, x: number, y: number, textTheme?: ITextTheme): void;
}
}
declare module FintaChart {
/**
* Describes padding area.
*/
interface IPadding {
/**
* The width of the padding area on the left.
*/
left: number;
/**
* The height of the padding area on the top.
*/
top: number;
/**
* The width of the padding area on the left.
*/
right: number;
/**
* The height of the padding area on the bottom.
*/
bottom: number;
}
}
declare module FintaChart {
/**
* Describes cartesian point
*/
interface IPoint {
/**
* The X coordinate.
*/
x: number;
/**
* The Y coordinate.
*/
y: number;
}
}
declare module FintaChart {
enum XPointBehavior {
X = "x",
RECORD = "record",
DATE = "date"
}
enum YPointBehavior {
Y = "y",
VALUE = "value"
}
/**
* Represents point behavior
*/
interface IPointBehavior {
/**
* x
*/
x: XPointBehavior;
/**
* y
*/
y: YPointBehavior;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Describes size of the element.
*/
interface ISize {
/**
* The width of the element.
*/
width: number;
/**
* The height of the element.
*/
height: number;
}
}
declare module FintaChart {
/**
* Describes abstract component.
*/
interface IComponent extends IDisposable {
}
/**
* Represents abstract component.
*/
abstract class Component implements IComponent {
abstract dispose(): void;
}
}
declare module FintaChart {
/**
* Describes canvas layer config.
*
*/
interface ICanvasLayerConfig {
/**
* The parent element.
*/
parent: HTMLElement;
/**
* The size of the canvas.
*/
size?: ISize;
}
/**
* Represents canvas layer.
*
*/
class CanvasLayer extends Component {
private _canvasEl;
private _parentEl;
private _renderer;
private _sizeCache;
private _sizeCacheStamp;
/**
* The canvas element.
*/
get canvas(): HTMLCanvasElement;
/**
* The parent container.
*/
get parent(): HTMLElement;
/**
* The renderer.
*/
get renderer(): IRenderer;
/**
* The size of the canvas in CSS pixels (matches the legacy jQuery `.width()`/`.height()`
* behavior — distinct from the canvas element's `width`/`height` attributes which carry
* the device-pixel backing-store size on HiDPI displays).
*/
get size(): ISize;
set size(value: ISize);
/**
* Creates an instance of CanvasLayer.
*
* @param config The configuration.
*/
constructor(config: ICanvasLayerConfig);
dispose(): void;
private init;
}
}
declare module FintaChart {
/**
* Describes visual component.
*/
interface IVisualComponent extends IComponent {
/**
* Applies theme.
*/
applyTheme(): any;
/**
* Resizes component.
*
* @param bounds The new bounds.
*/
resize(bounds?: Bounds): void;
}
/**
* Represents abstract visual component.
*/
abstract class VisualComponent extends Component implements IVisualComponent {
abstract applyTheme(): any;
abstract resize(bounds?: Bounds): any;
}
}
declare module FintaChart {
/**
* Describes component that is built on HTML elements.
*/
interface IHtmlComponent extends IVisualComponent {
/**
* The parent html container.
*/
readonly container: HTMLElement;
/**
* Refreshes component.
*/
refresh(): void;
}
/**
* Represents component that is built on HTML elements.
*/
abstract class HtmlComponent extends VisualComponent implements IHtmlComponent {
private _container;
get container(): HTMLElement;
dispose(): void;
resize(): void;
refresh(): void;
/**
* Creates html component's container.
*/
protected abstract createContainer(): HTMLElement;
/**
* Destroy html component's container
*/
protected destroyContainer(): void;
}
}
declare module FintaChart {
/**
* Describes [[ChartComponent]] configuration.
*/
interface IChartComponentConfig {
/**
* The chart.
*/
chart?: Chart;
}
/**
* Describes component that uses chart.
*/
interface IChartComponent extends IComponent {
/**
* The chart.
*/
chart: Chart;
}
/**
* Represents component that uses chart.
*/
abstract class ChartComponent extends Component implements IChartComponent {
private _chart;
/**
* Creates an instance of ChartComponent.
*
* @param config
*/
constructor(config?: IChartComponentConfig);
get chart(): Chart;
set chart(value: Chart);
dispose(): void;
/**
* The method gets called before the chart change.
*/
protected onChartChanging(): void;
/**
* The method gets called after the chart change.
*/
protected onChartChanged(): void;
/**
* Subscribes to chart events.
*/
protected subscribe(): void;
/**
* Unsubscribes from chart events.
*/
protected unsubscribe(): void;
}
}
declare module FintaChart {
/**
* Describes abstract control.
*/
interface IControl extends IComponent {
/**
* Paints control.
*/
paint(): void;
/**
* Handles window events.
*
* @param event The event.
* @return true if event was handled, otherwise false.
*/
onEvent(event: IWindowEvent): boolean;
/**
* Determines whether specified point is inside the control.
*
* @param point The point.
* @return true if a given point is inside the control, otherwise false.
*/
hitTest(point: IPoint): boolean;
/**
* Updates control size.
*
* @param frame The frame bounds.
*/
resize(frame: Bounds): void;
}
/**
* Represents abstract control.
*/
abstract class Control extends Component implements IControl {
private _motionEvents;
/**
* Creates an instance of [[Control]].
*/
constructor();
paint(): void;
onEvent(event: IWindowEvent, inBounds?: boolean): boolean;
hitTest(point: IPoint): boolean;
resize(frame: Bounds): void;
/**
* Initializes motion events required by control.
*
* @return [[MotionEventArray]] that contains events required by control.
*/
protected initMotionEvents(): MotionEventArray;
}
}
declare module FintaChart {
/**
* Describes HTML control.
*/
interface IHtmlControl extends IControl {
/**
* The parent container.
*/
container: HTMLElement;
/**
* The frame rectangle.
*/
frame: Bounds;
}
/**
* Represents HTML control.
*/
abstract class HtmlControl extends Control implements IHtmlControl {
private _frame;
private _container;
get container(): HTMLElement;
protected set container(value: HTMLElement);
get frame(): Bounds;
dispose(): void;
hitTest(point: IPoint): boolean;
resize(frame: Bounds): void;
/**
* Creates container element.
*
* @return Container element.
*/
protected abstract createContainer(): HTMLElement;
/**
* Removes container element.
*/
protected removeContainer(): void;
}
}
declare module FintaChart {
/**
* Describes [[ChartHtmlControl]] configuration.
*/
interface IChartHtmlControlConfig {
/**
* The chart.
*/
readonly chart: Chart;
}
/**
* Describes [[HtmlControl]] that uses chart.
*/
interface IChartHtmlControl extends IHtmlControl {
/**
* The chart.
*/
chart: Chart;
}
/**
* Represents [[HtmlControl]] that uses chart.
*/
abstract class ChartHtmlControl extends HtmlControl implements IChartHtmlControl {
private readonly _chart;
get chart(): Chart;
/**
* Creates an instance of [[ChartHtmlControl]].
*
* @param config The configuration.
*/
protected constructor(config: IChartHtmlControlConfig);
dispose(): void;
/**
* Subscribes to events.
*/
protected abstract subscribe(): void;
/**
* Unsubscribes from events.
*/
protected abstract unsubscribe(): void;
}
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents Item
*
*/
interface IDropDownItem {
/**
* Item's data attribute
*/
dataAttr?: string;
/**
* Is item selected
*/
selected: boolean;
/**
* Item's style
*/
style: CSSStyleDeclaration;
/**
* Item's title
*/
title: string;
/**
* Item's value
*/
value: string | number;
}
/**
* Provides model of SIMPLE Dropdown
*
*/
class DropDown implements IDisposable {
private static _initialized;
private _container;
private _foundItem;
private _items;
private _itemsContainer;
private _onchange;
private _parentContainer;
private _selectedContainer;
/**
* Creates an instance of DropDown.
*
* @param container
*/
constructor(container: HTMLElement);
dispose(): void;
/**
* Finds SIMPLE Dropdown item
*
* @return Founded SIMPLE Dropdown item
*/
selected(): IDropDownItem;
/**
* On SIMPLE Dropdown event
*
* @param event
* @param callback
*/
on(event: string, callback: VoidFunction): void;
/**
* Updates SIMPLE Dropdown item
*
* @param value
* @param performOnChange
*/
select(value: unknown, performOnChange?: boolean): void;
private closeItem;
private closeOpenedItems;
private closeOpenedItemsSilence;
private createElements;
private init;
private initHandlers;
private onContainerClick;
private onItemClick;
private refresh;
}
}
declare module FintaChart {
/**
* Represents Numeric Field Config
*
*/
interface INumericFieldConfig {
/**
* Is Numeric Field allow negative
*/
allowNegative: boolean;
/**
* Numeric Field's max value
*/
maxValue: number;
/**
* Numeric Field's min value
*/
minValue: number;
/**
* Numeric Field's price decimals
*/
priceDecimals: number;
/**
* Is show Numeric Field's arrows
*/
showArrows: boolean;
/**
* Numeric Field's value
*/
value: number;
/**
* On Numeric Field change
*
* @param value
* @param obj
*/
onChange(value: number, obj: HTMLInputElement): void;
}
class NumericField {
/**
* Initializes a numeric field on the given HTMLInputElement.
*/
static init(el: HTMLInputElement, options: Partial): void;
static getValue(control: HTMLElement): number;
static setValue(control: HTMLElement, value: number): void;
static enable(control: HTMLElement): void;
static disable(control: HTMLElement): void;
static highlightInvalid(control: HTMLElement): void;
static nohighlightInvalid(control: HTMLElement): void;
static setBounds(control: HTMLElement, min: number, max: number): void;
}
}
declare module FintaChart {
/**
* Represents Dialog Config
*
*/
interface IDialogConfig {
/**
* Dialog Config chart
*/
chart: Chart;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents Context Menu Config
*
*/
interface IContextMenuConfig {
/**
* Context Menu Config menu container
*/
menuContainer?: HTMLElement;
/**
* Is show Context Menu on click
*/
showOnClick?: boolean;
/**
* On Context Menu item selected
*
* @param selectedMenu
* @param isChecked
*/
onItemSelected(selectedMenu: HTMLElement, isChecked?: boolean): void;
/**
* On Context Menu show
*/
onShow?(): void;
}
/**
* Provides model of Context Menu
*
*/
class ContextMenu implements IDisposable {
private _isShown;
private _shownAt;
private _docClickHandler;
private _docContextMenuHandler;
private _docTouchHandler;
private _winScrollHandler;
private _winResizeHandler;
private _bodyMenuOpenHandler;
private _menuClickTouchHandler;
private _subscribedDoc;
private _subscribedView;
/**
* Context Menu's config
*/
protected config: TConfig;
/**
* Get Context Menu's container
*/
get container(): HTMLElement;
/**
* Creates an instance of ContextMenu.
*
* @param config
* @param targetDomObject
*/
constructor(config: TConfig, targetDomObject?: HTMLElement);
dispose(): void;
/**
* Hides Context Menu
*/
hide(): void;
/**
* Shows context menu.
*
* @param event
*/
show(event: Event): void;
private static _getSubMenuPosition;
private static _toggleSubMenu;
private calculateMenuPosition;
private getLeftLocation;
private getTopLocation;
private subscribeEvents;
private unsubscribeEvents;
}
}
declare module FintaChart {
/**
* Describes chart context menu config.
*
*/
export interface IChartContextMenuConfig extends IContextMenuConfig {
/**
* The chart
*/
chart: Chart;
}
enum ContextMenuItem {
FORMAT = "format"
}
/**
* Represents chart context menu.
*
*/
export class ChartContextMenu extends ContextMenu {
private static container;
/**
* Chart Context Menu's menu item
*/
static MenuItem: typeof ContextMenuItem;
/**
* Creates an instance of ChartContextMenu.
*
* @param targetDomObject
* @param config
*/
constructor(targetDomObject: HTMLElement, config: IChartContextMenuConfig);
dispose(): void;
private init;
private onShow;
}
export {};
}
declare module FintaChart {
/**
* Provides model of Control Color Picker
*
*/
class ColorPicker {
private _picker;
private _initialized;
private _pendingConfig?;
private _pendingColor?;
private _observer?;
/**
* Retrieves Control Color Picker's color
*
* @return
*/
get color(): string;
set color(value: string);
/**
* Creates an instance of ColorPicker.
*
* @param domObjects
* @param config
*/
constructor(domObjects: HTMLElement, config: Spectrum.Options);
static get(control: HTMLElement): string;
static set(control: HTMLElement, color: string): void;
static hide(control: HTMLElement): void;
static enable(control: HTMLElement, enable: boolean): void;
enable(value?: boolean): void;
private static isElementReady;
private static hasSpectrum;
private initSpectrum;
private waitForAttach;
private static initParams;
private static palette;
private static adopt;
}
}
declare module FintaChart {
/**
* Represents Control Drag Pane Config
*
*/
interface IDragPaneConfig {
/**
* Control Drag Pane Config container
*/
container?: HTMLElement;
/**
* Control Drag Pane Config root container
*/
rootContainer?: HTMLElement;
}
/**
* Provides model of Control Drag Pane
*
*/
class DragPane implements IDisposable {
/**
* Control Drag Pane's container
*/
protected container: HTMLElement;
/**
* Control Drag Pane's root container
*/
protected rootContainer: HTMLElement;
/**
* Bound resize handler reference for cleanup
*/
private _resizeHandler;
/**
* Whether the pane has been placed at its initial position
*/
private _positioned;
/**
* Pointer offset from the pane top-left at drag start
*/
private _dragOffsetX;
private _dragOffsetY;
/**
* Bound drag handlers for cleanup
*/
private _onDragStart;
private _onDragMove;
private _onDragEnd;
/**
* Drag handle element
*/
private _handleEl;
get visible(): boolean;
/**
* Creates an instance of DragPane.
*
* @param config
*/
constructor(config: IDragPaneConfig);
dispose(): void;
/**
* Hides Control Drag Pane
*/
protected hide(): void;
/**
* Initializes Control Drag Pane
*/
protected initialize(): void;
/**
* Shows Control Drag Pane
*/
protected show(): void;
/** Returns the offsetParent rect the pane is positioned against. */
private parentRect;
/** Places the pane near the top-center of the chart. */
private placeInitial;
private onDragStart;
private onDragMove;
private onDragEnd;
/** Sets absolute position within the offsetParent, clamped inside it. */
private applyPosition;
private clampIntoViewport;
private eventPoint;
private teardownDrag;
private onResize;
}
}
declare module FintaChart {
/**
* Provides model of Notification
*/
class Notification {
private static _options;
/**
* Shows error notification.
*
* @param msg The error message.
* @param chart The chart.
* @param title The notification title.
*/
static error(msg: string, chart?: Chart, title?: string): void;
/**
* Shows information notification.
*
* @param msg The notification message.
* @param title The notification title.
*/
static info(msg: string, title?: string): void;
/**
* Shows success notification.
*
* @param msg The notification message.
* @param chart The chart.
* @param title? The notification title.
*/
static success(msg: string, chart: Chart, title?: string): void;
/**
* Shows warning notification.
*
* @param msg The warning message.
* @param chart The chart.
* @param title The notification title.
*/
static warning(msg: string, chart?: Chart, title?: string): void;
private static makeTitle;
}
}
declare module FintaChart {
/**
* Represents Tooltip State
*
*/
interface ITooltipState {
/**
* Tooltip State's name
*/
name: string;
/**
* Tooltip State's location
*/
location: string;
/**
* Tooltip State's text
*/
text: string;
/**
* Tooltip State's theme
*/
theme?: any;
}
/**
* Represents Tooltip Config
*
*/
interface ITooltipConfig {
/**
* Tooltip options
*/
options?: ITooltipOptions;
/**
* Tooltip parent
*/
parent: IPaneObject;
}
/**
* Represents Tooltip Options
*
*/
interface ITooltipOptions {
/**
* Tooltip name
*/
kind?: string;
/**
* Tooltip location
*/
location: string;
/**
* Tooltip text
*/
text: string;
/**
* Tooltip theme
*/
theme?: any;
}
/**
* Represents Shape Trend Channel Config
*
*/
interface ITooltipDefaults {
/**
* Tooltip name
*/
kind: string;
/**
* Tooltip text
*/
text: string;
/**
* Tooltip theme
*/
theme?: any;
}
/**
* Provides model of Tooltip
*
*/
class Tooltip implements IDisposable, IStateable {
static defaults: ITooltipDefaults;
private _arrowAfter;
private _arrowBefore;
private _arrowMainBefore;
private _contentElement;
private _id;
private _isInDom;
private _maxContentWidth;
private _minSize;
private _options;
private _parent;
private _tooltipElement;
private _visible;
/**
* Tooltip layout bounds
*/
layoutBounds: IBounds;
/**
* Creates an instance of Tooltip.
*
* @param config
*/
constructor(config: ITooltipConfig);
/**
* Get shape's current theme or default theme if current theme is not set
*/
get defaultLayoutTemplate(): any;
/**
* Get default theme of shape
*/
get defaultTemplate(): any;
/**
* Get tooltip content name
*/
get contentKind(): string;
set contentKind(value: string);
/**
* Get tooltip location
*/
get location(): string;
set location(value: string);
/**
* Get tooltip size
*/
get size(): ISize;
/**
* Get tooltip text
*/
get text(): string;
set text(value: string);
/**
* Get tooltip theme
*/
get theme(): any;
set theme(value: any);
/**
* Get tooltip visible
*/
get visible(): boolean;
dispose(): void;
saveState(): ITooltipState;
restoreState(state: ITooltipState): void;
/**
* Setups Tooltip layout theme
*/
setupLayoutTheme(): void;
/**
* Hides Tooltip
*/
hide(): void;
/**
* Moves Tooltip point to
*
* @param point
*/
moveTo(point: IPoint): void;
/**
* Shows Tooltip
*
* @param point
*/
show(point: IPoint): void;
private actualPosition;
private adjustArrow;
private applyText;
private calculateLocation;
private initElements;
}
}
declare module FintaChart {
/**
* Provides model of Text Style Selector
*/
class TextStyleSelector {
private _checkboxes;
private _labels;
private _selector;
/**
* Creates an instance of TextStyleSelector.
*
* @param selector
*/
constructor(selector: HTMLElement);
/**
* Retrieves selected Text Style Selector state
*
* @param val
* @return Selected Text Style Selector state
*/
selectedState(val: string): boolean;
/**
* Selects Text Style Selector's state
*
* @param val
* @param state
*/
selectState(val: string, state: boolean): void;
private init;
}
}
declare module FintaChart {
interface ICustomTimeFrameConfig extends IDialogConfig {
/**
* The callback that is called to apply settings.
*
* @param theme The theme.
*/
done(newTimeFrame: ITimeFrame): void;
}
}
declare module FintaChart {
/**
* Represents Instrument Search Config
*
*/
interface IInstrumentSearchConfig {
/**
* Instrument Search Config chart
*/
chart?: Chart;
/**
* Instrument Search Config instruments
*/
instruments?: IInstrument[];
/**
* Instrument Search Config value
*/
value?: string;
/**
*
* @param instrument
*/
onChange?(instrument: IInstrument): void;
allowSelection?(): boolean;
}
/**
* Provides model of Instrument Search
*
*/
class InstrumentSearch {
readonly _config: IInstrumentSearchConfig;
readonly _inputField: HTMLInputElement;
private readonly _resultsDropDown;
private _currentText;
private _isDropDownVisible;
private _noResults;
private _resultsCount;
private _searchDelayTimer;
private _exchange;
private _value;
private _disabled;
private _selectedFilters;
private _page;
private _size;
private _isLoad;
private _subscribedDocs;
/**
* Creates an instance of InstrumentSearch.
*
* @param rootContainer
* @param config
*/
constructor(rootContainer: HTMLElement, config: IInstrumentSearchConfig);
/**
* Retrieves Instrument Search's by symbol
*
* @return Instrument Searched by symbol
*/
getBySymbol(symbol: string): Promise;
/**
* Retrieves Instrument Search's by id
*
* @return Instrument Searched by id
*/
getById(id: string): Promise;
/**
* Set Instrument Search's instrument
*
* @param instrument
*/
set(instrument?: IInstrument): void;
enable(): void;
disable(): void;
private static escapeHtml;
private static generateListElement;
private generateExchangeFilters;
private generateSearchResults;
private getInputValue;
private getInstrumentBySymbol;
private getInstruments;
private static normalizeSymbolForSearch;
private getInstrumentById;
hideDropDown(): void;
private highlightDropDownItem;
private static highlightHTMLText;
private init;
/**
* Returns the body of the document currently owning the input.
* Resolved lazily (not cached) so the dropdown keeps working when
* the chart is moved between documents (e.g. Picture-in-Picture).
*/
private ownerBody;
/**
* Subscribes document/window listeners in the document currently
* owning the input. Called on init and on every open, so the
* dropdown keeps working after the chart moves between documents
* (e.g. Picture-in-Picture). Each document is subscribed at most
* once; handlers are idempotent.
*/
private subscribeDocumentEvents;
private static searchTextPositions;
private setValue;
private loadData;
private setupInputListeners;
private showDropDown;
private _scrollTopList;
}
}
declare module FintaChart {
/**
* Provides model of Replay Mode Manager
*
*/
class ReplayModeManager extends Control {
private _chart;
private _closeBtn;
private _forwardBtn;
private _isPlayStarted;
private _jumToActivated;
private _jumpToBtn;
private _playPauseBtn;
private _replayChartText;
private _startRecordPromptEl;
private _speedInput;
private _speedItemContainer;
private _speedSelectDropdown;
private _timeInterval;
private _toRealTimeBtn;
private _toolbar;
/**
* Number of trailing future-projection placeholder bars (bars with no
* price data) detected in the series when replay engaged. While replay
* is active this many NaN-OHLC placeholder bars are kept past the
* replay cursor so forward-projecting indicators (e.g. composite cycle
* forecast) keep their slots and can still plot into the future.
*/
private _projectionCount;
replaySpeed: number;
/**
* Replay Mode Manager's current index
*/
currentIndex: number;
/**
* Is Replay Mode Manager in play mode
*/
isInPlayMode: boolean;
/**
* Retrieves Replay Mode Manager's origin data rows
*/
originDataRows: Record;
/**
* Creates an instance of ReplayModeManager.
*
* @param chart
*/
constructor(chart: Chart);
/**
* Get Replay Mode Manager's chart
*/
get chart(): Chart;
set chart(value: Chart);
/**
* Get Replay Mode Manager's pane
*/
get pane(): Pane;
/**
* Initializes Replay Mode Manager
*
* @param toolbar
*/
initialize(toolbar: Toolbar): void;
/**
* Retrieves is Replay Mode Manager's chart type requires calculations
*
* @param chartType
* @return Is Replay Mode Manager's chart type requires calculations
*/
chartTypeRequiresCalculations(chartType: string): boolean;
createCopySeries(): void;
dispose(): void;
/**
* Forwards Replay Mode Manager
*/
forward(): void;
/**
* Hit tests Replay Mode Manager's point
*
* @param point
* @return Replay Mode Manager's point is hit
*/
hitTest(point: IPoint): boolean;
/**
* Jumps to
*/
jumpTo(): void;
/**
* Surfaces the start-record prompt and arms jumpTo so the next pane click
* sets the replay start point. Called when a user clicks play/forward/toRealTime
* before any start record has been chosen.
*/
promptForStartRecord(): void;
/**
* Plays
*/
play(): void;
/**
* Shows Replay Mode Manager's replay mode line
*/
showReplayModeLine(): void;
/**
* Stops Replay Mode Manager's replay mode
*/
stopReplayMode(): void;
/**
* Moves to real time
*/
toRealTime(): void;
/**
* Updates Replay Mode Manager's replay chart text
*/
updateReplayChartText(): void;
protected initMotionEvents(): MotionEventArray;
/**
* Update last value in original rows
*/
updateLastValue(bar: IBar, instrument?: IInstrument): void;
/**
* Add value to original rows
*/
addValueToRow(bar: IBar, instrument?: IInstrument): void;
/**
* Returns last bar from original series
*/
getLastOriginBar(): IBar;
private bindControlClicks;
private subscribe;
private createReplayChartText;
private showStartRecordPrompt;
private hideStartRecordPrompt;
private disabledButton;
private enabledButton;
private generateSpeedItems;
private onClick;
private initField;
private onSpeedChanged;
private setBtnView;
private setPauseView;
private startPlay;
private setPlayView;
/**
* Counts the trailing future-projection placeholder bars in the
* preserved origin series — bars at the end of the data that carry no
* price (NaN/empty close). Consumers append these for forward-projection
* rendering; we keep an equally-sized window alive past the replay
* cursor so projecting indicators still have slots to plot into.
*/
private countTrailingPlaceholders;
/**
* Builds a no-price placeholder bar carrying the date at `index` in
* the given (origin) series, or null when `index` is out of range.
*/
private placeholderBarAt;
/**
* Appends the future-projection placeholder window (NaN-OHLC bars with
* real future dates from the origin series) starting at origin index
* `start`, for the primary series and every compared instrument, so
* forward-projecting indicators keep slots past the replay cursor.
*/
private appendProjectionPlaceholders;
/**
* Reveals the bar at the current replay index.
*
* Without a projection window (legacy behaviour) the bar is simply
* appended. With a projection window active the real bar is written
* in-place into the first placeholder slot (its date already matches)
* and one fresh placeholder is appended at the tail, so the projection
* window keeps its width and forward-projecting indicators continue to
* plot past the replay cursor.
*/
private revealNextReplayBar;
/**
* Overwrites the OHLCV values at `index` of the given bar data rows
* with `bar` (the date is left untouched — it already matches).
*/
private revealInPlace;
}
}
declare module FintaChart {
/**
* Represents Templates Config
*
*/
interface ITemplatesConfig {
/**
* Templates Config align dropdown
*/
alignDropdown: (container: HTMLElement, chart: Chart) => void;
/**
* Templates Config chart
*/
chart: Chart;
}
/**
* Provides model of Templates Manager
*
*/
class TemplatesManager {
private readonly editModeItem;
private readonly errorClass;
private readonly itemAttribute;
private readonly itemClass;
private readonly itemEdit;
private readonly itemRemove;
private readonly _alignDropdown;
private readonly _templateDataProvider;
private _bodyContainer;
private _chart;
private _confirmButton;
private _container;
private _controlContainer;
private _createButton;
private _editMode;
private _editingItemIndex;
private _input;
private _templates;
private _updateListener;
private _isDisabled;
/**
* Creates an instance of TemplatesManager.
*
* @param rootElement
* @param config
*/
constructor(rootElement: HTMLElement, config: ITemplatesConfig);
/**
* Set Templates Manager's new chart
*/
setNewChart(chart: Chart): void;
disable(): void;
enable(): void;
private static getTemplateItemUI;
private checkExistName;
private init;
private renderTemplateList;
private onListUpdated;
private setUIState;
unsubscribeFromUpdate(): void;
}
}
declare module FintaChart {
/**
* Represents Time Frame Picker Config
*
*/
interface ITimeFramePickerConfig {
/**
* Time Frame Picker Config chart
*/
chart?: Chart;
/**
* Time Frame Picker Config time frame
*/
timeFrame?: ITimeFrame;
/**
* On Time Frame Picker Config selection changed
*
* @param timeFrame
*/
selectionChanged(timeFrame: TimeFrame): any;
allowSelection?(timeFrame: TimeFrame): boolean;
}
/**
* Provides model of Time Frame Picker
*
*/
class TimeFramePicker {
private readonly _rootDomElement;
private _btnWrapper;
private _config;
private _domObjects;
private _hasCustomPicker;
private _isActive;
private _last;
private _hoverTimer;
private _windowScrollHandler;
private _windowResizeHandler;
private _bodyClickHandler;
private _bodyTouchHandler;
private _subscribedDoc;
private _subscribedView;
/**
* Creates an instance of TimeFramePicker.
*
* @param rootContainer
* @param config
*/
constructor(rootContainer: HTMLElement, config: ITimeFramePickerConfig);
/**
* Get Time Frame Picker's chart
*/
get chart(): Chart;
set chart(value: Chart);
/**
* Sets Time Frame Picker
*
* @param timeFrame
*/
set(timeFrame: ITimeFrame): void;
private static extractDataFromItem;
private static getDomObjects;
private activateItem;
private dropDownBounds;
private alignDropdown;
private invoke;
private getPickerIntervalValue;
private hideDropDown;
private init;
private selectDistinctPredefinedTimeFrames;
private setCustomPickerValues;
private setLabels;
private setValue;
private showDropDown;
private synchronizeWithCustomPicker;
private toggleDropDown;
/**
* Subscribes document/window listeners in the document currently
* owning the picker. Called on init and on every open, so the
* dropdown keeps working after the chart moves between documents
* (e.g. Picture-in-Picture).
*/
private subscribeDocumentEvents;
private unsubscribe;
}
}
declare module FintaChart {
class ToolbarCalendar {
private _chart;
private _element;
private _onSelect;
private _selected;
private _viewYear;
private _viewMonth;
private _months;
private _weekdaysShort;
private _clearText;
private _todayText;
constructor(chart: Chart, host: HTMLElement);
get isVisible(): boolean;
/**
* Shows the calendar for the given selection.
*
* @param selected Currently selected date, highlighted in the grid.
* @param onSelect Invoked with the picked date, or `null` when cleared.
*/
show(selected: Date | null, onSelect: (date: Date | null) => void): void;
hide(): void;
private _loadLocalization;
private _localize;
private _splitLocalized;
private _render;
private _renderHeader;
private _renderNavButton;
private _renderGrid;
private _renderDay;
private _renderFooter;
private _pick;
private _isSameDay;
private _shiftMonth;
}
}
declare module FintaChart {
/**
* Identifier for a single toolbar button or group.
* Names match tooltip hints for discoverability.
*/
enum ToolbarItem {
/** Options — hint */
Theme = "theme",
/** Options alias */
Options = "options",
/** Instrument — hint */
InstrumentSearch = "instrumentSearch",
/** Instrument alias */
Instrument = "instrument",
/** Timeframes — hint */
TimeFramePicker = "timeFramePicker",
/** Timeframes alias */
Timeframes = "timeframes",
/** Indicators */
Indicators = "indicators",
/** Candles — hint for ChartType */
ChartType = "chartType",
/** Candles alias */
Candles = "candles",
/** Compare — hint */
CompareInstrument = "compareInstrument",
/** Compare alias */
Compare = "compare",
/** Cursor options — hint */
CrossHair = "crossHair",
/** Cursor alias */
Cursor = "cursor",
/** CursorOptions alias */
CursorOptions = "cursorOptions",
/** Templates */
Templates = "templates",
/** Adjustment — hint */
Adjust = "adjust",
/** Adjustment alias */
Adjustment = "adjustment",
/** OHLC Pane — hint */
Ohlc = "ohlc",
/** OHLC Pane alias */
OhlcPane = "ohlcPane",
/** OHLC Cards — hint */
OhlcCard = "ohlcCard",
/** OHLC Cards alias */
OhlcCards = "ohlcCards",
/** Bar replay — hint */
ReplayMode = "replayMode",
/** BarReplay alias */
BarReplay = "barReplay",
/** Trading — hint */
TradePanel = "tradePanel",
/** Trading alias */
Trading = "trading",
/** Undo */
Undo = "undo",
/** Redo */
Redo = "redo",
/** Save as Image — hint */
Snapshot = "snapshot",
/** SaveImage alias */
SaveImage = "saveImage",
/** Export */
Export = "export",
/** View Mode */
ViewMode = "viewMode",
/** Trendlines — hint */
Geometrical = "geometrical",
/** Trendlines alias */
Trendlines = "trendlines",
/** Shapes — hint */
Patterns = "patterns",
/** Shapes alias */
Shapes = "shapes",
/** Scribble — hint name */
Scribble = "scribble",
/** FreeHand — code name, alias for Scribble */
FreeHand = "freeHand",
/** Fibonacci tools — hint */
Fibonacci = "fibonacci",
/** FibonacciTools alias */
FibonacciTools = "fibonacciTools",
/** Trend Channel Shapes — hint */
TrendLines = "trendLines",
/** TrendChannelShapes alias */
TrendChannelShapes = "trendChannelShapes",
/** Etc. Shapes — hint */
LabelShapes = "labelShapes",
/** EtcShapes alias */
EtcShapes = "etcShapes",
/** Visible Profile — hint */
ProfileDrawing = "profileDrawing",
/** ProfileTool alias */
ProfileTool = "profileTool",
/** Text */
Text = "text",
/** Bar Marker */
BarMarker = "barMarker",
/** Balloon */
Balloon = "balloon",
/** Measure */
Measure = "measure",
/** Positions */
Positions = "positions",
/** Zoom — hint */
ZoomIn = "zoomIn",
/** Zoom alias */
Zoom = "zoom",
/** In Shape Mode — hint */
StayInShapeMode = "stayInShapeMode",
/** InShapeMode alias */
InShapeMode = "inShapeMode",
/** Magnet — hint */
MagnetMode = "magnetMode",
/** Magnet alias */
Magnet = "magnet",
/** Lock — hint */
LockMode = "lockMode",
/** Lock alias */
Lock = "lock",
/** Hide drawings — hint */
HideOptions = "hideOptions",
/** HideDrawings alias */
HideDrawings = "hideDrawings",
/** Remove Selected Shape — hint */
Delete = "delete",
/** RemoveShape alias */
RemoveShape = "removeShape",
/** General Shapes — hint */
Miscellaneous = "miscellaneous",
/** GeneralShapes alias */
GeneralShapes = "generalShapes",
/** Date Range */
DateRange = "dateRange",
/** Sessions — hint */
TradingSession = "tradingSession",
/** Sessions alias */
Sessions = "sessions",
/** Log scale — hint */
ScaleLog = "scaleLog",
/** Log alias */
Log = "log",
/** Percent scale — hint */
ScalePercent = "scalePercent",
/** Percent alias */
Percent = "percent",
/** Auto scale — hint */
ScaleAuto = "scaleAuto",
/** Auto alias */
Auto = "auto",
/** Scroll to last bar */
ScrollToLastBar = "scrollToLastBar"
}
/** Config can be array or map */
type ToolbarHiddenItems = ToolbarItem[] | Partial>;
/** Normalize array or map to array */
function toolbarHiddenItemsToArray(input?: ToolbarHiddenItems | null): ToolbarItem[];
/**
* CSS selector for each ToolbarItem inside Toolbar container.
*/
const ToolbarItemSelectors: Record;
}
declare module FintaChart {
/**
* Represents Toolbar Config
*
*/
interface IToolbarConfig {
/**
* Toolbar Config chart
*/
chart?: Chart;
/**
* Toolbar Config parent
*/
parent: HTMLElement;
/**
* Is show view mode
*/
showViewMode?: boolean;
/**
* Toolbar items to hide — array or map
*/
toolbarHiddenItems?: ToolbarHiddenItems;
}
/**
* Provides model of Toolbar
*
*/
class Toolbar implements IDisposable {
private _chart;
private _container;
private _controls;
private _draggableElements;
private _draggableControllers;
private _leftToolbarScroll;
private _rootContainer;
private _toolbarScroll;
private _locked;
private _lastOrderTime;
private _disponsed;
private _autoScaleBtn;
private _logScaleBtn;
private _percentScaleBtn;
private _lockShapesBtn;
private _dateRangeButtons;
private _dateRangeMenuItems;
private _applyingDateRangePreset;
private _dateRangeFrom;
private _dateRangeTo;
private _openDateRangePopup;
private _dateRangeResizeObserver;
private _dateRangeInlineWidth;
private _scalePercentageAdapter;
private _toolbarHiddenItems;
private _appliedHiddenSelectors;
onAmountChanged: (quantity: number) => void;
/**
* Creates an instance of Toolbar.
*
* @param config
*/
constructor(config: IToolbarConfig);
/**
*
* Get Toolbar's chart
*/
get chart(): Chart;
set chart(value: Chart);
/**
* Get Toolbar's container
*/
get container(): HTMLElement;
/**
* Toolbar's activate button
*
* @param draggable
*/
activateButton(draggable: HTMLElement): void;
getBottomToolbarRightSide(): HTMLElement;
/**
* Activates Toolbar's draggable by it self
*
* @param activator
*/
activateDraggableByItself(activator: HTMLElement): void;
getSearchInstrumentInput(): HTMLElement;
lock(): void;
dispose(): void;
/** Get hidden toolbar items */
getToolbarHiddenItems(): ToolbarItem[];
/** Set hidden toolbar items and reapply */
setToolbarHiddenItems(items: ToolbarHiddenItems): void;
/** Hide/show toolbar elements via config */
private applyToolbarVisibility;
private setElementsVisibility;
private cleanupToolbarDividers;
private findPrevVisibleSibling;
private findNextVisibleSibling;
/**
* Prepends Toolbar to
*
* @param container
*/
prependTo(container: HTMLElement): void;
/**
* Shows Toolbar's supported time frames
*/
supportedTimeFramesShow(): void;
private _createPeriodicityForm;
private _subscribeToCreateCustomTimeFrame;
private _subscribeDateRangeControls;
private onDocumentTap;
private _subscribeCollapsedDateRange;
private _observeDateRangeWidth;
private _subscribeCustomDateRange;
private updateDateRangeApplyState;
private formatDisplayDate;
private truncateToDay;
private endOfDay;
/**
* Applies a bottom-toolbar date-range preset (1D, 5D, ..., All).
*
* @param presetKey
*/
applyDateRangePreset(presetKey: string): void;
private applyDateRange;
private setActiveDateRangeButton;
private closestSupportedTimeFrame;
private parseSupportedTimeFrame;
private addToDate;
setTimeFrame(timeFrame: TimeFrame): void;
/**
* Refresh toolbar components depend to size
*/
refreshSize(): void;
setTimeFrameValue(timeFrame: ITimeFrame): void;
activateMagnet(mode: string): void;
/**
* Update trade panel units value
*
* @param quantity default quantity expressed in units (backend contract)
*/
updateTradeHandlerUnits(quantity: number): void;
private activateStayInShapeModeBtn;
private collapseBtnClicked;
private hideCollapse;
private showCollapse;
private deactivateButton;
private deactivateDraggable;
private endShape;
private onAdjustClick;
private onSnapshotClick;
private onChartTypeChange;
private onCollapseBtnClicked;
private onCompareInstrumentClick;
private onContinuedModeClick;
private onCrossHairChange;
private onDeleteClick;
private onHideOptionClick;
/** Reflects the hide buttons' active class from real chart state. */
private syncHideButtonsState;
onIndicatorsClick(): void;
applyIndicator(typeName: string): void;
private onInstrumentChange;
private onReplayModeClick;
onShapeClick(dataValue: string, isActivated: boolean): Shape | null;
private onShapeModeClick;
private onThemeClick;
private onTimeFrameChange;
private onViewModeChange;
private onZoomInClick;
private init;
setTradingSession(value?: string): void;
private updateDragPanelposition;
private initDraggableElements;
private getFormattedPrice;
private initTradePanel;
private switchOrderType;
private subscribeOnBarsUpdate;
private getBarsChangedEvents;
private unsubscribeFromBarsUpdate;
private updateSellBuyValues;
private getLastPrice;
private exportData;
private setZIndexes;
private startShape;
private subscribeEvents;
private toggleButtonActivator;
private toggleDraggableByActivator;
private deactivateDropDownElementBtn;
private deactivateHideShapesBtn;
private deactivateStayInShapeModeBtn;
private unsubscribeEvents;
private updateForNewChart;
private activateAutoScaleBtnIfNeeded;
private activateLogBtnIfNeeded;
private activatePercentScaleBtnIfNeeded;
private updateMagnetModeIfNeeded;
private onAutoScaleClick;
onLogScaleClick(): void;
onPercentScaleClick(): void;
get basePrice(): number;
private getRootContainer;
private onMagnetMode;
private updateCalculatorValues;
private resetTradePanelOnInstrumentChange;
private onLockShapesClick;
private replaceLockIcon;
private getStaticQuantitiesForCalc;
private getQuantityRules;
private normalizeAmountByRules;
private getNumberDecimals;
private getPriceDecimals;
}
}
declare module FintaChart {
/**
* Represents Toolbar Drop Down Button Config
*
*/
interface IToolbarDropDownButtonConfig {
/**
* Toolbar Drop Down Button's chart
*/
chart?: Chart;
/**
* Toolbar Drop Down Button's selected item
*/
selectedItem?: string;
/**
* On Toolbar Drop Down Button;s selection changed
*
* @param dataValue
* @param isActivated
*/
selectionChanged(dataValue: string, isActivated?: boolean): any;
allowSelection?(): boolean;
}
/**
* Provides model of Toolbar Drop Down Button
*
*/
class ToolbarDropDownButton {
private readonly _rootElement;
private _btnActivate;
private _btnWrapper;
private _btn_toggleDropDown;
private _canFireFromHead;
private _canToggle;
private _config;
private _hasChildren;
private _isActivated;
private _isActive;
private _items;
private _itemsContainer;
private _itemsWrapper;
private _isDisabled;
private _hoverCloseTimer;
private _subscribedDocs;
/**
* Creates an instance of ToolbarDropDownButton.
*
* @param rootElement
* @param config
*/
constructor(rootElement: HTMLElement, config: IToolbarDropDownButtonConfig);
/**
* Get Toolbar Drop Down Button's chart
*/
get chart(): Chart;
set chart(value: Chart);
/**
* Aligns Toolbar Drop Down Button's dropdown
*
* @param templateDropdown
* @param chart
*/
alignDropdown(templateDropdown: HTMLElement, chart: Chart): void;
/**
* Activates Toolbar Drop Down Button
*/
activate(fire?: boolean): void;
/**
* Deactivates Toolbar Drop Down Button
*/
deactivate(fire?: boolean): void;
/**
* Selects Toolbar Drop Down Button's item
*
* @param val
* @param fire
*/
selectItem(val: string, fire: boolean): void;
enable(): void;
disable(): void;
/**
* Returns the body of the document currently owning the button.
* Resolved lazily (not cached) so the dropdown keeps working when
* the chart is moved between documents (e.g. Picture-in-Picture).
*/
private ownerBody;
/**
* Returns the window of the document currently owning the button.
*/
private ownerView;
private dropDownBounds;
/**
* Subscribes body/window listeners in the document currently owning
* the button. Called on init and on every open, so the dropdown
* keeps working after the chart moves between documents.
* Each document is subscribed at most once; handlers are idempotent.
*/
private subscribeDocumentEvents;
private activateButton;
private activeIcon;
private deactivateButton;
private fireFromHead;
private scheduleHoverClose;
private hideDropDown;
private init;
private setValue;
/**
* Handles a tap/click on the button head, routing to toggle, fire or
* drop-down open depending on the button configuration and platform.
*
* @param e The originating tap/click event.
*/
private handleHeadTap;
private showDropDown;
private toggleButton;
private toggleDropDown;
private triggerActiveButton;
}
}
declare module FintaChart {
}
declare module FintaChart {
class TimeFrameChangePopup {
private _chart;
private _isShown;
private _element;
private _timeFrame;
private _correctTF;
private _inputField;
private _labelInfo;
constructor(chart: Chart);
show(value: string): Promise;
hide(): void;
private _loadTemplate;
private _initializePopup;
private _initFields;
private subscribeEvents;
private changeTimeFrame;
private checkSupportedTimeFrames;
private convertSupportedTimeFrame;
}
}
declare module FintaChart {
abstract class CommandBase {
/**
* Executes command.
*/
abstract execute(): void;
/**
* Rolls back command.
*/
abstract rollback(): void;
}
/**
* Represents abstract command.
*
* @template TExecutor The command executor type.
*/
abstract class Command extends CommandBase {
/**
* The command executor.
*/
protected executor: TExecutor;
/**
* Initializes a new instance of the [[Command]] class.
*
* @param executor The command executor.
*/
protected constructor(executor: TExecutor);
}
}
declare module FintaChart {
/**
* Describes chart type.
*
* @category Chart types
*/
interface IChartType extends IChartComponent, IStateable, IDisposable {
/**
* The type of chart type instance.
*/
readonly type: string;
/**
* The parent pane.
*/
readonly pane: Pane;
/**
* Determines whether chart type is time based (1 min, 1 hour, etc).
* For example, candle chart type is time based but renko is non-time based.
*/
readonly isTimeBased: boolean;
/**
* The flag that indicates whether price line should be stretched to the left.
*/
stretchPricingLines: boolean;
/**
* The flag that indicates whether price line should be visible.
*/
showPricingLines: boolean;
/**
* Returns primary data row marker to be used instead of specified default marker.
* Some chart types have OHLCV data different from the original chart data (like renko, kagi, etc).
* In this case indicators, ... should use row markers provided by chart type instead of default.
* For example, .kagi.close should be used instead of .close.
*
* @param rowMarker The default row marker.
* @return Primary data row marker for a given default marker.
*/
primaryDataRowMarker(rowMarker: string): string;
/**
* Resets chart type properties to default values.
*/
resetToDefaults(): void;
/**
* Applies chart type to the chart.
*
* @param autoScale The flag that indicates whether automatic scaling should be applied to the axis.
*/
apply(autoScale?: boolean): void;
/**
* Refreshes chart type (recalculates data rows if necessary).
*/
refresh(): void;
/**
* Check trading session hours
*/
TradingSessionHoursCheck(scrollToLastBar?: boolean): any;
}
/**
* Describes chart type defaults.
*
* @category Chart types
*/
interface IChartTypeDefaults {
/**
* The flag that indicates whether price line should be stretched to the left.
*/
stretchPricingLines: boolean;
/**
* The flag that indicates whether price line should be visible.
*/
showPricingLines: boolean;
}
/**
* Describes chart type configuration properties.
*
* @category Chart types
*/
interface IChartTypeConfig extends IChartComponentConfig {
/**
* The chart type options.
*/
options?: IChartTypeOptions;
}
/**
* Describes chart type options
*
* @category Chart types
*/
interface IChartTypeOptions {
/**
* The flag that indicates whether price line should be stretched to the left.
*/
stretchPricingLines?: boolean;
/**
* The flag that indicates whether price line should be visible.
*/
showPricingLines?: boolean;
}
/**
* Describes chart type state.
*
* @category Chart types
*/
interface IChartTypeState {
/**
* The name of chart type.
*/
readonly type: string;
/**
* The chart type options
*/
options: IChartTypeOptions;
}
/**
* Represents abstract chart type.
*
* @category Chart types
*/
abstract class ChartTypeBase extends ChartComponent implements IChartType {
/**
* Gets type name of chart type instance.
*/
static get type(): string;
/**
* The default chart type properties.
*/
static defaults: IChartTypeDefaults;
/**
* The plot used to render chart type.
*/
private _plot;
/**
* The default chart type properties.
*/
protected get defaults(): IChartTypeDefaults;
/**
* The type name of chart type instance.
*/
get type(): string;
get isTimeBased(): boolean;
abstract get stretchPricingLines(): boolean;
abstract set stretchPricingLines(value: boolean);
abstract get showPricingLines(): boolean;
abstract set showPricingLines(value: boolean);
/**
* The plot used to render chart type.
*/
protected get plot(): Plot;
/**
* The pane.
*/
get pane(): Pane;
/**
* Initializes a new instance of the [[ChartTypeBase]] class.
*/
protected constructor(config?: IChartTypeConfig);
dispose(): void;
abstract saveState(): IChartTypeState;
abstract restoreState(state: IChartTypeState): any;
abstract resetToDefaults(): void;
primaryDataRowMarker(rowMarker: string): string;
apply(autoScale?: boolean): void;
refresh(): void;
/**
* @description check trading session hours
*
* @memberof ChartType
*/
/**
* @param scrollToLastBar Whether the session change may move the view.
*/
TradingSessionHoursCheck(scrollToLastBar?: boolean): void;
/**
* Returns chart type specified data row marker.
*
* @return Chart type specified data row marker.
*/
protected chartTypeDataRowMarker(): string;
protected onChartChanging(): void;
/**
* Creates plot used to display chart type.
*
* @return The plot used to display chart type.
*/
protected abstract createPlot(): Plot;
/**
* Updates plot parameters.
*/
protected abstract updatePlot(): void;
/**
* Calculates ATR value for specified period.
*
* @param period The period.
* @return Calculated ATR value.
*/
protected atrValue(period: number): number;
/**
* Calculates percentage value for the previous close price.
*
* @param percent The percentage.
* @return Percentage value for the previous close price.
*/
protected percentageValue(percent: number): number;
/**
* Returns predefined traditional value based on previous close price.
*
* @return Predefined traditional value based on previous close price.
*/
protected traditionalValue(): number;
/**
* Removes chart type specified data rows.
*/
private removeDataRows;
}
}
declare module FintaChart {
/**
* Represents abstract chart type with specified options.
*
* @template TOptions The class of chart type options.
* @category Chart types
*/
abstract class ChartType extends ChartTypeBase {
/**
* Chart type options.
*/
private _options;
/**
* The chart type options.
*/
protected get options(): TOptions;
get stretchPricingLines(): boolean;
set stretchPricingLines(value: boolean);
get showPricingLines(): boolean;
set showPricingLines(value: boolean);
/**
* Initializes a new instance of the [[ChartType]] class.
*/
constructor(config?: IChartTypeConfig);
resetToDefaults(): void;
saveState(): IChartTypeState;
restoreState(state: IChartTypeState): void;
protected updatePlot(): void;
}
}
declare module FintaChart {
/**
* Represents factory of chart types.
*
* @category Chart types
*/
class ChartTypeFactory {
private static readonly _objFactory;
/**
* Gets known chart types.
*/
static get knownTypes(): IterableIterator;
/**
* Adds chart type to the factory.
*
* @param type The chart type.
*/
static add(type: typeof ChartTypeBase): void;
/**
* Creates new chart type instance of specified type name.
*
* @param typeName The type name of chart type.
* @return Chart type instance of given type.
*/
static create(typeName: string): IChartType;
/**
* Restores chart type from a previously saved state.
*
* @param state The saved chart type state.
* @return Chart type instance.
*/
static restore(state: IChartTypeState): IChartType;
}
}
declare module FintaChart {
}
declare module FintaChart {
/**
* @category Chart types
*/
abstract class VolumeBasedChartType extends ChartType {
apply(autoScale?: boolean): void;
dispose(): void;
}
}
declare module FintaChart {
/**
* Represents line chart type with filled bottom area.
*
* @category Chart types
*/
class AreaChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [bar](https://www.investopedia.com/terms/b/barchart.asp) chart type.
*
* @category Chart types
*/
class BarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [candlestick](https://www.investopedia.com/terms/c/candlestick.asp) chart type.
*
* @category Chart types
*/
class CandleChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [CandleVolume](https://school.stockcharts.com/doku.php?id=chart_analysis:candlevolume) type.
*
* @category Chart types
*/
class CandleVolumeChartType extends VolumeBasedChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [colored bar](https://www.investopedia.com/terms/b/barchart.asp) chart type.
*
* @category Chart types
*/
class ColoredBarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents colored high-low bar chart type.
*
* @category Chart types
*/
class ColoredHLBarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents colored high-low-close bar chart type.
*
* @category Chart types
*/
class ColoredHLCBarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [Equivolume](https://www.investopedia.com/terms/e/equivolume.asp) chart type.
*
* @category Chart types
*/
class EquiVolumeChartType extends VolumeBasedChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents model of Equi Volume Shadow chart type.
*
* @category Chart types
*/
class EquiVolumeShadowChartType extends VolumeBasedChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [Heikin Ashi](https://school.stockcharts.com/doku.php?id=chart_analysis:heikin_ashi) chart type.
*
* @category Chart types
*/
class HeikinAshiChartType extends ChartType {
static get type(): string;
get isTimeBased(): boolean;
protected createPlot(): Plot;
primaryDataRowMarker(rowMarker: string): string;
protected chartTypeDataRowMarker(): string;
refresh(): void;
}
}
declare module FintaChart {
/**
* Represents high-low bar chart type.
*
* @category Chart types
*/
class HLBarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents high-low-close bar chart type.
*
* @category Chart types
*/
class HLCBarChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Represents [hollow candle](
* https://stockcharts.com/articles/mailbag/2012/11/what-the-deal-with-these-colored-filled-and-hollow-candles.html)
* chart type.
*
* @category Chart types
*/
class HollowCandleChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Kagi reversal amount type.
*
* @category Chart types
*/
enum KagiReversalType {
/**
* The reversal amount based on Average True Range (ATR) value.
*/
ATR = "atr",
/**
* The reversal amount based on fixed value.
*/
FIXED = "fixed",
/**
* The reversal amount based on fixed number of points (tick size).
*/
POINTS = "points",
/**
* The reversal amount based on closing prices.
*/
TRADITIONAL = "traditional",
/**
* The reversal amount based on percentage of close price.
*/
PERCENTAGE = "percentage"
}
/**
* Describes Kagi reversal amount.
*
* @category Chart types
*/
interface IKagiReversalAmount {
/**
* The amount reversal type.
*/
name: KagiReversalType;
/**
* The amount reversal value.
*/
value: number;
}
/**
* Describes Kagi chart type configuration.
*
* @category Chart types
*/
interface IKagiChartTypeConfig extends IChartTypeConfig {
/**
* The Kagi chart type options.
*/
options?: IKagiChartTypeOptions;
}
/**
* Describes Kagi chart type defaults.
*
* @category Chart types
*/
interface IKagiChartTypeDefaults extends IChartTypeDefaults {
/**
* The reversal amount.
*/
reversal: IKagiReversalAmount;
}
/**
* Describes Kagi chart type options.
*
* @category Chart types
*/
interface IKagiChartTypeOptions extends IChartTypeOptions {
/**
* The reversal amount.
*/
reversal: IKagiReversalAmount;
}
/**
* Represents [Kagi](https://www.investopedia.com/terms/k/kagichart.asp) chart type.
*
* @category Chart types
*/
class KagiChartType extends ChartType {
static get type(): string;
static readonly defaults: IKagiChartTypeDefaults;
private _reversalValue;
get isTimeBased(): boolean;
/**
* The reversal amount.
*/
get reversal(): IKagiReversalAmount;
set reversal(value: IKagiReversalAmount);
/**
* The calculated reversal value.
*/
get reversalValue(): number;
/**
* Initializes a new instance of the [[KagiChartType]] class.
*
* @param config The Kagi chart type configuration.
*/
constructor(config?: IKagiChartTypeConfig);
protected createPlot(): Plot;
protected chartTypeDataRowMarker(): string;
refresh(): void;
private calculateReversalValue;
}
}
declare module FintaChart {
/**
* Represents [line](https://www.investopedia.com/terms/l/linechart.asp) chart type.
*
* @category Chart types
*/
class LineChartType extends ChartType {
static get type(): string;
protected createPlot(): Plot;
}
}
declare module FintaChart {
/**
* Describes line break chart type defaults.
*
* @category Chart types
*/
interface ILineBreakChartTypeDefaults extends IChartTypeDefaults {
/**
* The number of lines.
*/
lines: number;
}
/**
* Describes line break chart type configuration.
*
* @category Chart types
*/
interface ILineBreakChartTypeConfig extends IChartTypeConfig {
/**
* The line break chart type options.
*/
options?: ILineBreakChartTypeOptions;
}
/**
* Describes line break chart type options.
*
* @category Chart types
*/
interface ILineBreakChartTypeOptions extends IChartTypeOptions {
/**
* The number of lines.
*/
lines?: number;
}
/**
* Represents [line break](https://school.stockcharts.com/doku.php?id=chart_analysis:three_line_break) chart type.
*
* @category Chart types
*/
class LineBreakChartType extends ChartType {
static get type(): string;
static readonly defaults: ILineBreakChartTypeDefaults;
get isTimeBased(): boolean;
/**
* The number of lines.
*/
get lines(): number;
set lines(value: number);
/**
* Initializes a new instance of the [[LineBreakChartType]] class.
*
* @param config The line break chart type configuration.
*/
constructor(config?: ILineBreakChartTypeConfig);
protected createPlot(): Plot;
protected chartTypeDataRowMarker(): string;
refresh(): void;
}
}
declare module FintaChart {
/**
* The type of Point and Figure box size.
*
* @category Chart types
*/
enum PointAndFigureBoxSizeType {
/**
* The box size based on Average True Range (ATR) value.
*/
ATR = "atr",
/**
* The box size based on fixed value.
*/
FIXED = "fixed",
/**
* The box size based on fixed number of points (tick size).
*/
POINTS = "points",
/**
* The box size based on closing prices.
*/
TRADITIONAL = "traditional",
/**
* The box size based on percentage of close price.
*/
PERCENTAGE = "percentage"
}
/**
* The source data row(s) to be used in Point and Figure calculation.
*
* @category Chart types
*/
enum PointAndFigureSource {
/**
* The close prices data row.
*/
CLOSE = "close",
/**
* The high/low prices data rows.
*/
HIGH_LOW = "highLow"
}
/**
* Describes Point and Figure box size.
*
* @category Chart types
*/
interface IPointAndFigureBoxSize {
/**
* The box size type.
*/
name: PointAndFigureBoxSizeType;
/**
* The box size value.
*/
value: number;
}
/**
* Describes Point and Figure chart type defaults.
*
* @category Chart types
*/
interface IPointAndFigureChartTypeDefaults extends IChartTypeDefaults {
/**
* The box size.
*/
boxSize: IPointAndFigureBoxSize;
/**
* The reversal amount.
*/
reversal: number;
/**
* The source data row(s).
*/
source: PointAndFigureSource;
/**
* The flag that indicates whether month changes should be visible.
*/
showMonth: boolean;
/**
* The flag that indicates whether signals should be visible.
*/
showSignals: boolean;
/**
* The flag that indicates whether trend lines should be visible.
*/
showTrend: boolean;
/**
* The flag that indicates whether grid should be visible.
*/
applyGrid: boolean;
}
/**
* Describes Point and Figure chart type configuration.
*
* @category Chart types
*/
interface IPointAndFigureChartTypeConfig extends IChartTypeConfig {
/**
* The Point and Figure chart type options.
*/
options?: IPointAndFigureChartTypeOptions;
}
/**
* Describes Point and Figure chart type options.
*
* @category Chart types
*/
interface IPointAndFigureChartTypeOptions extends IChartTypeOptions {
/**
* The box size.
*/
boxSize?: IPointAndFigureBoxSize;
/**
* The reversal amount.
*/
reversal?: number;
/**
* The source data rows.
*/
source?: PointAndFigureSource;
/**
* The flag that indicates whether month changes should be visible.
*/
showMonth?: boolean;
/**
* The flag that indicates whether trend lines should be visible.
*/
showSignals?: boolean;
/**
* The flag that indicates whether trend lines should be visible.
*/
showTrend?: boolean;
/**
* The flag that indicates whether grid should be visible.
*/
applyGrid?: boolean;
}
/**
* Represents [Point and Figure (P&F)](https://www.investopedia.com/terms/p/pointandfigurechart.asp) chart type.
*
* @category Chart types
*/
class PointAndFigureChartType extends ChartType {
static get type(): string;
static readonly defaults: IPointAndFigureChartTypeDefaults;
private _boxSizeValue;
private _prevVerticalAdapter;
private _prevHorizontalAdapter;
get isTimeBased(): boolean;
/**
* The box size.
*/
get boxSize(): IPointAndFigureBoxSize;
set boxSize(value: IPointAndFigureBoxSize);
/**
* The calculated box size value.
*/
get boxSizeValue(): number;
/**
* The reversal amount.
*/
get reversal(): number;
set reversal(value: number);
/**
* The source data row(s).
*/
get source(): PointAndFigureSource;
set source(value: PointAndFigureSource);
/**
* The flag that indicates whether trend lines should be visible.
*/
get showSignals(): boolean;
set showSignals(value: boolean);
/**
* The flag that indicates whether month changes should be visible.
*/
get showMonth(): boolean;
set showMonth(value: boolean);
/**
* The flag that indicates whether trend lines should be visible.
*/
get showTrend(): boolean;
set showTrend(value: boolean);
/**
* The flag that indicates whether grid should be visible.
*/
get applyGrid(): boolean;
set applyGrid(value: boolean);
/**
* Initializes a new instance of the [[PointAndFigureChartType]] class.
*/
constructor(config?: IPointAndFigureChartTypeConfig);
protected createPlot(): Plot;
protected chartTypeDataRowMarker(): string;
refresh(): void;
dispose(): void;
private calculateBoxSizeValue;
}
}
declare module FintaChart {
/**
* The type of range bar chart type range.
*
* @category Chart types
*/
enum RangeBarRangeType {
/**
* The range based on fixed value.
*/
FIXED = "fixed",
/**
* The range based on Average True Range (ATR) value.
*/
ATR = "atr",
/**
* The range based on fixed number of points (tick size).
*/
POINTS = "points",
/**
* The range based on closing prices.
*/
TRADITIONAL = "traditional",
/**
* The range based on percentage of close price.
*/
PERCENTAGE = "percentage"
}
/**
* Describes the size of range bar.
*
* @category Chart types
*/
interface IRangeBarSize {
/**
* The range type.
*/
name: RangeBarRangeType;
/**
* The range value.
*/
value: number;
}
/**
* Describes range bar chart type defaults.
*
* @category Chart types
*/
interface IRangeBarChartTypeDefaults extends IChartTypeDefaults {
/**
* The range size.
*/
range: IRangeBarSize;
}
/**
* Describes range bar chart type configuration.
*
* @category Chart types
*/
interface IChartTypeRangeBarConfig extends IChartTypeConfig {
/**
* The chart type options.
*/
options?: IRangeBarChartTypeOptions;
}
/**
* Describes range chart type options.
*
* @category Chart types
*/
interface IRangeBarChartTypeOptions extends IChartTypeOptions {
/**
* The range size.
*/
range?: IRangeBarSize;
}
/**
* Represents range bar chart type.
*
* @category Chart types
*/
class RangeBarChartType extends ChartType {
static get type(): string;
static readonly defaults: IRangeBarChartTypeDefaults;
private _rangeValue;
/**
* Initializes a new instance of the [[RangeBarChartType]] class.
*/
constructor(config?: IChartTypeRangeBarConfig);
get isTimeBased(): boolean;
/**
* The range size.
*/
get range(): IRangeBarSize;
set range(value: IRangeBarSize);
/**
* The calculated range size.
*/
get rangeValue(): number;
protected createPlot(): Plot;
protected chartTypeDataRowMarker(): string;
refresh(): void;
private calculateRangeValue;
}
}
declare module FintaChart {
/**
* The type of the renko box size.
*
* @category Chart types
*/
enum RenkoBoxSizeType {
/**
* The box size based on fixed value.
*/
FIXED = "fixed",
/**
* The box size based on Average True Range (ATR) value.
*/
ATR = "atr",
/**
* The box size based on fixed number of points (tick size).
*/
POINTS = "points",
/**
* The box size based on closing prices.
*/
TRADITIONAL = "traditional",
/**
* The box size based on percentage of close price.
*/
PERCENTAGE = "percentage"
}
/**
* Describes Renko box size type.
*
* @category Chart types
*/
interface IRenkoBoxSize {
/**
* The box size type.
*/
name: RenkoBoxSizeType;
/**
* The box size value.
*/
value: number;
}
/**
* Describes Renko chart type defaults.
*
* @category Chart types
*/
interface IRenkoChartTypeDefaults extends IChartTypeDefaults {
/**
* The box size.
*/
boxSize: IRenkoBoxSize;
}
/**
* Describes Renko chart type configuration.
*
* @category Chart types
*/
interface IRenkoChartTypeConfig extends IChartTypeConfig {
/**
* The configuration options.
*/
options?: IRenkoChartTypeOptions;
}
/**
* Describes Renko chart type options.
*
* @category Chart types
*/
interface IRenkoChartTypeOptions extends IChartTypeOptions {
/**
* The box size.
*/
boxSize?: IRenkoBoxSize;
}
/**
* Describes Renko chart type state.
*
* @category Chart types
*/
interface IRenkoChartTypeState extends IChartTypeState {
/**
* The options.
*/
options: IRenkoChartTypeOptions;
}
/**
* Represents [renko](https://www.investopedia.com/terms/r/renkochart.asp) chart type.
*
* @category Chart types
*/
class RenkoChartType extends ChartType {
static get type(): string;
static readonly defaults: IRenkoChartTypeDefaults;
private _boxSizeValue;
/**
* Initializes a new instance of [[RenkoChartType]] class.
*/
constructor(config?: IRenkoChartTypeConfig);
get isTimeBased(): boolean;
/**
* The box size.
*/
get boxSize(): IRenkoBoxSize;
set boxSize(value: IRenkoBoxSize);
/**
* The calculated box size value.
*/
get boxSizeValue(): number;
protected createPlot(): Plot;
protected chartTypeDataRowMarker(): string;
refresh(): void;
private calculateBoxSizeValue;
}
}
declare module FintaChart {
/**
* Describes chart type handler.
*
* @category Chart types
*/
interface IChartTypeHandler extends IChartComponent {
/**
* The flag that indicates whether the handler is enabled.
*/
enabled: boolean;
/**
* Refreshes chart type.
*/
refresh(): void;
}
/**
* Represents handler to switch between chart types according to the column width.
*
* @category Chart types
*/
class AutoSwitchChartTypeHandler extends ChartComponent implements IChartTypeHandler {
enabled: boolean;
refresh(): void;
}
}
declare module FintaChart {
/**
* Represents Cross Hair State
*/
interface ICrossHairState {
/**
* Cross Hair State's cross hair type
*/
type: string;
/**
* Cross Hair State's show bar offset
*/
showBarOffset?: boolean;
}
/**
* Represents Cross Hair Config
*/
interface ICrossHairConfig extends IChartComponentConfig {
/**
* Cross Hair Config cross hair type
*/
type?: string;
/**
* Cross Hair Config show bar offset
*/
showBarOffset?: boolean;
}
enum CrossHairType {
NONE = "none",
LABELS = "labels",
CROSS = "cross",
CROSS_BARS = "crossBars",
DOT = "dot"
}
/**
* Provides model of Cross Hair
*/
class CrossHair extends ChartComponent implements IVisualComponent, IStateable {
private _isDragging;
private _options;
/**
* Cross Hair's component
*/
component: CrossHairComponent;
/**
* Is show Cross Hair's replay mode line
*/
showReplayModeLine: boolean;
/**
* Is Cross Hair visible
*/
visible: boolean;
/**
* Get Cross Hair's type
*/
get type(): string;
/**
* Set Cross Hair's type
*/
set type(type: string);
/**
* Get Cross Hair's show bar offset
*/
get showBarOffset(): boolean;
/**
* Set Cross Hair's show bar offset
*/
set showBarOffset(value: boolean);
/**
* Creates an instance of CrossHair.
*
* @param config
*/
constructor(config: ICrossHairConfig);
saveState(): ICrossHairState;
restoreState(state: ICrossHairState): void;
/**
* Setups Cross Hair's layout theme
*/
applyTheme(): void;
dispose(): void;
/**
* Handles Cross Hair's motion event mouse hover
*
* @param motionEvent
* @param event
*/
handleMotionEventMouseHover(motionEvent: MotionEvent, event: IWindowEvent): void;
/**
* Shows Cross Hair
*/
show(): void;
/**
* Hides Cross Hair
*/
hide(): void;
/**
* Initializes Cross Hair's visual dimensions
*/
resize(): void;
/**
* Moves Cross Hair's point to
*
* @param point
* @param optimize
*/
moveTo(point: IPoint, optimize?: boolean): void;
/**
* Refreshes Cross Hair
*/
refresh(): void;
protected subscribe(): void;
protected unsubscribe(): void;
}
}
declare module FintaChart {
/**
* Provides model of Cross Hair Component
*
*/
class CrossHairComponent extends HtmlComponent {
private _controls;
private _crossHair;
private _position;
private _optimization;
private _prevPosition;
private _labelValue;
/**
* Get cross hair component's chart
*/
get chart(): Chart;
/**
* Creates an instance of CrossHairComponent.
*
* @param crossHair
*/
constructor(crossHair?: CrossHair);
protected createContainer(): HTMLElement;
applyTheme(): void;
resize(): void;
refresh(): void;
/**
* Moves point
*
* @param point
* @param optimize
* @param stopMagnet
*/
moveTo(point: IPoint, optimize?: boolean, stopMagnet?: boolean): void;
/**
* Updates cross hair component's floating labels
*/
updateLabels(): void;
/**
* Updates cross hair component's update location
*
* @param force
* @param stopMagnet
*/
updateLocation(force?: boolean, stopMagnet?: boolean): void;
/**
* Updates cross hair component's visibility
*
* @param isVisible
*/
updateVisibility(isVisible?: boolean): void;
private static applyLabelTheme;
private static updateHorizontalLabelMetrics;
private static updateVerticalLabelMetrics;
private createControls;
private createHorizontalAxisLabel;
private createVerticalAxisLabel;
private createTradingButton;
private syncVerticalAxesLabels;
private updateHorizontalAxisLabel;
private updateVerticalAxisLabel;
private updateTradingButton;
}
}
declare module FintaChart {
/**
* Describes hotkeys settings dialog.
*/
interface IHotkeysSettingsConfig extends IDialogConfig {
/**
* The hotkeys handler.
*/
handler: IHotkeysHandler;
}
/**
* Provides model of Keyboard Settings
*/
class HotkeysSettings {
private _handler;
private _container;
private _newCombinationList;
private _chart;
/**
* Creates an instance of HotkeysSettings.
*
* @param container
*/
constructor(container: HTMLElement);
/**
* Get Keyboard Setting's container
*/
set container(container: HTMLElement);
/**
* Initializes Keyboard Settings
*
* @param config
*/
init(config: IHotkeysSettingsConfig): void;
/**
* Saves new Keyboard Setting
*/
saveNewSetting(): void;
/**
* Set default Keyboard Setting
*/
resetToDefaults(): void;
private _keydownHandler;
/**
* Subscribes
*/
subscribe(): void;
/**
* Unsubscribes
*/
unsubscribe(): void;
private onKey;
private createTemplate;
}
}
declare module FintaChart {
const Key: {
SHIFT: number;
CTRL: number;
ALT: number;
ESC: number;
};
/** Minimal event shape needed by hotkey matching. */
interface IKeyLike {
ctrlKey?: boolean;
metaKey?: boolean;
altKey?: boolean;
shiftKey?: boolean;
keyCode?: number;
type: string;
}
/**
* Describes all the actions to hotkeys in the chart.
* Also lead to description translations
*/
enum ChartHotkeyType {
OpenQuickSearch = "OpenQuickSearch",
OpenIndicators = "OpenIndicators",
Redo = "Redo",
Undo = "Undo",
InstrumentSearch = "InstrumentSearch",
InstrumentSearchHide = "InstrumentSearchHide",
ArrowLeft = "ArrowLeft",
ArrowRight = "ArrowRight",
MoveChartLeftRight = "MoveChartLeftRight",
ZoomIn = "ZoomIn",
ZoomOut = "ZoomOut",
MoveFurtherLeft = "MoveFurtherLeft",
MoveFurtherRight = "MoveFurtherRight",
ToggleMaximizePane = "ToggleMaximizePane",
ToggleCollapsePane = "ToggleCollapsePane",
TakeSnapshot = "TakeSnapshot",
ToggleLogarithmicScale = "ToggleLogarithmicScale",
TogglePercentScale = "TogglePercentScale",
EnableMeasureTool = "EnableMeasureTool",
MoveSelectedDrawingUp = "MoveSelectedDrawingUp",
MoveSelectedDrawingDown = "MoveSelectedDrawingDown",
DrawTrendLine = "DrawTrendLine",
DrawHorizontalLine = "DrawHorizontalLine",
DrawVerticalLine = "DrawVerticalLine",
DrawCrossLine = "DrawCrossLine",
DrawFibRetracement = "DrawFibRetracement",
DrawRectangle = "DrawRectangle",
DrawSquare = "DrawSquare",
DrawCircle = "DrawCircle",
GoToDate = "GoToDate",
StartKeyboardNavigation = "StartKeyboardNavigation",
PartiallyEraseDraw = "PartiallyEraseDraw",
EnableGannBoxFixedIncrements = "EnableGannBoxFixedIncrements",
HideAllDrawings = "HideAllDrawings",
MoveDrawingHorizontallyVertically = "MoveDrawingHorizontallyVertically",
DeleteObject = "DeleteObject",
CopyObject = "CopyObject",
PasteObject = "PasteObject",
TimeframeChange = "TimeframeChange",
MaximizeChart = "MaximizeChart"
}
const chartHotkeyTranslationRootKey = "hotKey.combinationsCommands";
/**
* Describes hotkey.
*/
interface HotkeyCombination {
/**
* The unique hotkey identifier.
*/
id: HotkeyActionType;
/**
* The hotkey combinations.
*/
combinations: string[];
/**
* The hotkey code combinations.
*/
codeCombinations: string[];
/**
* The hotkey description.
*/
description: string;
/**
* Defines if the hotkey is disabled.
*/
disabled?: boolean;
/**
* Defines if the hotkey is optional and can be disabled.
*/
optional?: boolean;
/**
* Processes current hotkey.
*
* @param chart The chart.
* @param event
*/
action?(chart: Chart, event?: KeyboardEvent): void;
}
interface IHotkeysHandler extends IChartComponent, IStateable {
/**
* Adds new hotkey combination.
*
* @param hotkey
* @return
*/
add(hotkey: HotkeyCombination): boolean;
/**
* Resets to default hotkeys combinations.
*/
resetToDefaults(): void;
/**
* Returns all hotkey combinations.
*
* @return A list of hotkey combinations.
*/
all(): HotkeyCombination[];
/**
* Returns hotkey combination by id.
*
* @return Hotkey combination for a given id.
* @param type
*/
findById(type: ChartHotkeyType): HotkeyCombination;
/**
* Handles event and executes hotkey action that matches it.
*
* @param event
*/
onEvent(event: KeyboardEvent): void;
}
/**
* Represents hotkeys handler.
*/
class HotkeysHandler extends ChartComponent implements IHotkeysHandler {
lastEvent: IKeyLike;
lastEventTime: number;
private _hotkeys;
private _boundOnEvent;
private readonly _eventDelay;
/**
* Creates an instance of [[HotkeysHandler]].
*
* @param config The configuration.
*/
constructor(config: IChartComponentConfig);
onEvent(event: KeyboardEvent): void;
isEventSimultaneous(event: IKeyLike): boolean;
resetToDefaults(): void;
all(): HotkeyCombination[];
findById(id: ChartHotkeyType): HotkeyCombination;
add(hotkey: HotkeyCombination): boolean;
saveState(): HotkeyCombination[];
restoreState(state: HotkeyCombination[]): void;
static eventMatchHotkey(hotkey: HotkeyCombination, event: IKeyLike): boolean;
static getEventCodeCombination(event: IKeyLike): string;
static onCopySnapshotToClipboard(chart: Chart): void;
static onTogglePercentScale(chart: Chart): void;
static onMoveFurtherLeft(chart: Chart): void;
static onMoveFurtherRight(chart: Chart): void;
static onArrowRight(chart: Chart): void;
static onArrowLeft(chart: Chart): void;
static onVerticalLine(chart: Chart): void;
static onHorizontalLine(chart: Chart): void;
static onTrendLine(chart: Chart): void;
static onFibonacci(chart: Chart): void;
static onZoomIn(chart: Chart): void;
static onZoomOut(chart: Chart): void;
static onCopy(chart: Chart): void;
static onPaste(chart: Chart): void;
static onDelete(chart: Chart): void;
static onUndo(chart: Chart): void;
static onRedo(chart: Chart): void;
static onTimeFrameChange(chart: Chart, event: KeyboardEvent): void;
static onInstrumentChange(chart: Chart, event: KeyboardEvent): void;
static onHideInstrumentChange(chart: Chart): void;
static onOpenIndicators(chart: Chart): void;
static onToggleLogarithmicScale(chart: Chart): void;
static onHideAllDrawings(chart: Chart): void;
static onDrawRectangle(chart: Chart): void;
static onMaximizeChart(chart: Chart): void;
static onToggleCollapsePane(chart: Chart): void;
static onMoveSelectedDrawingUp(chart: Chart): void;
static onMoveSelectedDrawingDown(chart: Chart): void;
protected subscribe(): void;
protected unsubscribe(): void;
private init;
private handleEvent;
private executeAction;
private mapActionsToHotkeys;
}
const defaultChartHotkeys: HotkeyCombination[];
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
*
*/
enum MoonPhaseType {
NewMoon = 0,
FirstMoon = 1,
FullMoon = 2,
LastMoon = 3
}
}
declare module FintaChart {
/**
* Represents abstract indicator command.
*/
abstract class IndicatorCommand extends Command {
/**
* The indicator.
*/
protected readonly indicator: Indicator;
/**
* The indicator name.
*/
protected readonly indicatorName: string;
/**
* Initializes a new instance of [[IndicatorCommand] class.
*/
constructor(executor: Chart, indicator: Indicator);
}
}
declare module FintaChart {
/**
* Represents command to add concrete indicator.
*/
class AddIndicatorCommand extends IndicatorCommand {
execute(): void;
rollback(): void;
}
}
declare module FintaChart {
/**
* Represents command to delete all indicators.
*/
class DeleteIndicatorsCommand extends Command {
/**
* The list of indicators.
*/
private readonly _indicators;
/**
* Initializes new instance of [[DeleteIndicatorsCommand]] class.
*
* @param chart The chart.
* @param indicators The list of indicators to delete.
*/
constructor(chart: Chart, indicators: Indicator[]);
execute(): void;
rollback(): void;
}
}
declare module FintaChart {
/**
* Represents command to delete concrete indicator.
*/
class DeleteIndicatorCommand extends IndicatorCommand {
/**
* The flag that indicates whether pane should be deleted if there are no indicators on it.
*/
private readonly _removePaneIfNoIndicators;
/**
* Initializes new instance of [[DeleteIndicatorCommand]] class.
*
* @param chart The chart.
* @param indicator The indicator to delete.
* @param removePaneIfNoIndicators The flag that indicates whether pane should be deleted
* if there are no indicators on it.
*/
constructor(chart: Chart, indicator: Indicator, removePaneIfNoIndicators: boolean);
execute(): void;
rollback(): void;
}
}
declare module FintaChart {
/**
* Represents command to merge indicators.
*/
class MergeIndicatorsCommand extends Command {
private readonly _indicator1;
private readonly _indicator2;
private _indicatorTmp;
/**
* Initializes new instance of [[MergeIndicatorsCommand] class.
*
* @param chart The chart.
* @param indicator1 The first indicator.
* @param indicator2 The second indicator.
*/
constructor(chart: Chart, indicator1: Indicator, indicator2: Indicator);
execute(): void;
rollback(): void;
}
}
declare module FintaChart {
/**
* Represents command to update indicator.
*/
class UpdateIndicatorCommand extends IndicatorCommand {
/**
* The new changes (parameters, properties, ...).
*/
private readonly _newChanges;
/**
* The old changes (parameters, properties, ...).
*/
private readonly _oldChanges;
/**
* Initializes new instance of [[UpdateIndicatorCommand]] class.
*
* @param chart The chart.
* @param indicator The indicator.
* @param parameterChanges
* @param propertyChanges
*/
constructor(chart: Chart, indicator: Indicator, parameterChanges: PropertyChangeEvent[], propertyChanges?: PropertyChangeEvent[]);
execute(): void;
rollback(): void;
}
}
declare module FintaChart {
/**
* Provides model of Data Aggregator
*/
abstract class DataAggregator {
private _currentBar;
private _indicatorDataRowsInput;
private _isFirstTickOfBar;
private _isInUpdate;
private _prevBar;
protected _pane: Pane | null;
protected _chart: Chart;
/**
* Is Data Aggregator initialized
*/
initialized: boolean;
/**
* Data Aggregator children indicator
*/
childrenIndicator: Indicator;
/**
* Data Aggregator parent data aggregator
*/
parentDataAggregator: DataAggregator;
/**
* Data Aggregator chart
*/
get chart(): Chart;
/**
* Get Data Aggregator close
*/
get close(): IndicatorDataRows;
/**
* Set Data Aggregator current bar
*/
set currentBar(value: number);
/**
* Get Data Aggregator current bar
*/
get currentBar(): number;
/**
* Get Data Aggregator date
*/
get date(): IndicatorDataRows;
/**
* Get Data Aggregator high
*/
get high(): IndicatorDataRows;
/**
* Set Data Aggregator indicator data rows input
*/
set indicatorDataRowsInput(value: IndicatorDataRowsInput);
/**
* Get Data Aggregator indicator data rows input
*/
get indicatorDataRowsInput(): IndicatorDataRowsInput;
/**
* Get Data Aggregator input
*/
get input(): IndicatorDataRows;
/**
* Get Data Aggregator input 2
*/
get input2(): IndicatorDataRows;
/**
* Get Data Aggregator inputs
*/
get inputs(): DataRowsCollection;
/**
* Get is Data Aggregator first tick of bar
*/
get firstTickOfBar(): boolean;
/**
* Set is Data Aggregator first tick of bar
*/
set firstTickOfBar(value: boolean);
/**
* Get Data Aggregator low
*/
get low(): IndicatorDataRows;
/**
* Get Data Aggregator median
*/
get median(): IndicatorDataRows;
/**
* Get Data Aggregator open
*/
get open(): IndicatorDataRows;
/**
* Get Data Aggregator typical
*/
get typical(): IndicatorDataRows;
/**
* Get Data Aggregator volume
*/
get volume(): IndicatorDataRows;
/**
* Get Data Aggregator weighted
*/
get weighted(): IndicatorDataRows;
/**
* Retrieves is Data Aggregator input equals
*
* @param input
* @return Is Data Aggregator input equals
*/
equalInput(input: IndicatorDataRows): boolean;
/**
* Retrieves Data Aggregator average
*
* @param dataRows
* @param lookBackPeriod
* @return Data Aggregator average
*/
getAverage(dataRows: IndicatorDataRows, lookBackPeriod: number): number;
/** Checks finite valid number */
isValidNumber(value: unknown): boolean;
/** Last valid value at bars ago */
lastValidInput(dataRows: IndicatorDataRows, fromBarsAgo: number): number;
/**
* Callback is new tick to update indicator calculations
*/
protected onInputTick(record?: number): void;
/**
* Callback to initialize indicator
*/
protected onInitializeIndicator(): void;
/**
* Callback to reset indicator settings to default state
*/
protected onResetDefaults(): void;
/**
* Initializes Data Aggregator indicator
*/
initializeIndicator(): void;
/**
* Refreshes Data Aggregator indicator
*
* @property {number} record
* @return Is Data Aggregator indicator refreshed
*/
refreshIndicator(record?: number): boolean;
private canUpdate;
}
}
declare module FintaChart {
/**
* Describes collection of indicator data rows.
*/
class DataRowsCollection {
private readonly _dataRowsArray;
/**
* Creates an instance of DataRowsCollection.
*
* @param dataRows The source data rows.
*/
constructor(...dataRows: IndicatorDataRows[]);
/**
* Gets data rows array.
*/
get dataRowsArray(): IndicatorDataRows[];
/**
* Gets records count in a data row.
*/
get recordsCount(): number;
/**
* Adds one or more data rows.
*
* @param dataRows The data rows to add.
*/
add(...dataRows: IndicatorDataRows[]): void;
/**
* Returns data row by name.
*
* @param name The data row name.
* @return Data row.
*/
get(name: string): IndicatorDataRows;
/**
* Returns data row by index.
*
* @param index The data row index.
* @return Data row.
*/
get(index: number): IndicatorDataRows;
/**
* Finds data row index by name.
*
* @param name The data row name.
* @return Data row index or -1 if not found.
*/
indexOf(name: string): number;
/**
* Removes data rows by names
*
* @param names Data row names to remove.
*/
remove(...names: string[]): void;
}
}
declare module FintaChart {
/**
* Provides model of Data Rows Indicator Extended
*/
class ExtendedBarDataRows {
private readonly _barDataRows;
private readonly _chart;
private _median;
private _typical;
private _weighted;
/**
* Creates an instance of ExtendedBarDataRows.
*
* @param chart
* @param barDataRows
*/
constructor(chart: Chart, barDataRows: IBarDataRows);
/**
* Get Data Rows Indicator Extended median
*/
get median(): DataRows;
/**
* Get Data Rows Indicator Extended typical
*/
get typical(): DataRows;
/**
* Get Data Rows Indicator Extended weighted
*/
get weighted(): DataRows;
private calculateMedian;
private calculateTypical;
private calculateWeighted;
}
}
declare module FintaChart {
const INDICATOR_NULL_VALUE: number;
/**
* Provides model of indicator data rows.
*/
class IndicatorDataRows extends DataRows {
/**
* Converts data rows into indicator data rows.
*
* @param dataRows The input data rows.
* @param name The data rows name.
* @return Indicator data rows with values from specified data rows.
*/
static fromDataRows(dataRows: DataRows, name?: string): IndicatorDataRows;
private _dataAggregator;
/**
* Creates an instance of IndicatorDataRows.
*
* @param name The data rows name.
* @param indicator The input indicator.
*/
constructor(name?: string, indicator?: Indicator);
/**
* Creates an instance of IndicatorDataRows.
*
* @param name The data rows name.
* @param recordsCount The number of records.
*/
constructor(name?: string, recordsCount?: number);
/**
* The data aggregator.
*/
get dataAggregator(): DataAggregator;
set dataAggregator(data: DataAggregator);
/**
* Fills data row with specified value.
*
* @param startIndex The starting index.
* @param count The number of values to fill.
* @param value The fill value.
*/
fill(startIndex: number, count: number, value: number): void;
/**
* Resets data row.
*
* @param recordsCount The new number of records.
*/
reset(recordsCount: number): void;
/**
* Returns data row value at the specified position from the end.
*
* @param barsAgo The value position from the end.
* @return The data row value at the given position from the end.
*/
get(barsAgo: number): number;
/**
* Returns data row value at specified index.
*
* @param index The index of value.
* @param value The value to set.
* @return Data row value at a given index.
*/
value(index: number, value?: number): number;
/**
* Updates last value.
*
* @param value The value.
*/
set(value: number): void;
/**
* Updates value at specified position from the end.
*
* @param barsAgo The position from the end.
* @param value The value.
*/
setValue(barsAgo: number, value: number): void;
/**
* Extracts data rows starting at specified index.
*
* @param startIndex The starting index.
* @return A new data rows with values starting at a given index in the current data rows.
*/
toDataRows(startIndex: number): IndicatorDataRows;
private getIndex;
}
}
declare module FintaChart {
/**
* The names of input data rows.
*/
enum InputDataRowName {
/**
* Date data row name.
*/
DATE = ".date",
/**
* Close price data row name.
*/
CLOSE = ".close",
/**
* Volume data row name.
*/
VOLUME = ".volume",
/**
* HIGH price data row name.
*/
HIGH = ".high",
/**
* LOW price data row name.
*/
LOW = ".low",
/**
* Open price data row name.
*/
OPEN = ".open",
/**
* Weighted price data row name.
*/
WEIGHTED = ".weighted",
/**
* Median price data row name.
*/
MEDIAN = ".median",
/**
* Typical price data row name.
*/
TYPICAL = ".typical"
}
/**
* Provides model of indicator input data row.
*/
class IndicatorDataRowsInput {
private readonly _chart;
private readonly _indicator;
private _dataRowsIndicatorExtended;
private _name;
private _instrument;
private _timeFrame;
private _recordsCount;
private _input;
private _input2;
private _inputs;
private _barDataRows;
private _date;
private _open;
private _high;
private _low;
private _close;
private _volume;
private _median;
private _typical;
private _weighted;
/**
* Creates an instance of IndicatorDataRowsInput.
*
* @param indicator The indicator
* @param barDataRows The bar data rows.
*/
constructor(indicator: Indicator, barDataRows: IBarDataRows);
/**
* The name.
*/
get name(): string;
set name(value: string);
/**
* The instrument.
*/
get instrument(): IInstrument;
set instrument(instrument: IInstrument);
/**
* The time frame.
*/
get timeFrame(): ITimeFrame;
set timeFrame(timeFrame: ITimeFrame);
/**
* The number of records.
*/
get recordsCount(): number;
set recordsCount(value: number);
/**
* The input data rows.
*/
get input(): IndicatorDataRows;
set input(input: IndicatorDataRows);
/**
* The first additional input data rows.
*/
get input2(): IndicatorDataRows;
set input2(input: IndicatorDataRows);
/**
* The input data rows collection.
*/
get inputs(): DataRowsCollection;
set inputs(inputs: DataRowsCollection);
/**
* The bar data rows.
*/
get barDataRows(): IBarDataRows;
set barDataRows(bars: IBarDataRows);
/**
* The date data rows.
*/
set date(dataRows: IndicatorDataRows);
get date(): IndicatorDataRows;
/**
* The open price data row.
*/
get open(): IndicatorDataRows;
set open(dataRows: IndicatorDataRows);
/**
* The high price data rows.
*/
get high(): IndicatorDataRows;
set high(dataRows: IndicatorDataRows);
/**
* The low price data row.
*/
get low(): IndicatorDataRows;
set low(dataRows: IndicatorDataRows);
/**
* The close price data rows.
*/
get close(): IndicatorDataRows;
set close(dataRows: IndicatorDataRows);
/**
* The volume data row.
*/
get volume(): IndicatorDataRows;
set volume(dataRows: IndicatorDataRows);
/**
* The median price data row.
*/
get median(): IndicatorDataRows;
set median(dataRows: IndicatorDataRows);
/**
* The typical price data row.
*/
get typical(): IndicatorDataRows;
set typical(dataRows: IndicatorDataRows);
/**
* The weighted price data row.
*/
get weighted(): IndicatorDataRows;
set weighted(dataRows: IndicatorDataRows);
private init;
private createDateDataRows;
private createOpenDataRows;
private createHighDataRows;
private createLowDataRows;
private createCloseDataRows;
private createVolumeDataRows;
private createMedianDataRows;
private createTypicalDataRows;
private createWeightedDataRows;
private createDataRows;
private createIndicatorDataRows;
private static getDataRowsName;
private getDataRows;
}
}
declare module FintaChart {
/**
* Adds access to cached indicators.
*
* @category Indicators
*/
abstract class IndicatorCache extends DataAggregator {
private _indicatorCaches;
/**
* Creates, if not already cached, and returns ADX indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached ADX indicator.
*/
ADX(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns CMO indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached CMO indicator
*/
CMO(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns EMA indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached EMA indicator.
*/
EMA(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Creates, if not already cached, and returns Encapsulation indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached Encapsulation indicator.
*/
Encapsulation(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Creates, if not already cached, and returns HMA indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached HMA indicator.
*/
HMA(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns HML indicator.
*
* @param input
* @param period The period.
* @return Cached HML indicator.
*/
HML(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns Linear Regression indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached Linear regression indicator.
*/
LinearRegression(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns Log Change indicator.
*
* @param input The input data rows.
* @return Cached Log Change indicator.
*/
LogChange(input: IndicatorDataRows): Indicator;
/**
* Creates, if not already cached, and returns MAXIMUM indicator.
*
* @param input
* @param period The period.
* @return Cached MAXIMUM indicator.
*/
MAXIMUM(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns MINIMUM indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached MINIMUM indicator.
*/
MINIMUM(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns ROC indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached ROC indicator.
*/
ROC(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns RSI indicator.
*
* @param input The input data rows.
* @param period The period.
* @param smooth The smoothing period.
* @return Cached RSI indicator.
*/
RSI(input: IndicatorDataRows, period: number, smooth: number): Indicator;
/**
* Creates, if not already cached, and returns Range indicator.
*
* @return Cached Range indicator.
*/
Range(): Indicator;
/**
* Creates, if not already cached, and returns SMA indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached SMA indicator.
*/
SMA(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Creates, if not already cached, and returns SUM indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached SUM indicator.
*/
SUM(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns StdDev indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached Std. Dev indicator.
*/
StdDev(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Creates, if not already cached, and returns Swing Index indicator.
*
* @param limitValue The limit value.
* @return Cached Swing Index indicator.
*/
SwingIndex(limitValue: number): Indicator;
/**
* Creates, if not already cached, and returns TEMA indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached TEMA indicator.
*/
TEMA(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns TMA indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached TMA indicator.
*/
TMA(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns TSF indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached TSF indicator.
*/
TSF(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns True Range indicator.
*
* @param input
* @param period The period.
* @return Cached True Range indicator.
*/
TrueRange(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns VIDYA indicator.
*
* @param input
* @param period The period.
* @return Cached VIDYA indicator.
*/
VIDYA(input?: Indicator | IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns VMA indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached VMA indicator.
*/
VMA(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Creates, if not already cached, and returns WMA indicator.
*
* @param input The input data rows.
* @param period The period.
* @return Cached WMA indicator.
*/
WMA(input?: IndicatorDataRows, period?: number): Indicator;
/**
* Creates, if not already cached, and returns WWS indicator.
*
* @param input The input indicator or data rows.
* @param period The period.
* @return Cached WWS indicator.
*/
WWS(input: Indicator | IndicatorDataRows, period: number): Indicator;
/**
* Returns cached indicator of specified type.
*
* @param callback The callback used to compare indicators in cache.
* @param type The indicator type to search.
* @return Indicator if found in the cache; otherwise, null.
*/
private getCachedIndicator;
/**
* Searches and initializes cached indicator of specified type.
*
* @param callback The callback used to compare indicators in cache.
* @param type The indicator type to search.
* @return Initialized indicator if found in the cache; otherwise, null.
*/
private getInitializedCachedIndicator;
/**
* Initializes and caches specified indicator.
*
* @param indicator The indicator.
* @param input The input indicator or data rows.
* @param period The period.
* @param smooth The smoothing period.
* @param limitValue The limit value.
* @return Initialized and cached indicator.
*/
private cacheIndicator;
}
}
declare module FintaChart {
interface IIndicatorTitleParameterItem {
parameterName: string;
value: any;
}
interface IUpdateIndicatorParameters {
[parameterName: string]: any;
}
interface IIndicatorParameterChanges {
[parameterName: string]: {
prevValue: any;
currentValue: any;
};
}
/**
* Represents abstract indicator.
*
* @category Indicators
*/
abstract class AbstractIndicator extends IndicatorCache {
private _period;
private _smooth;
private _limitValue;
private _displacement;
/**
* The name of the indicator.
*/
name: string;
/**
* Options value
*/
options: IIndicatorOptions;
/**
* Has input parameters
*/
hasInputParameters: boolean;
get period(): number;
set period(value: number);
get smooth(): number;
set smooth(value: number);
get limitValue(): number;
set limitValue(value: number);
get displacement(): number;
set displacement(value: number);
/**
* Get current indicator theme
*/
get plotTheme(): any;
/**
* Get levels theme
*/
get levelsTheme(): any;
/**
* Retrieve parameter value by name
*
* @param paramName
* @return Parameter value
*/
parameterValue(paramName: string): any;
/**
* Check if available parameter with specified name
*
* @param paramName
* @return
*/
containsParameter(paramName: string): boolean;
/**
* Update parameter value
*
* @param name
* @param value
*/
updateParameter(name: string, value: unknown): void;
updateParameters(updates: IUpdateIndicatorParameters): void;
getOrdinalParameterName(parameterName: string, index: number): string;
/**
* Refresh titles reflection
*/
refreshParameterTitles(): IIndicatorTitleParameterItem[];
/**
* Add or fill parameters
*
* @param aboveColor
* @param belowColor
*/
protected addFillParameters(aboveColor: string, belowColor: string): void;
/**
* Add line parameter
*
* @param index
* @param color
* @param width
* @param style
*/
protected addLineParameters(index: number, color: string, width: number, style: string): void;
/**
* Modify data rows values
*
* @param dataRows
* @return
*/
protected dataRowsPeriod(dataRows: IndicatorDataRows): IndicatorDataRows;
/**
* Retrieve line theme by number
*
* @param index
* @return
*/
protected lineTheme(index: number): any;
/**
* Set title text
*
* @param name
* @param container
*/
protected updateTitle(name: string, container: HTMLElement): Promise;
/**
* Set localization attribute
*
* @param container
* @param key
*/
protected updateTitleAttribute(container: HTMLElement, key: string): Promise;
/**
* Shift to the future data rows
*
* @param dataRows
* @param positionsCount
* @return Modified data rows
*/
protected shiftToFuture(dataRows: DataRows, positionsCount: number): DataRows;
/**
* Shift to the past data rows
*
* @param dataRows
* @param positionsCount
* @return Modified data rows
*/
protected shiftToPast(dataRows: DataRows, positionsCount: number): DataRows;
protected onParameterUpdated(changes: IIndicatorParameterChanges): void;
}
}
declare module FintaChart {
interface IRestrictedIndicatorsProvider {
restrictedIndicators(): string[];
}
enum IndicatorDataRowsName {
OPEN = "Open",
HIGH = "High",
LOW = "Low",
CLOSE = "Close",
VOLUME = "Volume",
MEDIAN = "Median",
TYPICAL = "Typical",
WEIGHTED = "Weighted",
DATE = "Date"
}
namespace IndicatorEvent {
const SELECTED_CHANGED = "indicatorSelectedValueChanged";
const HOVERED_CHANGED = "indicatorHoveredValueChanged";
const SHOWED_CONTEXT_MENU = "indicatorShowedContextMenu";
const SELECTABLE_CHANGED = "indicatorSelectableValueChanged";
const HOVERABLE_CHANGED = "indicatorHoverableValueChanged";
}
/**
* Represents indicator configuration
*/
interface IIndicatorConfig {
/**
* Allow reflection of settings dialog state
*/
allowSettingsDialog?: boolean;
/**
* Apply indicator value
*/
applyIndicator?: boolean;
/**
* Chart instance value
*/
chart?: Chart;
/**
* Colored volume theme value
*/
coloredVolumeTheme?: any;
/**
* Enable labels for vertical scale state
*/
enableVerticalAxisLabels?: boolean;
/**
* Support hover state
*/
hoverable?: boolean;
/**
* Identifies if indicator is custom
*/
customIndicator?: boolean;
/**
* MA period value
*/
maPeriod?: number;
/**
* Pane height ratio value
*/
paneHeightRatio?: number;
/**
* Pane index value
*/
paneIndex?: number;
/**
* Parameters value
*/
parameters?: object;
/**
* Periods value
*/
periods?: number;
/**
* ROC period value
*/
rocPeriod?: number;
/**
* Scale vertical index value
*/
verticalScaleIndex?: number;
/**
* Selectable state
*/
selectable?: boolean;
/**
* Show parameters in title state
*/
showParamsInTitle?: boolean;
/**
* Show title state
*/
showTitle?: boolean;
/**
* Show values in title
*/
showValuesInTitle?: boolean;
/**
* Visible state
*/
visible?: boolean;
}
/**
* Represents indicator options
*/
interface IIndicatorOptions {
/**
* Allow settings dialog
*/
allowSettingsDialog: boolean;
/**
* Apply indicator
*/
applyIndicator: boolean;
/**
* Colored volume theme
*/
coloredVolumeTheme?: any;
/**
* Enable scale vertical label
*/
enableVerticalAxisLabels: boolean;
/**
* Hoverable state
*/
hoverable?: boolean;
/**
* Height ratio of pane
*/
paneHeightRatio: number;
/**
* Parameters value
*/
parameters: object;
/**
* Scale vertical index
*/
verticalScaleIndex?: number;
/**
* Selectable state
*/
selectable?: boolean;
/**
* Show line levels
*/
showLineLevels?: boolean;
/**
* Show parameters in title
*/
showParamsInTitle: boolean;
/**
* Show title
*/
showTitle?: boolean;
/**
* Show values in title
*/
showValuesInTitle: boolean;
/**
* Visible state
*/
visible: boolean;
/**
* zIndex value
*/
zIndex?: number;
canChangePane?: boolean;
theme?: any;
}
/**
* Represents indicator state
*/
/**
* A single indicator plot value for the OHLC card.
*/
interface IIndicatorHoverValue {
name: string;
color: string;
value: string;
}
interface IIndicatorTitleItem {
text: string;
tooltip?: string;
color?: string;
values?: number[];
}
interface IIndicatorState {
id?: string;
parentId?: string;
type: string;
paneIndex?: number;
isAutoScale?: boolean;
prevParameters?: unknown;
isCustom?: boolean;
/**
* Allow settings dialog
*/
allowSettingsDialog?: boolean;
/**
* Apply indicator
*/
applyIndicator?: boolean;
/**
* Colored volume theme
*/
coloredVolumeTheme?: any;
/**
* Enable scale vertical label
*/
enableVerticalAxisLabels?: boolean;
/**
* Hoverable state
*/
hoverable?: boolean;
/**
* Height ratio of pane
*/
paneHeightRatio?: number;
/**
* Parameters value
*/
parameters?: object;
/**
* Scale vertical index
*/
verticalScaleIndex?: number;
/**
* Selectable state
*/
selectable?: boolean;
/**
* Show line levels
*/
showLineLevels?: boolean;
/**
* Show parameters in title
*/
showParamsInTitle?: boolean;
/**
* Show title
*/
showTitle?: boolean;
/**
* Show values in title
*/
showValuesInTitle?: boolean;
/**
* Visible state
*/
visible?: boolean;
/**
* zIndex value
*/
zIndex?: number;
canChangePane?: boolean;
theme?: any;
}
const AutoScaleMultiplierValue = 5;
/**
* Provides model of Abstract indicator
*
* @category Indicators
*/
abstract class Indicator extends AbstractIndicator implements IDisposable, IStateable, IChartObject {
/**
* Gets instance type name.
*/
static get type(): string;
parentIndicator: Indicator;
parentId: string;
appliedIndicators: Indicator[];
isCustom: boolean;
customResultValues: Map;
/**
* Use primary data rows state
*/
usePrimaryDataRows: boolean;
verticalScale: VerticalScale;
private _isCustomScale;
private _hovered;
private _id;
private _lineLevels;
private _indicatorShapes;
private _shapesById;
private _shapesPanes;
private _shapesForcePricePane;
private _shapesFullyAttached;
private _pixelShapeOffsets;
private _legendOffset;
private _barStyles;
private _barStylesDirty;
private _panelStyle;
private _scriptStylesChart;
private _requireDefaults;
private _optionsTitle;
private _parametersContextMenu;
private _plotFill;
private _plotFillSeries;
private _removedPlotFill;
private _plotDisplacements;
private _plots;
private _refreshDeferred;
private _deferredFrom;
private _prevParams;
private _removeTitle;
private _alertTitle;
private _selected;
private _titleControls;
private _titleItems;
private _titleItemViews;
private _toggleTitleVisibility;
private _values;
private _titleContextMenu;
private _inputDataRowName;
private _inputDataRowName2;
private _isLoading;
/**
* Is auto scale state
*/
private _isAutoScale;
/**
* Is overlay state
*/
private _isOverlay;
/**
* Pane value
*/
_pane: Pane | null;
/**
* Plot items
*/
private _plotItems;
/**
* Get input data row name
*/
get inputDataRowName(): string;
/**
* Set input data row name
*/
set inputDataRowName(value: string);
/**
* Get input data row name 2
*/
get inputDataRowName2(): string;
/**
* Set input data row name
*/
set inputDataRowName2(value: string);
/**
* Get default theme of shape
*/
get defaultTheme(): any;
get theme(): any;
set theme(value: any);
get lineLevels(): Shape[];
get indicatorShapes(): Shape[];
/**
* Allow setting dialog state
*/
get allowSettingsDialog(): boolean;
set allowSettingsDialog(value: boolean);
/**
* Apply indicator
*/
get applyIndicator(): boolean;
set applyIndicator(value: boolean);
/**
* Get can hover state
*/
get canHover(): boolean;
/**
* Get if can merge down (move pane down)
*/
get canMergeDown(): boolean;
/**
* Get if can merge up (move pane up)
*/
get canMergeUp(): boolean;
/**
* Get if this indicator can be moved onto the primary (price) pane as an overlay.
*/
get canMoveToPrice(): boolean;
/**
* Get if can select
*/
get canSelect(): boolean;
/**
* Get if can un-merge down
*/
get canUnmergeDown(): boolean;
/**
* Get if can un-merge up
*/
get canUnmergeUp(): boolean;
get canChangePane(): boolean;
get chart(): Chart;
set chart(value: Chart);
/**
* Gets instance type name.
*/
get type(): string;
/**
* Colored volume theme
*/
get coloredVolumeTheme(): any;
set coloredVolumeTheme(value: any);
/**
* Get enableScale vertical labels
*/
get enableVerticalAxisLabels(): boolean;
set enableVerticalAxisLabels(value: boolean);
/**
* Get hoverable state
*/
get hoverable(): boolean;
set hoverable(value: boolean);
/**
* Get hovered state
*/
get hovered(): boolean;
set hovered(value: boolean);
/**
* Get indicator ID
*/
get id(): string;
set id(value: string);
/**
* Get if auto scale enabled
*/
get isAutoScale(): boolean;
set isAutoScale(value: boolean);
/**
* Get if initialized
*/
get Initialized(): boolean;
/**
* Get if overlay
*/
get isOverlay(): boolean;
protected set isOverlay(value: boolean);
/**
* Get pane
*/
get pane(): Pane;
/**
* get pane height ratio
*/
get paneHeightRatio(): number;
/**
* Pins the indicator to an explicit pane before it is attached to
* a chart via `chart.addIndicators(...)`.
*
* Suppresses the default routing (which uses `isOverlay` to decide
* between the primary pane and a freshly-created pane) and aligns
* `isOverlay` with the chosen pane so subsequent layout / merge
* behaviour remains consistent.
*
* Used internally by `Pane.addIndicator(...)` and
* `Chart.addIndicatorInNewPane(...)`; rarely needed directly.
*
* @param pane The pane this indicator should live on.
*/
placeOnPane(pane: Pane): void;
/**
* Get indicator parameters
*/
get parameters(): object;
/**
* Get plots
*/
get plots(): Plot[];
/**
* Get if selectable
*/
get selectable(): boolean;
set selectable(value: boolean);
/**
* Get if selected
*/
get selected(): boolean;
set selected(value: boolean);
/**
* Get show line levels
*/
get showLineLevels(): boolean;
set showLineLevels(value: boolean);
/**
* Get show parameters in title
*/
get showParamsInTitle(): boolean;
set showParamsInTitle(value: boolean);
/**
* Get if show title
*/
get showTitle(): boolean;
set showTitle(value: boolean);
/**
* Get if show values in title
*/
get showValuesInTitle(): boolean;
set showValuesInTitle(value: boolean);
/**
* Get values
*/
get values(): DataRowsCollection;
set values(values: DataRowsCollection);
/**
* Get visibility
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Get z-Index
*/
get zIndex(): number;
set zIndex(value: number);
private get canCreateAlert();
get isLoading(): boolean;
set isLoading(isLoading: boolean);
/**
* Creates an instance of Indicator.
*/
constructor();
/**
* Add line
*
* @param color
* @param pointY
*/
addLine(color: string, pointY: number): void;
setTitleItems(items: IIndicatorTitleItem[]): void;
addShape(state: IShapeState): Shape | null;
setIndicatorShapes(states: IShapeState[], opts?: {
onPricePane?: boolean;
}): void;
upsertIndicatorShapes(states: IShapeState[]): void;
private removeIndicatorShape;
removeIndicatorShapes(): void;
private isPixelAnchoredShape;
private routeAndAttach;
layoutShapeLabels(pane: Pane): void;
private layoutPixelShapes;
private attachIndicatorShapes;
/**
* Replaces the whole set of per-bar color overrides owned by this
* indicator (the `ScriptCalculated` snapshot channel).
*
* Bars are addressed by timestamp, so history loading and conflation
* cannot shift them. Overrides are painted on the chart-type plot of
* the price pane - wherever this indicator's own plots live - and are
* dropped together with the indicator.
*
* @param styles Bar styles, or `null` to clear them.
*/
setBarStyles(styles: IScriptBarStyle[] | null): void;
/**
* Adds or replaces single bar overrides, keeping the rest (the
* `ScriptUpdate` realtime channel). Re-sending the same timestamp
* replaces that bar, so repeated ticks on a forming bar never pile up;
* a style that paints nothing clears the bar again.
*
* @param styles Bar styles to merge in.
*/
upsertBarStyles(styles: IScriptBarStyle[] | null): void;
/**
* Drops every per-bar color override owned by this indicator.
*/
clearBarStyles(): void;
/**
* Sets the background this indicator paints - one per indicator, the
* last call wins. The user theme is not touched and the gradient is
* not serialized into the chart state.
*
* @param style Panel style, or `null` to restore the theme.
*/
setPanelStyle(style: IScriptPanelStyle | null): void;
/**
* Restores the theme background.
*/
clearPanelStyle(): void;
/**
* Pushes the buffered script styles to the chart registries. Called
* whenever the indicator is (re)attached or refreshed, so a pane move
* re-targets the background and a re-added indicator repaints its bars.
*/
private applyScriptStyles;
/**
* Removes this indicator's script styles from the chart registries.
*/
private removeScriptStyles;
private static barStyleTime;
/**
* Add plot
*
* @param color
* @param name
* @param plotStyle
* @param width
* @param style
*/
addPlot(color: string, name: string, plotStyle?: string, width?: number, style?: string): Plot;
/**
* Add plot area - a filled region between two of this indicator's
* plots. `name` / `name2` are plot names declared with
* {@link Indicator.addPlot}; `aboveColor` paints the segments where
* the **first** series is above the second one, `belowColor` the rest.
*
* Only one area per indicator is supported.
*
* @param name
* @param name2
* @param aboveColor
* @param belowColor
*/
addPlotArea(name: string, name2: string, aboveColor: string, belowColor: string): void;
/**
* Removes the area added with {@link Indicator.addPlotArea}.
*/
removePlotArea(): void;
private dropRemovedPlotFill;
setPlotDisplacement(name: string, bars: number): void;
/**
* Bind indicator to a vertical scale
*
* @param verticalScale
*/
bindToVerticalScale(verticalScale: VerticalScale): this;
dispose(): void;
/**
* Paint indicator
*/
paint(): void;
getLocalizationKeys(): void;
/**
* Perform hover
*/
hover(): void;
restoreState(state: IIndicatorState): void;
/**
* Retrieve Fill plot
*
* @param theme
* @param dataRows1
* @param dataRows2
* @return
*/
plotFill(theme: any, dataRows1: IndicatorDataRows, dataRows2: IndicatorDataRows): Plot;
/**
* Retrieve Histogram plot
*
* @param theme
* @param dataRows
* @param plotStyle
* @return
*/
plotHistogram(theme: any, dataRows?: IndicatorDataRows, plotStyle?: string): Plot;
/**
* Retrieve Line plot
*
* @param theme
* @param dataRows
* @return
*/
plotLine(theme: any, dataRows?: IndicatorDataRows): Plot;
/**
* Remove indicator
*/
remove(): void;
/**
* Remove line levels
*/
removeLineLevels(): void;
/**
* Perform select
*/
select(): void;
saveState(): any;
/**
* Reset to defaults
*/
resetDefaults(): void;
/**
* Show settings dialog
*/
showSettingsDialog(): void;
/**
* Refresh calculations
*/
refresh(): void;
/**
* Recalculates from a bar index, keeping earlier values.
*
* @param startIndex The first bar whose value changed.
*/
refreshFrom(startIndex: number): void;
private refreshCore;
getTimeFrame(): ITimeFrame;
getExportParametersMap(): any;
/**
* Update hover record
*
* @param record
*/
updateHoverRecord(record?: number): void;
getValues(): DataRowsCollection;
/**
* Per-plot values at a record for the OHLC card.
*
* @param record Record index; defaults to hovered record.
* @return One { name, color, value } per plot.
*/
hoverValues(record?: number): IIndicatorHoverValue[];
/**
* Update visibility of title elements
*/
updateTitleControlsVisibility(): void;
/**
* Define option
*
* @param key
* @param value
* @param valueChangedEventName
*/
protected setOption(key: string, value: any, valueChangedEventName?: string): void;
/**
* Initialize pane
*/
protected initPane(): void;
protected normalizePlotItem(plotItem: any, indicatorDataRows: IndicatorDataRows): void;
/**
* Perform merge
*
* @param isMergingUp
*/
protected merge(isMergingUp: boolean): void;
/**
* Promote this indicator onto the primary (price) pane as an overlay.
*/
protected mergeIntoPrimaryPane(): void;
/**
* perform un-merge
*
* @param unmergeUp
*/
protected unmerge(unmergeUp: boolean): void;
/**
* Retrieve if needs custom scale
*/
protected needsCustomScale(): boolean;
/**
* Retrieve if the plots must stay out of the vertical auto scale.
*
* Script-driven indicators report whatever the script emits, which is not
* necessarily comparable with the price (a script that keeps `IsOverlay`
* on while plotting zeros drags the price scale minimum down to zero).
* The scale range also gates zoom and scroll, so such values do not only
* squash the candles - they lock the vertical axis as well.
*
* Only applies while the indicator actually shares the price pane scale:
* on its own pane, or bound to its own scale, its plots are the only
* input that scale has and excluding them would leave nothing to scale by.
*
* Override in a subclass to opt a custom indicator back in.
*/
protected excludeFromPriceAutoScale(): boolean;
/**
* Refresh item by number
*
* @param index
*/
protected refreshItem(index: number): boolean;
private timeFrameBars;
private addPane;
private addPanePlot;
private histogramTheme;
private initIndicator;
private initPaneTitle;
private rebuildTitleItems;
/**
* Renders BBCode markup (as produced by the script engine's SetTitle) into the legend span.
* Falls back to plain text if the markup carries no formatting.
*/
private renderTitleItemText;
/**
* Tooltips live in a title attribute, which cannot carry markup - keep the text, drop the tags.
*/
private static stripBBCode;
private updateTitleItemValues;
private setCustomScale;
protected subscribe(): void;
protected unsubscribe(): void;
protected onLastBarUpdated(event: IValueChangedEvent): void;
protected onBarsSet(event: IValueChangedEvent): void;
protected onBarsAppended(event: IValueChangedEvent): void;
protected onBarsInserted(event: IValueChangedEvent): void;
protected onVisibilityChanged(visible: boolean): void;
/**
* Whether a refresh may be postponed until the indicator is shown.
*/
private canDeferRefresh;
protected onChartTypeChanged(event: IValueChangedEvent): void;
protected onReplayModeStartRecordSelected(event: IValueChangedEvent): void;
protected onReplayModeStopped(): void;
protected onThemeChanged(): void;
private updatePaneTitle;
private visualizePlotArea;
private fillTheme;
private findById;
private displacedDataRows;
private plotDisplacement;
private withoutNaNValues;
private localizedParameters;
private localizeTimeFrameParameter;
private removeControls;
private resetValues;
private updateAutoScaleMultiplier;
private disablePaddings;
private toggleVisibility;
private addAlert;
}
}
declare module FintaChart {
const IndicatorParam: {
SOURCE: string;
SOURCE2: string;
PERIODS: string;
R2_SCALE: string;
STANDARD_DEVIATIONS: string;
MA_PERIOD: string;
ROC_PERIOD: string;
SMOOTH: string;
MA_TYPE: string;
SHIFT: string;
BAND_PCT: string;
PCT_K_PERIODS: string;
PCT_K_SMOOTHING: string;
PCT_K_DOUBLE_SMOOTHING: string;
PCT_D_PERIODS: string;
PCT_D_MA_TYPE: string;
RATE_OF_CHANGE: string;
SHORT_CYCLE: string;
LONG_CYCLE: string;
SIGNAL_PERIODS: string;
LINE_WIDTH: string;
LINE_STYLE: string;
LINE_COLOR: string;
LINE_ENABLED: string;
FILL_ABOVE: string;
FILL_BELOW: string;
FILL_ENABLED: string;
FAST: string;
SLOW: string;
VOLUME_DIVISOR: string;
OFFSET_MULTIPLIER: string;
MULTIPLIER: string;
BOX_RATIO_SMOOTHING: string;
ENVELOPE_PERCENTAGE: string;
BAR_COUNT: string;
Q_PERIODS: string;
T_COUNT: string;
V_FACTOR: string;
FORECAST: string;
INTERMEDIATE: string;
VOLATILITY_PERIOD: string;
BARS_REQUIRED_TO_PLOT: string;
EMA1: string;
EMA2: string;
CONVERSION_PERIODS: string;
BASE_PERIODS: string;
LOGIN_SPAN2_PERIODS: string;
DISPLACEMENT: string;
LIMIT_VALUE: string;
TIME_LINE_PERIOD: string;
TIME_FRAME: string;
ROWS_NUMBER: string;
VA_PERCENT: string;
STEP: string;
SESSION_T0: string;
SIZE: string;
TIMEFRAME_VISIBILITY: string;
};
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents factory of indicators.
*/
class IndicatorFactory {
private static readonly _objFactory;
/**
* Gets known indicator types.
*/
static get knownTypes(): IterableIterator;
/**
* Adds indicator to the factory.
*/
static add(type: typeof Indicator): void;
/**
* Creates new indicator instance of specified type name.
*
* The second argument is overloaded: pass a `Chart` to attach the
* indicator to it immediately, or pass a plain object to seed
* parameter values (`{ period: 20, source: 'close' }`). Both forms
* may be combined via the three-argument variant.
*
* @param typeName The type name of indicator.
* @param chartOrParameters Either the chart instance, or a
* parameters object applied via `updateParameters` after construction.
* @param parameters Optional parameters when the second argument
* already specifies a chart.
* @return Indicator instance of given type.
*/
static create(typeName: string, chartOrParameters?: Chart | Record, parameters?: Record): Indicator;
/**
* Restores chart type from a previously saved state.
*
* @param state The saved indicator state.
* @return Chart type instance.
*/
static restore(state: IIndicatorState): Indicator;
}
}
declare module FintaChart {
/**
* Represents logic of external alert creation on chart indicator parameters
*
*/
interface IIndicatorAlertsHandler {
canCreateAlertOnIndicator(indicator: Indicator, chart: Chart): boolean;
createAlertOnIndicator(indicator: Indicator, chart: Chart): void;
}
}
declare module FintaChart {
/**
* Moving Average types.
*/
enum MovingAverageType {
EXPONENTIAL = 0,
HULL = 1,
SIMPLE = 2,
TRIANGULAR = 3,
TEMA = 4,
WEIGHTED = 5,
VARIABLE = 6,
WWS = 7,
VIDYA = 8
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
class TimeframeCheckboxesControl implements IIndicatorParameterControl {
private _container;
private _values;
private _supportedTimeFrames;
private _indicator;
constructor(indicator: Indicator, initialValue: boolean);
createHtmlElement(): Promise;
values(): Record;
onLocaleChanged(): Promise;
private static getTimeFrameLocalizationKey;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents DM indicator.
*
* @category Indicators
*/
class DM extends Indicator {
static get type(): string;
private _dmMinus;
private _dmPlus;
private _sumDmMinus;
private _sumDmPlus;
private _sumTr;
private _tr;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents ADL indicator.
*
* @category Indicators
*/
class ADL extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents APZ indicator.
*
* @category Indicators
*/
class APZ extends Indicator {
static get type(): string;
private _ema1;
private _emaEMA;
private _emaRange;
private _newPeriod;
/**
* The band %.
*/
get bandPct(): number;
set bandPct(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents EMA indicator.
*
* @category Indicators
*/
class EMA extends Indicator {
static get type(): string;
private _constant1;
private _constant2;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ATR indicator.
*
* @category Indicators
*/
class ATR extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents SMA indicator.
*
* @category Indicators
*/
class SMA extends Indicator {
static get type(): string;
private _priorSum;
private _sum;
private _priorValidCount;
private _validCount;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
const EncapsulationPeriod: {
DAILY: string;
YEARLY: string;
MONTHLY: string;
WEEKLY: string;
};
const Interval: {
DAILY: number;
WEEKLY: number;
MONTHLY: number;
YEARLY: number;
};
/**
* Represents Encapsulation indicator.
*
* @category Indicators
*/
class Encapsulation extends Indicator {
static get type(): string;
private _changeSide;
private _countDays;
private _countHours;
private _lastCalculatedBar;
private _maxHigh;
private _minLow;
/**
* The encapsulation period.
*/
get encapsulationPeriod(): string;
set encapsulationPeriod(value: string);
get showValuesInTitle(): boolean;
set showValuesInTitle(value: boolean);
protected subscribe(): void;
protected unsubscribe(): void;
remove(): void;
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
private dailyCalculation;
private monthlyCalculation;
private setShapePoints;
private weeklyCalculation;
private yearCalculation;
}
}
declare module FintaChart {
/**
* Represents SUM indicator.
*
* @category Indicators
*/
class SUM extends Indicator {
static get type(): string;
private _priorSum;
private _sum;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents CMO indicator.
*
* @category Indicators
*/
class CMO extends Indicator {
static get type(): string;
private _down;
private _sumDown;
private _sumUp;
private _up;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Maximum indicator.
*
* @category Indicators
*/
class MAXIMUM extends Indicator {
static get type(): string;
private _lastBar;
private _lastMax;
private _runningBar;
private _runningMax;
private _thisBar;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Minimum indicator.
*
* @category Indicators
*/
class MINIMUM extends Indicator {
static get type(): string;
private _lastBar;
private _lastMin;
private _runningBar;
private _runningMin;
private _thisBar;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ADIndex indicator.
*
* @category Indicators
*/
class ADIndex extends Indicator {
/**
* Gets instance type name.
*/
static get type(): string;
private _dmMinus;
private _dmPlus;
private _sumDmMinus;
private _sumDmPlus;
private _sumTr;
private _tr;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents OBV indicator.
*
* @category Indicators
*/
class OBV extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ROC indicator.
*
* @category Indicators
*/
class ROC extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Volume indicator.
*
* @category Indicators
*/
class VOLUME extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents VMA indicator.
*
* @category Indicators
*/
class VMA extends Indicator {
static get type(): string;
private _cmo;
private _sc;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The volatility period.
*/
get volatilityPeriod(): number;
set volatilityPeriod(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents BOP indicator.
*
* @category Indicators
*/
class BOP extends Indicator {
static get type(): string;
private _bop;
private _sma;
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PPO indicator.
*
* @category Indicators
*/
class PPO extends Indicator {
static get type(): string;
private _emaFast;
private _emaSlow;
private _values0;
private _emaSmooth;
/**
* The fast EMA period.
*/
get fast(): number;
set fast(value: number);
/**
* The slow EMA period.
*/
get slow(): number;
set slow(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents TSF indicator.
*
* @category Indicators
*/
class TSF extends Indicator {
static get type(): string;
private _avg;
private _divisor;
private _intercept;
private _myPeriod;
private _priorSumXY;
private _priorSumY;
private _slope;
private _sum;
private _sumX;
private _sumX2;
private _sumXY;
private _sumY;
private _windowClean;
/**
* The forecast.
*/
get forecast(): number;
set forecast(value: number);
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents TSI indicator.
*
* @category Indicators
*/
class TSI extends Indicator {
static get type(): string;
private _constant1;
private _constant2;
private _constant3;
private _constant4;
private _fastAbsEma;
private _fastEma;
private _slowAbsEma;
private _slowEma;
/**
* The fast EMA period.
*/
get fast(): number;
set fast(value: number);
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The slow EMA period.
*/
get slow(): number;
set slow(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PFE indicator.
*
* @category Indicators
*/
class PFE extends Indicator {
static get type(): string;
private _div;
private _ema;
private _pfeDataRows;
private _singlePfeDataRows;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents WMA indicator.
*
* @category Indicators
*/
class WMA extends Indicator {
static get type(): string;
private _myPeriod;
private _priorSum;
private _priorWsum;
private _sum;
private _wsum;
private _windowClean;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents HML indicator.
*
* @category Indicators
*/
class HML extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents RSI indicator.
*
* @category Indicators
*/
class RSI extends Indicator {
static get type(): string;
private _avgDown;
private _avgUp;
private _constant1;
private _constant2;
private _constant3;
private _down;
private _smaDown;
private _smaUp;
private _up;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents MFI indicator.
*
* @category Indicators
*/
class MFI extends Indicator {
static get type(): string;
private _negative;
private _positive;
private _sumNegative;
private _sumPositive;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ASI indicator.
*
* @category Indicators
*/
class ASI extends Indicator {
static get type(): string;
private _swingIndex;
/**
* The limit value.
*/
get limitValue(): number;
set limitValue(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents CRS indicator.
*
* @category Indicators
*/
class CRS extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
get inputDataRowName2(): string;
set inputDataRowName2(value: string);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents EFI indicator.
*
* @category Indicators
*/
class EFI extends Indicator {
static get type(): string;
private _ema;
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents GRI indicator.
*
* @category Indicators
*/
class GRI extends Indicator {
static get type(): string;
private _max;
private _min;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents IMI indicator.
*
* @category Indicators
*/
class IMI extends Indicator {
static get type(): string;
private _dnSum;
private _prevDnSum;
private _prevUpSum;
private _upSum;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* The CCI indicator.
*
* @category Indicators
*/
class CCI extends Indicator {
static get type(): string;
private _sma;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents RSS indicator.
*
* @category Indicators
*/
class RSS extends Indicator {
static get type(): string;
private _ema1;
private _ema2;
private _priceSpread;
private _rs;
private _rsi;
private _sma;
/**
* The first EMA period.
*/
get ema1(): number;
set ema1(value: number);
/**
* The second EMA period.
*/
get ema2(): number;
set ema2(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents HMA indicator.
*
* @category Indicators
*/
class HMA extends Indicator {
static get type(): string;
private _diffDataRows;
private _wma1;
private _wma2;
private _wmaDiffDataRows;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PNB indicator.
*
* @category Indicators
*/
class PNB extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents TMA indicator.
*
* @category Indicators
*/
class TMA extends Indicator {
static get type(): string;
private _p1;
private _p2;
private _sma0;
private _smaSource;
private _sma;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents NVI indicator.
*
* @category Indicators
*/
class NVI extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PVI indicator.
*
* @category Indicators
*/
class PVI extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PVT indicator.
*
* @category Indicators
*/
class PVT extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents TVI indicator.
*
* @category Indicators
*/
class TVI extends Indicator {
static get type(): string;
private _direction;
private _lastDirection;
private _tvi;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The limit value.
*/
get limitValue(): number;
set limitValue(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents TMF indicator.
*
* @category Indicators
*/
class TMF extends Indicator {
static get type(): string;
private _ema;
private _ema2;
private _high;
private _low;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents WWS indicator.
*
* @category Indicators
*/
class WWS extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents CFO indicator.
*
* @category Indicators
*/
class CFO extends Indicator {
static get type(): string;
private _tsf;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents EFT indicator.
*
* @category Indicators
*/
class EFT extends Indicator {
static get type(): string;
private _max;
private _min;
private _prevFish;
private _prevValue1;
private _value1;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents PGO indicator.
*
* @category Indicators
*/
class PGO extends Indicator {
static get type(): string;
private _ema;
private _sma;
private _tr;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents PNO indicator.
*
* @category Indicators
*/
class PNO extends Indicator {
static get type(): string;
private _bottom;
private _top;
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents WAD indicator.
*
* @category Indicators
*/
class WAD extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents RIND indicator.
*
* @category Indicators
*/
class RIND extends Indicator {
static get type(): string;
private _ema;
private _max;
private _min;
private _stochRange;
private _val1;
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The Q period.
*/
get periodQ(): number;
set periodQ(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents DEMA indicator.
*
* @category Indicators
*/
class DEMA extends Indicator {
static get type(): string;
private _ema;
private _emaEma;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents KAMA indicator.
*
* @category Indicators
*/
class KAMA extends Indicator {
static get type(): string;
private _diffDataRows;
private _fastCF;
private _slowCF;
private _sum;
/**
* The fast smoothing constant.
*/
get fast(): number;
set fast(value: number);
/**
* The slow smoothing constant.
*/
get slow(): number;
set slow(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents DBox indicator.
*
* @category Indicators
*/
class DBox extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents TEMA indicator.
*
* @category Indicators
*/
class TEMA extends Indicator {
static get type(): string;
private _ema1;
private _ema2;
private _ema3;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents VWAP indicator.
*
* @category Indicators
*/
class VWAP extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents TRIX indicator.
*
* @category Indicators
*/
class TRIX extends Indicator {
static get type(): string;
private _default;
private _ema1;
private _ema2;
private _emaDefault;
private _emaTriple;
private _trixSignal;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
get multiplier(): number;
set multiplier(value: number);
/**
* The signal period.
*/
get signalPeriod(): number;
set signalPeriod(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ADXR indicator.
*
* @category Indicators
*/
class ADXR extends Indicator {
static get type(): string;
private _adx;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents FOSC indicator.
*
* @category Indicators
*/
class FOSC extends Indicator {
static get type(): string;
private _tsf;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents MACD indicator.
*
* @category Indicators
*/
class MACD extends Indicator {
static get type(): string;
private _constant1;
private _constant2;
private _constant3;
private _constant4;
private _constant5;
private _constant6;
private _fastEma;
private _slowEma;
/**
* The fast EMA period.
*/
get fast(): number;
set fast(value: number);
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The slow EMA period.
*/
get slow(): number;
set slow(value: number);
/**
* The smooth.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents VROC indicator.
*
* @category Indicators
*/
class VROC extends Indicator {
static get type(): string;
private _sma;
private _smaVolume;
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents RAVI indicator.
*
* @category Indicators
*/
class RAVI extends Indicator {
static get type(): string;
private _vidyaLong;
private _vidyaShort;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The long cycle.
*/
get longCycle(): number;
set longCycle(value: number);
/**
* The short cycle.
*/
get shortCycle(): number;
set shortCycle(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents VIDYA indicator.
*
* @category Indicators
*/
class VIDYA extends Indicator {
static get type(): string;
private _lr;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The R2 scale.
*/
get r2Scale(): number;
set r2Scale(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents VOLMA indicator.
*
* @category Indicators
*/
class VOLMA extends Indicator {
static get type(): string;
private _ema;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents ZLEMA indicator.
*
* @category Indicators
*/
class ZLEMA extends Indicator {
static get type(): string;
private _k;
private _lag;
private _oneMinusK;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Range indicator.
*
* @category Indicators
*/
class Range extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Std. Dev indicator.
*
* @category Indicators
*/
class StdDev extends Indicator {
static get type(): string;
private _sumDataRows;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Aroon indicator
*
* @category Indicators
*/
class Aroon extends Indicator {
static get type(): string;
private _runningMax;
private _runningMaxBar;
private _runningMin;
private _runningMinBar;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Momentum indicator.
*
* @category Indicators
*/
class Momentum extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Stochastics indicator.
*
* @category Indicators
*/
class Stochastics extends Indicator {
static get type(): string;
private _d;
private _den;
private _fastK;
private _k;
private _max;
private _min;
private _nom;
private _smaFastK;
private _smaK;
/**
* The %D period.
*/
get periodD(): number;
set periodD(value: number);
/**
* The %K period.
*/
get periodK(): number;
set periodK(value: number);
/**
* The smoothing period.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Stochastics Fast indicator.
*
* @category Indicators
*/
class StochasticsFast extends Indicator {
static get type(): string;
private _d;
private _den;
private _k;
private _max;
private _min;
private _nom;
private _smaK;
/**
* The %D period.
*/
get periodD(): number;
set periodD(value: number);
/**
* The %K period.
*/
get periodK(): number;
set periodK(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents MA Envelopes indicator.
*
* @category Indicators
*/
class MAEnvelopes extends Indicator {
static get type(): string;
private _ema;
private _hma;
private _sma;
private _tema;
private _tma;
private _variable;
private _vidya;
private _wma;
private _wws;
/**
* The envelope percentage.
*/
get envelopePercentage(): number;
set envelopePercentage(value: number);
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The MA type.
*/
get maType(): number;
set maType(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents N Bars Down indicator.
*
* @category Indicators
*/
class NBarsDown extends Indicator {
static get type(): string;
private _barDown;
private _lowerHigh;
private _lowerLow;
/**
* The bars count.
*/
get barCount(): number;
set barCount(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Volume Up Down indicator.
*
* @category Indicators
*/
class VolumeUpDown extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents N Bars Up indicator.
*
* @category Indicators
*/
class NBarsUp extends Indicator {
static get type(): string;
private _barUp;
private _higherHigh;
private _higherLow;
/**
* The bars count.
*/
get barCount(): number;
set barCount(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Log Change indicator.
*
* @category Indicators
*/
class LogChange extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Bollinger indicator.
*
* @category Indicators
*/
class Bollinger extends Indicator {
static get type(): string;
private _sma;
private _stdDev;
/**
* The standard deviation.
*/
get numStdDev(): number;
set numStdDev(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
getLocalizationKeys(): string[];
}
}
declare module FintaChart {
/**
* Represents Arron Oscillator indicator.
*
* @category Indicators
*/
class AroonOscillator extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Typical Price indicator.
*
* @category Indicators
*/
class TypicalPrice extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Median Price indicator.
*
* @category Indicators
*/
class MedianPrice extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Weighted Close indicator.
*
* @category Indicators
*/
class WeightedClose extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Swing index indicator.
*
* @category Indicators
*/
class SwingIndex extends Indicator {
static get type(): string;
private _a;
private _b;
private _c;
private _ct;
private _cy;
private _ht;
private _k;
private _lt;
private _ot;
private _oy;
private _r;
/**
* The limit value.
*/
get limitValue(): number;
set limitValue(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Elder Thermometer indicator.
*
* @category Indicators
*/
class ElderThermometer extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Historical Volatility indicator.
*
* @category Indicators
*/
class HistoricalVolatility extends Indicator {
static get type(): string;
private _barHistory;
private _stdDev;
private _stdDataRows;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Market Facilitation Index indicator.
*
* @category Indicators
*/
class MarketFacilitationIndex extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Performance Index indicator.
*
* @category Indicators
*/
class PerformanceIndex extends Indicator {
static get type(): string;
private _firstPrice;
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents McGinley Dynamic indicator.
*
* @category Indicators
*/
class McGinleysDynamic extends Indicator {
static get type(): string;
private _ema;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Linear Regression indicator.
*
* @category Indicators
*/
class LinearRegression extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Center Of Gravity indicator.
*
* @category Indicators
*/
class CenterOfGravity extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Coppock Curve indicator.
*
* @category Indicators
*/
class CoppockCurve extends Indicator {
static get type(): string;
private _roc;
private _roc1;
private _dataRows;
private _wma;
get inputDataRowName(): string;
set inputDataRowName(value: string);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents True Range indicator.
*
* @category Indicators
*/
class TrueRange extends Indicator {
static get type(): string;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Linear Regression Forecast indicator.
*
* @category Indicators
*/
class LinearRegressionForecast extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Linear Regression Slope indicator.
*
* @category Indicators
*/
class LinearRegressionSlope extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Linear Regression Intercept indicator.
*
* @category Indicators
*/
class LinearRegressionIntercept extends Indicator {
static get type(): string;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents HIGH LOW Bands indicator.
*
* @category Indicators
*/
class HighLowBands extends Indicator {
static get type(): string;
private _vidyaClose;
private _vidyaHigh;
private _vidyaLow;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Elder Ray indicator.
*
* @category Indicators
*/
class ElderRay extends Indicator {
static get type(): string;
private _ema;
private _hma;
private _sma;
private _tema;
private _tma;
private _variable;
private _vidya;
private _wma;
private _wws;
/**
* The MA type.
*/
get maType(): number;
set maType(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
getLocalizationKeys(): string[];
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
private maIndicator;
}
}
declare module FintaChart {
/**
* Represents Stoch. RSI indicator.
*
* @category Indicators
*/
class StochRSI extends Indicator {
static get type(): string;
private _max;
private _min;
private _rsi;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Deviation to MA indicator.
*
* @category Indicators
*/
class DeviationToMA extends Indicator {
static get type(): string;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Chaikin Money Flow indicator.
*
* @category Indicators
*/
class ChaikinMoneyFlow extends Indicator {
static get type(): string;
private _moneyFlow;
private _sumMoneyFlow;
private _sumVolume;
/**
* The period.
*/
get period(): number;
set period(value: number);
get multiplier(): number;
set multiplier(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Chaikin Volatility indicator.
*
* @category Indicators
*/
class ChaikinVolatility extends Indicator {
static get type(): string;
private _ema;
/**
* The MA period.
*/
get maPeriod(): number;
set maPeriod(value: number);
/**
* The ROC period.
*/
get rocPeriod(): number;
set rocPeriod(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Chaikin Oscillator indicator.
*
* @category Indicators
*/
class ChaikinOscillator extends Indicator {
static get type(): string;
private _cummulative;
private _emaFast;
private _emaSlow;
private _moneyFlow;
/**
* The fast EMA period.
*/
get fast(): number;
set fast(value: number);
/**
* The slow EMA period.
*/
get slow(): number;
set slow(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Price Oscillator indicator.
*
* @category Indicators
*/
class PriceOscillator extends Indicator {
static get type(): string;
private _emaFast;
private _emaSlow;
private _emaSmooth;
private _smoothEma;
/**
* The fast EMA period.
*/
get fast(): number;
set fast(value: number);
/**
* The slow EMA period.
*/
get slow(): number;
set slow(value: number);
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Donchian Channel indicator.
*
* @category Indicators
*/
class DonchianChannel extends Indicator {
static get type(): string;
private _max;
private _min;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Key Reversal Down indicator.
*
* @category Indicators
*/
class KeyReversalDown extends Indicator {
static get type(): string;
private _max;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* The Key Reversal Up indicator.
*
* @category Indicators
*/
class KeyReversalUp extends Indicator {
static get type(): string;
private _min;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Ease of Movement indicator.
*
* @category Indicators
*/
class EaseOfMovement extends Indicator {
static get type(): string;
private _ema;
private _emv;
private _boxRatio;
private _smoothedBoxRatio;
/**
* The smooth value.
*/
get smooth(): number;
set smooth(value: number);
/**
* The volume divisor.
*/
get volumeDivisor(): number;
set volumeDivisor(value: number);
/**
* The box ratio smoothing period.
*/
get boxRatioSmoothing(): number;
set boxRatioSmoothing(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Volume Oscillator indicator.
*
* @category Indicators
*/
class VolumeOscillator extends Indicator {
static get type(): string;
private _smaFast;
private _smaSlow;
private _emaFast;
private _emaSlow;
/**
* The fast SMA period.
*/
get fast(): number;
set fast(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
/**
* The slow SMA period.
*/
get slow(): number;
set slow(value: number);
/**
* The maType period.
*/
get maType(): number;
set maType(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Williams R indicator.
*
* @category Indicators
*/
class WilliamsR extends Indicator {
static get type(): string;
private _max;
private _min;
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Keltner Channel indicator.
*
* @category Indicators
*/
class KeltnerChannel extends Indicator {
static get type(): string;
private _diff;
private _smaDiff;
private _smaTypical;
/**
* The offset multiplier.
*/
get offsetMultiplier(): number;
set offsetMultiplier(value: number);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents Ultimate Oscillator indicator.
*
* @category Indicators
*/
class UltimateOscillator extends Indicator {
static get type(): string;
private _buyingPressure;
private _constant1;
private _constant2;
private _constant3;
private _sumBpFast;
private _sumBpIntermediate;
private _sumBpSlow;
private _sumTrFast;
private _sumTrIntermediate;
private _sumTrSlow;
private _trueRange;
/**
* The fast SUM period.
*/
get fast(): number;
set fast(value: number);
/**
* The intermediate SUM period.
*/
get intermediate(): number;
set intermediate(value: number);
/**
* The slow SUM period.
*/
get slow(): number;
set slow(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
const IchimokuColor: {
tenka: string;
kijun: string;
chikou: string;
senkouA: string;
senkouB: string;
belowFill: string;
aboveFill: string;
};
enum IchimokuDataRowsName {
TENKA = "Tenkan Sen",
KIJUN = "Kijun Sen",
CHIKOU = "Chikou Span",
SENKOU_A = "Senkou Span A",
SENKOU_B = "Senkou Span B"
}
/**
* Represents Ichimoku indicator.
*
* @category Indicators
*/
class Ichimoku extends Indicator {
static get type(): string;
/**
* The base line periods.
*/
get baseLinePeriods(): number;
set baseLinePeriods(value: number);
/**
* The conversion line periods.
*/
get conversionLinePeriods(): number;
set conversionLinePeriods(value: number);
/**
* The displacement.
*/
get displacement(): number;
set displacement(value: number);
/**
* The logging span 2 periods.
*/
get loggingSpan2Periods(): number;
set loggingSpan2Periods(value: number);
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
interface IMoonPhases {
[phaseType: number]: IMoonPhase[];
}
const MoonPhasesIndicatorParam: {
GrowingMoonEnabled: string;
WaningMoonEnabled: string;
GrowingMoonColor: string;
WaningMoonColor: string;
FullMoonMarkEnabled: string;
FullMoonMarkSize: string;
FullMoonMarkColor: string;
NewMoonMarkEnabled: string;
NewMoonMarkSize: string;
NewMoonMarkColor: string;
};
/**
* Represents Moon Phases indicator.
*
* @category Indicators
*/
class MoonPhases extends Indicator {
static get type(): string;
private _plot;
private _moonPhases;
private _moonPhaseCalculator;
private get scaleCoordinateMapper();
get canChangePane(): boolean;
get applyIndicator(): boolean;
set applyIndicator(value: boolean);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
protected subscribe(): void;
protected unsubscribe(): void;
protected onBarsSet(event: IValueChangedEvent): void;
protected onBarsInserted(event: IValueChangedEvent): void;
protected onVisibilityChanged(visible: boolean): void;
protected onParameterUpdated(changes: IIndicatorParameterChanges): void;
dispose(): void;
private getMoonPhases;
private prependMoonPhases;
private appendMoonPhases;
private setMoonPhases;
private updatePlotSettings;
private onLastVisibleRecordChange;
private getLastPhaseDate;
}
}
declare module FintaChart {
enum PatternsIndicatorScannerType {
Fractals = "Fractals",
ZigZags = "Zig Zags"
}
enum PatternsIndicatorFractalsDisplayType {
DIAMOND = "Diamond",
DOT = "Dot",
ARROW = "Arrow"
}
const PatternsIndicatorParams: {
ScannerType: string;
ZigZagDeviation: string;
ZigZagDepth: string;
ZigZagBackstep: string;
MinDistance: string;
MaxDistance: string;
FractalsPrecision: string;
Confidence: string;
PatternsToRecognize: string;
};
/**
* Represents patterns indicator.
*
* @category Indicators
*/
class PatternsIndicator extends Indicator {
static get type(): string;
size: number;
fractalCalculator: FractalCalculator;
zigZagCalculator: ZigZagCalculator;
private _shapes;
private _patterns;
private _fractalsHash;
private _patternsHash;
private _fractals;
private _minDistance;
private _maxDistance;
private _datesCount;
private _lastHigh;
private _lastLow;
allPatterns: IPattern[];
private _patternToScan;
private get scaleCoordinateMapper();
get canChangePane(): boolean;
get applyIndicator(): boolean;
set applyIndicator(value: boolean);
get scannerType(): PatternsIndicatorScannerType;
get zigZagDeviation(): number;
get zigZagDepth(): number;
get zigZagBackstep(): number;
get fractalsPrecision(): number;
get confidence(): number;
get patternsToRecognize(): string[];
get defaultTheme(): any;
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
protected onVisibilityChanged(visible: boolean): void;
protected onParameterUpdated(changes: IIndicatorParameterChanges): void;
protected onThemeChanged(): void;
private drawOnChartByFractals;
private getDrawingTheme;
paint(): void;
private paintMarkers;
private paintDiamondMarkers;
private paintDotMarkers;
private paintUpArrows;
private paintDownArrows;
/**
* Show settings dialog
*/
showSettingsDialog(): void;
dispose(): void;
}
}
declare module FintaChart {
const ZigZagIndicatorParams: {
Deviation: string;
Depth: string;
Backstep: string;
};
/**
* Represents Zig Zag indicator.
*
* @category Indicators
*/
class ZigZagIndicator extends Indicator {
static get type(): string;
calculator: ZigZagCalculator;
private _zigZags;
private get scaleCoordinateMapper();
get canChangePane(): boolean;
get applyIndicator(): boolean;
set applyIndicator(value: boolean);
get deviation(): number;
get depth(): number;
get backstep(): number;
protected onResetDefaults(): void;
onInitializeIndicator(): void;
protected onInputTick(): void;
paint(): void;
}
}
declare module FintaChart {
enum FractalsIndicatorFractalsDisplayType {
DIAMOND = "Diamond",
DOT = "Dot",
ARROW = "Arrow"
}
const FractalsIndicatorParams: {
Precision: string;
};
/**
* @category Indicators
*/
class FractalsIndicator extends Indicator {
static get type(): string;
private _fractals;
private get scaleCoordinateMapper();
get canChangePane(): boolean;
get applyIndicator(): boolean;
set applyIndicator(value: boolean);
get precision(): number;
size: number;
calculator: FractalCalculator;
constructor();
protected onResetDefaults(): void;
onInitializeIndicator(): void;
protected onInputTick(): void;
paint(): void;
private paintMarkers;
private paintUpArrows;
private paintDownArrows;
}
}
declare module FintaChart {
/**
* @description Provides model of Visible Range Profiles indicator
*
* @export
* @class VisibleRangeProfiles
* @extends {Indicator}
*/
class VisibleRangeProfiles extends Indicator {
private _plot;
/**
* @description Get instance type name
*
* @readonly
* @static
* @property {string} instanceTypeName
* @memberof VisibelRangeProfiles
*/
static get type(): string;
/**
* @description Get show values in title
*
* @property {boolean} showValuesInTitle
* @memberof VisibleRangeProfiles
*/
get showValuesInTitle(): boolean;
/**
* @description Set show values in title
*
* @property {boolean} showValuesInTitle
* @memberof VisibleRangeProfiles
*/
set showValuesInTitle(value: boolean);
/**
* @description Get rows number value
*
* @property {number} rowsNumber
* @memberof VisibleRangeProfiles
*/
get rowsNumber(): number;
/**
* @description Set rows number value
*
* @property {number} rowsNumber
* @memberof VisibleRangeProfiles
*/
set rowsNumber(value: number);
/**
* @description Get VA percent value
*
* @property {number} VAPercent
* @memberof VisibleRangeProfiles
*/
get VAPercent(): number;
/**
* @description Set VA percent value
*
* @property {number} VAPercent
* @memberof VisibleRangeProfiles
*/
set VAPercent(value: number);
/**
* @description Get step value
*
* @property {number} step
* @memberof VisibleRangeProfiles
*/
get step(): number;
/**
* @description Set step value
*
* @property {number} step
* @memberof VisibleRangeProfiles
*/
set step(value: number);
/**
* @description Get size value
*
* @property {number} size
* @memberof VisibleRangeProfiles
*/
get size(): number;
/**
* @description Set size value
*
* @property {number} size
* @memberof VisibleRangeProfiles
*/
set size(value: number);
/**
* @description subscribe on events
*
* @protected
* @memberof VisibleRangeProfiles
*/
protected subscribe(): void;
/**
* @description unsubscribe on events
*
* @protected
* @memberof VisibelRangeProfiles
*/
protected unsubscribe(): void;
/**
* @description Callback ith new tick to update indicator calculations
*
* @memberof VisibleRangeProfiles
*/
onInputTick(): void;
/**
* @description Callback to initialize indicator
*
* @memberof VisibleRangeProfiles
*/
onInitializeIndicator(): void;
/**
* Get plots
*/
get plots(): Plot[];
/**
* @description Callback to reset indicator settings to default state
*
* @memberof VisibleRangeProfiles
*/
onResetDefaults(): void;
/**
* @description Perform remove indicator
*
* @memberof VisibleRangeProfiles
*/
remove(): void;
/**
* @description Calculate Visible Range Profiles indicator values
*
* @memberof VisibleRangeProfiles
*/
private _calcVPVR;
/**
* @description Calculate segment intersection
* @param {number} y1
* @param {number} y2
* @param {number} y3
* @param {number} y4
* @returns {number} Intersection
* @memberof VisibleRangeProfiles
*/
private _calculateInter;
private setSavedParameters;
private setPlotTheme;
private updatePlotTheme;
}
}
declare module FintaChart {
/**
* @description Provides model of Daily Profiles indicator
*
* @export
* @class DailyProfiles
* @extends {Indicator}
*/
class DailyProfiles extends Indicator {
private _plot;
/**
* @description Get instance type name
*
* @readonly
* @static
* @property {string} instanceTypeName
* @memberof DailyProfiles
*/
static get type(): string;
/**
* @description Get show values in title
*
* @property {boolean} showValuesInTitle
* @memberof DailyProfiles
*/
get showValuesInTitle(): boolean;
/**
* @description Set show values in title
*
* @property {boolean} showValuesInTitle
* @memberof DailyProfiles
*/
set showValuesInTitle(value: boolean);
/**
* @description Get session start hour
*
* @property {number} sessionT0
* @memberof DailyProfiles
*/
get sessionT0(): number;
/**
* @description Set session start hour
*
* @property {boolean} sessionT0
* @memberof DailyProfiles
*/
set sessionT0(value: number);
/**
* @description Get rows number value
*
* @property {number} rowsNumber
* @memberof DailyProfiles
*/
get rowsNumber(): number;
/**
* @description Set rows number value
*
* @property {number} rowsNumber
* @memberof DailyProfiles
*/
set rowsNumber(value: number);
/**
* @description Get VA percent value
*
* @property {number} VAPercent
* @memberof DailyProfiles
*/
get VAPercent(): number;
/**
* @description Set VA percent value
*
* @property {number} VAPercent
* @memberof DailyProfiles
*/
set VAPercent(value: number);
/**
* @description Get step value
*
* @property {number} step
* @memberof DailyProfiles
*/
get step(): number;
/**
* @description Set step value
*
* @property {number} step
* @memberof DailyProfiles
*/
set step(value: number);
/**
* @description Get size value
*
* @property {number} size
* @memberof VisibleRangeProfiles
*/
get size(): number;
/**
* @description Set size value
*
* @property {number} size
* @memberof VisibleRangeProfiles
*/
set size(value: number);
/**
* @description subscribe on events
*
* @protected
* @memberof DailyProfiles
*/
protected subscribe(): void;
/**
* @description unsubscribe on events
*
* @protected
* @memberof DailyProfiles
*/
protected unsubscribe(): void;
/**
* @description Callback ith new tick to update indicator calculations
*
* @memberof DailyProfiles
*/
onInputTick(): void;
/**
* @description Callback to initialize indicator
*
* @memberof DailyProfiles
*/
onInitializeIndicator(): void;
/**
* Get plots
*/
get plots(): Plot[];
/**
* @description Callback to reset indicator settings to default state
*
* @memberof DailyProfiles
*/
onResetDefaults(): void;
/**
* @description Perform remove indicator
*
* @memberof DailyProfiles
*/
remove(): void;
/**
* @description Calculate Daily Profiles indicator values
*
* @memberof DailyProfiles
*/
private _calcVPSV;
/**
* @description Calculate segment intersection
* @param {number} y1
* @param {number} y2
* @param {number} y3
* @param {number} y4
* @returns {number} Intersection
* @memberof DailyProfiles
*/
private _calculateInter;
private setPlotTheme;
private updatePlotTheme;
}
}
declare module FintaChart {
/**
* Represents Trend indicator.
*
* @category Indicators
*/
class Trend extends Indicator {
static get type(): string;
private _emaLow;
private _prevVerticalScaleRange;
private _verticalScaleRange;
get inputDataRowName(): string;
set inputDataRowName(value: string);
/**
* The period.
*/
get period(): number;
set period(value: number);
protected onInitializeIndicator(): void;
protected onResetDefaults(): void;
protected onInputTick(): void;
}
}
declare module FintaChart {
/**
* Represents indicator context menu configuration.
*
*/
interface IIndicatorContextMenuConfig extends IContextMenuConfig {
indicator: Indicator;
}
/**
* Provides model of indicator context menu
*
*/
class IndicatorContextMenu extends ContextMenu {
static readonly MenuItem: {
about: string;
settings: string;
applyIndicator: string;
showParams: string;
showLabels: string;
showTitleValues: string;
visible: string;
delete: string;
mergeUp: string;
mergeDown: string;
unmergeUp: string;
unmergeDown: string;
moveToPrice: string;
lineLevels: string;
};
private static container;
/**
* Creates an instance of IndicatorContextMenu.
*
* @param targetDomObject
* @param config
*/
constructor(targetDomObject: HTMLElement, config: IIndicatorContextMenuConfig);
private applyText;
private initMenu;
private static toggleClass;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
*
*/
interface IIndicatorsOverviewProvider {
getTemplate(indicatorName: string, locale?: string): string;
getTemplatesConfig(locale?: string): IIndicatorsOverviewProviderConfig[];
}
interface IIndicatorsOverviewProviderConfig {
id: string;
name: string;
description: string;
url: string;
setting: string[];
}
}
declare module FintaChart {
}
declare module FintaChart {
type SearchInstrumentPredicate = (query: string, exchange?: string) => Promise;
interface VolumeRules {
min: number;
max: number;
step: number;
unitsPerInput: number;
}
/**
* Represents chart instrument
*/
interface IInstrument {
/**
* Instrument id
*/
id: string;
/**
* Instrument symbol name
*/
symbol: string;
/**
* Instrument company name
*/
company?: string;
/**
* Instrument exchange name
*/
exchange?: string;
/**
* Instrument datafeed
*/
datafeed?: string;
/**
* Instrument type
*/
type?: string;
/**
* Instrument tick size
*/
tickSize?: number;
pricePrecision?: number;
mappingId?: string;
mappings?: unknown;
provider?: string;
/**
* Instrument contract size
*/
contractSize?: number;
/**
* Instrument base currency
*/
baseCurrency?: string;
/**
* Instrument quote currency
*/
currency?: string;
/**
* Instrument kind
*/
kind?: string;
}
class Instrument {
static all(): Promise;
static filter(symbol: string, filter: string[], page: number, size: number): Promise;
static filterById(id: string): Promise;
static equals(left: IInstrument, right: IInstrument): boolean;
static normalizeTickSize(tickSize: number): number;
}
}
declare module FintaChart {
type GetAllExchanges = () => string[];
class Exchange {
static all(): string[];
}
}
declare module FintaChart {
class InstrumentChangePopup {
private _chart;
private _isShown;
private _element;
private _inp_search;
private _resultContainer;
private _currentText;
private _noResults;
private _resultsCount;
private _selectedFilters;
private _page;
private _size;
private _isLoad;
constructor(chart: Chart);
show(value: string): Promise;
hide(): void;
private highlightDropDownItem;
private _loadTemplate;
private _initializePopup;
private _initFields;
private _subscribeEvents;
private _setValue;
private _getInstrumentBySymbol;
private _generateListElement;
private generateExchangeFilters;
private _highlightHTMLText;
private _searchTextPositions;
private _getInputValue;
private _getInstruments;
private _generateSearchResults;
private _search;
private _scrollTopList;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
interface ICompareInstrumentHandlerState {
/**
* base index
*/
baseIndex: number;
/**
* Represents base source
*/
baseSource: CompareInstrumentSource;
/**
* Represents Instrument options
*/
instrumentOptions: IInstrumentCompareSettingsOptions[];
/**
* Previous vertical scale state
*/
previousStateVerticalScale: IVerticalAxisState;
}
/**
* Represents comparing theme handler
*
*/
interface ICompareInstrumentTheme {
/**
* Represents line color
*/
lineColor?: string;
/**
* Represents line style
*/
lineStyle?: string;
/**
* Line width
*/
lineWidth?: number;
/**
* visible
*/
visible?: boolean;
}
/**
*
*/
enum CompareInstrumentSource {
OPEN = ".open",
HIGH = ".high",
LOW = ".low",
CLOSE = ".close"
}
/**
* Represents instrument comparison handler
*
*/
class CompareInstrumentHandler implements IBasePriceHolder, IStateable, IDisposable {
private readonly _chart;
private _basePrice;
private _instrumentsCompare;
private _options;
/**
* Creates an instance of CompareInstrumentHandler.
*
* @param chart
*/
constructor(chart: Chart);
/**
* Get base index
*/
get baseIndex(): number;
set baseIndex(value: number);
/**
* Get base price
*/
get basePrice(): number;
/**
* Get base source
*/
get baseSource(): CompareInstrumentSource;
set baseSource(value: CompareInstrumentSource);
/**
* Get chart
*/
get chart(): Chart;
/**
* Get instrument compare
*/
get instrumentsCompare(): InstrumentCompareSettings[];
/**
* Get pane
*/
get pane(): Pane;
/**
* Get load more history complete
*/
get loadMoreHistoryComplete(): boolean;
/**
* Cancels comparing
*
* @param instrumentsCompare
*/
cancelComparing(...instrumentsCompare: (InstrumentCompareSettings | InstrumentCompareSettings[])[]): void;
/**
* Compares
*
* @param instance
*/
compare(instance: InstrumentCompareSettings): void;
/**
* Creates instance
*
* @param instrument
* @param source
* @param instrumentTheme
*/
createInstance(instrument: IInstrument, source?: CompareInstrumentSource, instrumentTheme?: ICompareInstrumentTheme): InstrumentCompareSettings;
dispose(): void;
restoreState(state: ICompareInstrumentHandlerState): void;
saveState(): ICompareInstrumentHandlerState;
/**
* Refreshes
*
* @param updateInstruments
*/
refresh(updateInstruments?: boolean): void;
private applyPercentageVerticalScale;
private calculateDataRows;
private cancelPercentageVerticalScale;
private onMoreHistoryRequest;
private onTimeFrameChange;
private subscribeEvents;
private unsubscribeEvents;
private updateHoverRecord;
private updateInstruments;
}
}
declare module FintaChart {
/**
* Represents Instrument Compare Settings Config
*
*/
interface IInstrumentCompareSettingsConfig extends IInstrumentCompareSettingsOptions {
/**
* Instrument Compare Settings handler instrument comparison
*/
handlerInstrumentComparison: CompareInstrumentHandler;
}
/**
* Represents Instrument Compare Settings Options
*
*/
interface IInstrumentCompareSettingsOptions {
/**
* Allow about dialog
*/
allowAboutDialog?: boolean;
/**
* Allow check scale vertical floating label
*/
allowCheckVerticalAxisLabel?: boolean;
/**
* Allow settings dialog
*/
allowSettingsDialog?: boolean;
/**
* Instrument Compare Settings instrument
*/
instrument: IInstrument;
/**
* Instrument Compare Settings line color
*/
lineColor?: string;
/**
* Instrument Compare Settings line style
*/
lineStyle?: string;
/**
* Instrument Compare Settings line width
*/
lineWidth?: number;
/**
* Instrument Compare Settings plot
*/
plot?: IPaneObjectState;
/**
* Instrument Compare Settings plot theme
*/
plotTheme?: IPaneTheme & {
visible?: boolean;
};
/**
* Is show title
*/
showTitle?: boolean;
/**
* Instrument Compare Settings source
*/
source: CompareInstrumentSource;
/**
* Is visible
*/
visible?: boolean;
}
/**
* Provides model of Instrument Compare Settings
*
*/
class InstrumentCompareSettings implements IDisposable, IStateable {
/**
* Instrument Compare Setting's defaults
*/
static readonly defaults: {
allowSettingsDialog: boolean;
allowAboutDialog: boolean;
allowCheckVerticalAxisLabel: boolean;
};
private readonly _pane;
private _comparingDelta;
private _currentBarsRequest;
private _newBarsRequest;
private _options;
private _plot;
private _titleContextMenu;
private _titleControls;
private _titleParameters;
private _handlerInstrumentComparison;
private _lastCatchUpAttempt;
private _isCatchingUp;
/**
* Get Instrument Compare Setting's allow about dialog
*/
get allowAboutDialog(): boolean;
set allowAboutDialog(value: boolean);
/**
* Get Instrument Compare Setting's allow check scale vertical floating label
*/
get allowCheckVerticalAxisLabel(): boolean;
set allowCheckVerticalAxisLabel(value: boolean);
/**
* Get Instrument Compare Setting's allow settings dialog
*/
get allowSettingsDialog(): boolean;
set allowSettingsDialog(value: boolean);
/**
* Get Instrument Compare Setting's chart
*/
get chart(): Chart;
/**
* Get Instrument Compare Setting's instrument
*/
get instrument(): IInstrument;
/**
* Get Instrument Compare Setting's line color
*/
get lineColor(): string;
set lineColor(value: string);
/**
* Get Instrument Compare Setting's line style
*/
get lineStyle(): string;
set lineStyle(value: string);
/**
* Get Instrument Compare Setting's line width
*/
get lineWidth(): number;
set lineWidth(value: number);
/**
* Get Instrument Compare Setting's pane
*/
get pane(): Pane;
/**
* Get Instrument Compare Setting's plot
*/
get plot(): LinePlot;
/**
* Get Instrument Compare Setting's ready load more history
*/
get readyLoadMoreHistory(): boolean;
/**
* Set Instrument Compare Setting's show scale vertical floating label
*/
set showVerticalAxisLabel(value: boolean);
get showVerticalAxisLabel(): boolean;
/**
* Get Instrument Compare Setting's show title
*/
get showTitle(): boolean;
set showTitle(value: boolean);
/**
* Get Instrument Compare Setting's source
*/
get source(): CompareInstrumentSource;
set source(value: CompareInstrumentSource);
/**
* Get Instrument Compare Setting's visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Get sanitized symbol
*
* @return {string}
*/
private get sanitizedSymbol();
/**
* Creates an instance of InstrumentCompareSettings.
*
* @param config
*/
constructor(config: IInstrumentCompareSettingsConfig);
/**
* Initializes compare
*/
initializeCompare(): void;
/**
* Calculates data rows
*
* @param baseMasterPrice
* @param fromIndex
* @param toIndex
*/
calculateDataRows(baseMasterPrice: number | null, fromIndex: number, toIndex: number, isComparer?: boolean): boolean;
dispose(): void;
private removeDataRows;
restoreState(state: IInstrumentCompareSettingsOptions): void;
/**
* On more history requests
*/
onMoreHistoryRequest(): void;
/**
* On time frame changes
*/
onTimeFrameChange(): void;
saveState(): IInstrumentCompareSettingsOptions;
/**
* Shows Instrument Compare Setting's dialog
*/
showSettingsDialog(): void;
/**
* Toggles Instrument Compare Setting's visibility
*
* @param visibility
*/
toggleVisibility(visibility: HTMLElement): void;
/**
* Refreshes Instrument Compare Settings
*/
refresh(): void;
/**
* Updates hover record
*
* @param record
*/
updateHoverRecord(record?: number): void;
/**
* Updates Instrument Compare Setting's title controls visibility
*/
updateTitleControlsVisibility(): void;
/**
* Updates Instrument Compare Setting's visibility
*/
updateVisibility(): void;
private initPaneTitle;
private init;
private requestBars;
private requestMoreBars;
private requestCatchUpBars;
private sendBarsRequest;
private setValues;
private synchronize;
private updateTitle;
}
}
declare module FintaChart {
/**
* Represents Compare Context Menu Config
*
*/
export interface ICompareInstrumentContextMenuConfig extends IContextMenuConfig {
/**
* Compare Context Menu Config instrument compare settings
*/
instrumentCompareSettings: InstrumentCompareSettings;
}
enum CompareInstrumentContextMenuItem {
SETTINGS = "settings",
SHOW_FLOATING_LABELS = "showLabels",
VISIBLE = "visible",
DELETE = "delete"
}
/**
* Provides model of Compare Context Menu
*
*/
export class CompareInstrumentContextMenu extends ContextMenu {
private static container;
/**
* Compare Context Menu's menu item
*/
static MenuItem: typeof CompareInstrumentContextMenuItem;
/**
* Creates an instance of CompareInstrumentContextMenu.
*
* @param targetDomObject
* @param config
*/
constructor(targetDomObject: HTMLElement, config: ICompareInstrumentContextMenuConfig);
private init;
private static toggleClass;
}
export {};
}
declare module FintaChart {
}
declare module FintaChart {
/**
* Represents pane config
*/
interface IPaneConfig {
/**
* Options
*/
options?: any;
/**
* Pane container
*/
panesContainer: PanesContainer;
}
/**
* Represents pane theme
*/
interface IPaneTheme {
/**
* Dots
*/
dots: IFillTheme;
/**
* Grid
*/
grid: IStrokeTheme;
/**
* Title
*/
title: ITextTheme;
/**
* Watermark
*/
watermark: IPaneWatermarkTheme;
}
enum PaneMoveDirection {
NONE = "none",
HORIZONTAL = "horizontal",
VERTICAL = "vertical",
ANY = "any"
}
enum PaneMoveKind {
NORMAL = "normal",
AUTOSCALED = "autoscaled"
}
/**
* Describes the payload of the click events fired by a pane and by the chart.
*
* Delivered as the `value` field of the event object:
* `chart.on(ChartEvent.CLICKED, e => console.log(e.value.price, e.value.date))`
*/
interface IChartClickInfo {
/**
* The pane the click happened in.
*/
pane: Pane;
/**
* Whether the clicked pane is the main (price) pane.
*/
isPrimaryPane: boolean;
/**
* The date under the click position.
*/
date: Date;
/**
* The formatted date, as shown on the horizontal axis.
*/
dateText: string;
/**
* The index of the bar (record) under the click position.
* May be out of the data range when clicking the empty space right of the last bar.
*/
bar: number;
/**
* The value of the pane's main vertical scale under the click position.
* On the primary pane this is the price, on an indicator pane it is the indicator value.
*/
price: number;
/**
* The formatted price, as shown on the vertical axis.
*/
priceText: string;
/**
* The click x coordinate, in chart coordinates.
*/
x: number;
/**
* The click y coordinate, relative to the clicked pane.
*/
y: number;
/**
* The original DOM event.
*/
nativeEvent: Event;
}
const PaneEvent: {
THEME_CHANGED: string;
X_GRID_VISIBLE_CHANGED: string;
Y_GRID_VISIBLE_CHANGED: string;
PLOT_ADDED: string;
PLOT_REMOVED: string;
SHAPE_ADDED: string;
OBJECT_ADDED: string;
SHAPE_REMOVED: string;
OBJECT_REMOVED: string;
DOUBLE_CLICKED: string;
CONTEXT_MENU: string;
CLICKED: string;
};
let formatConfig: IPaneTitleMenuConfig | undefined;
/**
* Represents Pane state enum
*/
const enum PaneState {
/**
* Normal state
*/
NORMAL = 0,
/**
* Maximized state
*/
MAXIMIZED = 1
}
interface ITradingSessionRange {
market: string;
startPreSession: string;
startSession: string;
endSession: string;
endAfterSession: string;
timezone?: string;
}
/**
* Bar-info title/card control (the rendered OHLC / volume widgets on a pane).
*/
interface IBarInfoControl {
rootDiv: HTMLElement;
symbol?: HTMLElement;
symbolTitle?: HTMLElement;
date?: HTMLElement;
open: HTMLElement;
high: HTMLElement;
low: HTMLElement;
close: HTMLElement;
dataRows: IBarDataRows;
ltpValue?: HTMLElement;
volume?: HTMLElement;
volumeBarFill?: HTMLElement;
volumeHistBars?: HTMLElement[];
segments?: HTMLElement[];
indicators?: HTMLElement;
sparkline?: HTMLCanvasElement;
footer?: HTMLElement;
change?: HTMLElement;
changePercent?: HTMLElement;
isCard?: boolean;
draggable?: IDraggableController | null;
}
/**
* Persisted state of a pane.
*/
interface IPaneState {
options?: IPaneOptions;
verticalScales?: IVerticalAxisState[];
verticalAxes?: unknown[];
verticalScale?: unknown;
objects?: unknown[];
}
/**
* Config passed to the draggable pane-title initializer.
*/
interface IPaneTitleMenuConfig {
chart: Chart;
showOnClick?: boolean;
onItemSelected?: (menuItem: HTMLElement) => void;
onFormatCostil?: () => void;
}
/**
* Represents pane
*/
class Pane extends HtmlControl implements IStateable {
private static readonly WATERMARK_ORIGINAL_WIDTH;
private static readonly WATERMARK_ORIGINAL_HEIGHT;
private static readonly WATERMARK_SCALE;
private readonly _panesContainer;
private _barInfoControls;
private _braProgressLine;
private _components;
private _contentFrame;
private _controls;
private _layer;
private _objects;
private _options;
private _verticalAxes;
private _settings;
private _titleNeedsUpdate;
private _toggleIndicatorTitles;
private _targetSubscriptions;
private _optimizeRefresh;
private _watermark;
private chartContextMenu;
private tradingContextMenu;
/**
* @class
* @ignore
*/
set _stateof(value: string);
/**
* Get default layout template
*/
get defaultLayoutTemplate(): IPaneTheme;
/**
* Get chart
*/
get chart(): Chart;
/**
* Get compare instruments
*/
get compareInstruments(): InstrumentCompareSettings[];
/**
* Get components
*/
get components(): IPaneHtmlComponent[];
/**
* Get content frame
*/
get contentFrame(): Bounds;
/**
* Get formatter
*/
get formatter(): INumberFormatter;
set formatter(value: INumberFormatter);
/**
* Get height ratio
*/
get heightRatio(): number;
set heightRatio(ratio: number);
/**
* Get indicators
*/
get indicators(): Indicator[];
/**
* Get layer
*/
get layer(): CanvasLayer;
/**
* Get max height ratio
*/
get maxHeightRatio(): number;
set maxHeightRatio(ratio: number);
/**
* Get min height ratio
*/
get minHeightRatio(): number;
set minHeightRatio(ratio: number);
/**
* Get move direction
*/
get moveDirection(): PaneMoveDirection;
set moveDirection(direction: PaneMoveDirection);
/**
* Get move name
*/
get moveKind(): PaneMoveKind;
set moveKind(value: PaneMoveKind);
/**
* Objaects
*/
get objects(): IPaneObject[];
/**
* Get pane padding
*/
get panePadding(): IPadding;
set panePadding(value: IPadding);
/**
* Get panes container
*/
get panesContainer(): PanesContainer;
/**
* Gets plots
*/
get plots(): Plot[];
/**
* Get scale coordinate mapper
*/
get coordinateMapper(): ScaleCoordinateMapper;
/**
* Get vertical scale
*/
get verticalAxis(): VerticalAxis;
/**
* Get vertical scales
*/
get verticalAxes(): VerticalAxis[];
/**
* Get shapes
*/
get shapes(): Shape[];
/**
* Get shapes
*/
get shapesByInstrument(): Shape[];
get positions(): PositionBar[];
get orders(): OrderBar[];
get alerts(): AlertBar[];
/**
* Get show compare titles
*/
get showCompareTitles(): boolean;
set showCompareTitles(value: boolean);
/**
* Get show indicator titles
*/
get showIndicatorTitles(): boolean;
set showIndicatorTitles(value: boolean);
/**
* Get state
*/
get state(): PaneState;
set state(value: PaneState);
/**
* Get theme
*/
get theme(): IPaneTheme;
set theme(value: IPaneTheme);
/**
* Get title div
*/
get titleDiv(): HTMLElement;
/**
* Get visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Get grid x
*/
get gridX(): boolean;
set gridX(visible: boolean);
/**
* Set grid y
*/
set gridY(visible: boolean);
get gridY(): boolean;
get isPreservingAutoScaling(): boolean;
/**
* Creates an instance of Pane.
*
* @param config
*/
constructor(config: IPaneConfig);
/**
* Adds component
*
* @param component
*/
addComponent(component: IPaneHtmlComponent): void;
/**
* Adds objects
*
* @param objects
*/
addObjects(objects: IPaneObject | IPaneObject[]): any;
/**
* Attaches an indicator to this specific pane.
*
* Pins the indicator's pane before `chart.addIndicators(...)` runs
* the auto-routing, so the indicator lands here regardless of its
* `isOverlay` declaration. Use to force an overlay-style indicator
* onto a separate pane, or to drop an oscillator-style one onto
* the price pane.
*
* @param indicator Indicator instance to add.
* @return The added indicator.
*/
addIndicator(indicator: Indicator): Indicator;
/**
* Adds a single shape to the pane (convenience alias for
* `addShapes` when working with one shape at a time).
*
* @param shape Shape instance to add.
*/
addShape(shape: Shape): void;
/**
* Adds plots
*
* @param plots
*/
addPlot(plots: Plot | Plot[]): any;
/**
* Adds shapes
*
* @param shapes
*/
addShapes(shapes: Shape | Shape[]): any;
/**
* Returns auto scaled min max
*
* @param verticalScale
*/
autoScaledMinMax(verticalScale: VerticalScale): IMinMax;
/**
* Returns is object contains
*
* @param object
*/
containsObject(object: IPaneObject): boolean;
/**
* Returns is plot contains
*
* @param plot
*/
containsPlot(plot: Plot): boolean;
/**
* Returns is shape contains
*
* @param shape
*/
containsShape(shape: Shape): boolean;
dispose(): void;
paint(): void;
/**
* Returns true when a shape is fully outside the visible frame and
* safe to skip. Extrapolated shapes (lines/rays) and selected shapes
* are never culled since they can extend across the viewport.
* Uses bounds when available (accurate for text/balloon), otherwise
* falls back to points X-check with original buffer (frame.width) to
* avoid culling shapes whose visual extends beyond points.
*/
private isShapeOffscreen;
/** Shape types that extend beyond their points and must not be culled. */
private static NON_CULLABLE_SHAPES;
static pGrid: number;
static pObjects: number;
static pIndicators: number;
static pHover: number;
static pWatermark: number;
/**
* Executes shapes
*
* @param shapes
*/
executeShapes(shapes: Shape | Shape[]): any;
/**
* Force removes shapes
*
* @param shapes
*/
forceRemoveShapes(shapes?: Shape | Shape[]): any;
/**
* Formats value
*
* @param value
*/
formatValue(value: number): string;
/**
* Formats a volume value in a compact form (e.g. 1.03M, 12.4K).
*
* @param value
*/
formatVolume(value: number): string;
/**
* Returns index
*
* @return
*/
getIndex(): number;
/**
* Returns scale coordinate mapper
*
* @param verticalScale
* @return
*/
getCoordinateMapper(verticalScale: VerticalScale): ScaleCoordinateMapper;
/**
* Returns vertical scale
*
* @param verticalScale
* @return
*/
getVerticalAxis(verticalScale: VerticalScale): VerticalAxis;
/**
* Returns get shapes between dates
*
* @param startDate
* @param endDate
* @return
*/
getShapesBetweenDates(startDate: Date, endDate: Date): Shape[];
onEvent(event: IWindowEvent): boolean;
hitTest(point: IPoint): boolean;
resize(frame: Bounds): void;
restoreState(state: IPaneState): void;
/**
* Returns min max
*
* @param startIndex
* @param count
* @param verticalScale
* @return
*/
minMax(startIndex: number, count: number, verticalScale: VerticalScale): IMinMax;
/**
* Returns preferred scale vertical width
*
* @param chartScale
* @return
*/
preferredVerticalScaleWidth(chartScale: VerticalScale): number;
/**
* Removes component
*
* @param component
*/
removeComponent(component: IPaneHtmlComponent): void;
/**
* Removes objects
*
* @param objects
*/
removeObjects(objects?: IPaneObject | IPaneObject[]): any;
/**
* Removes plots
* plots
*/
removePlot(plots: Plot | Plot[]): any;
/**
* Removes shapes
*
* @param shapes
*/
removeShapes(shapes?: Shape | Shape[]): any;
/**
* Renders bar progress
*
* @param visible
* @param countRects
* @param intervalInMs
* @param coloredBars
* @return
*/
paintBarProgress(visible: boolean, countRects: number, intervalInMs: number, coloredBars: boolean): void;
/**
* Renders triangle for last bar
*
* @param visible
* @param coloredBars
* @return
*/
paintTriangleForLastBar(visible: boolean, coloredBars: boolean): void;
/**
* Renders triangle for last bar
*
* @param visible
* @param coloredBars
* @return
*/
paintLineForLastBar(visible: boolean, coloredBars: boolean): void;
saveState(): IPaneState;
/**
* Sets height ratio
*
* @param ratio
*/
setHeightRatio(ratio: number): void;
/**
* Refreshes scale async
*/
refreshScaleAsync(): void;
/**
* Refreshes async
*
* @param makeAutoScale
*/
refreshAsync(makeAutoScale?: boolean): void;
/**
* Shows chart type format dialog
*/
showChartTypeFormatDialog(): void;
/**
* Undoes shapes
*
* @param shapes
*/
unExecuteShapes(shapes?: Shape | Shape[]): void;
/**
* Refreshes
*/
refresh(): void;
/**
* Updates hover record
*
* @param record
* @return
*/
private _lastHoverKey;
updateHoverRecord(record?: number): void;
/**
* Fills the OHLC card indicator rows for the hovered record.
*
* @param control The card's bar-info control.
* @param record The hovered record index.
*/
private renderOhlcCardIndicators;
/**
* Renders the live graphics of an OHLC info card: the volume bar (as a
* fraction of the max visible volume) and the price sparkline (the last
* N closes up to the hovered record).
*
* @param control The card's bar-info control.
* @param record The hovered record index.
* @param color The up/down colour for the current bar.
*/
private renderOhlcCardGraphics;
/**
* Draws a price sparkline onto a canvas, scaling to its CSS size and
* device pixel ratio for a crisp line.
*/
private drawSparkline;
preserveAutoScaling(): void;
cancelAutoScaling(): void;
verticalAxisLabelMaxWidth(verticalAxis: VerticalAxis): number;
applyLogoWatermark(): void;
protected createContainer(): HTMLElement;
protected initMotionEvents(): MotionEventArray;
/**
* Subscribes
*/
protected subscribe(): void;
protected unsubscribe(): void;
private onOptimizeRefreshCallback;
private setupLayoutTheme;
private paintGridLines;
private invoke;
/**
* Subscribes to events fired with this pane as their target
* (e.g. `PaneEvent.PLOT_ADDED` from this specific pane, not any).
*
* Routes through the chart's event emitter and filters by
* `event.target === this`.
*
* @param events Space-delimited event name(s).
* @param handler Listener invoked with the matching event.
*/
on(events: string, handler: IEventHandler): Pane;
/**
* Unsubscribes from events previously registered via `on`.
*/
off(events?: string, handler?: IEventHandler): Pane;
private getHeight;
private getWidth;
private onClick;
/**
* Fires PaneEvent.CLICKED and ChartEvent.CLICKED with the date and the value
* under the click position.
*
* @param event
*/
private invokeClickEvent;
onContextMenu(motionEvent: MotionEvent, event: IWindowEvent): void;
private onDoubleClick;
private onMouseHover;
private onMove;
private onMouseWheel;
private onPinchZoom;
private onClickInternal;
private initInstrumentPaneTitle;
private initPaneTitle;
private initDraggablePaneTitle;
private initOHLCCard;
private layoutHtmlElements;
private motionHitTest;
private updateInstrument;
private writeWatermark;
private _tradingSessionHoursParameters;
private _visualizeAfterMarketHours;
private _visualizePreMarketHours;
private _visualizeCloseMarketHours;
private _roundMarketSessionByTimeframe;
private _fillMarketArea;
private _getMinutes;
}
}
declare module FintaChart {
/**
* Represents Pane Html Component
*/
interface IPaneHtmlComponent extends IHtmlComponent {
/**
* Pane Html Component pane
*/
pane: Pane;
}
/**
* Represents Pane Html Component Config
*/
interface IPaneHtmlComponentConfig {
/**
* Pane Html Component Config pane
*/
pane?: Pane;
}
/**
* Provides model of Pane Html Component
*/
abstract class PaneHtmlComponent extends HtmlComponent implements IPaneHtmlComponent {
private _pane;
/**
* Get Pane Html Component chart
*/
get chart(): Chart;
/**
* Get Pane Html Component pane
*/
get pane(): Pane;
set pane(value: Pane);
/**
* Creates an instance of PaneHtmlComponent.
*
* @param config
*/
constructor(config?: IPaneHtmlComponentConfig);
dispose(): void;
/**
* On Pane Html Component pane changing
*/
protected onPaneChanging(): void;
/**
* On Pane Html Component pane changed
*/
protected onPaneChanged(): void;
/**
* Subscribes Pane Html Component
*/
protected subscribe?(): void;
/**
* Unsubscribes Pane Html Component
*/
protected unsubscribe?(): void;
}
}
declare module FintaChart {
/**
* Represents base pane
*/
interface IPaneObject extends IDisposable, IStateable {
/**
* Chart
*/
chart: Chart;
/**
* Pane
*/
pane: Pane;
/**
* Scale coordinate mapper
*/
coordinateMapper: ScaleCoordinateMapper;
/**
* scale vertical
*/
verticalScale: VerticalScale;
/**
* Tooltip
*/
tooltip: Tooltip;
zIndex: number;
visible: boolean;
paintVerticalAxisLabels(): void;
getVerticalAxisLabelMaxWidth(): number;
paint(): void;
}
/**
* Represents Pane base config
*/
interface IPaneObjectConfig {
/**
* Options
*/
options?: IPaneObjectOptions;
}
/**
* Represents Pane base Options
*/
interface IPaneObjectOptions {
/**
* Scale vertical index
*/
verticalScaleIndex: number;
/**
* Visible
*/
visible: boolean;
/**
* Z-index
*/
zIndex: number;
}
/**
* Represents pane base state
*/
interface IPaneObjectState {
/**
* Options
*/
options?: IPaneObjectOptions;
/**
* Pane index
*/
paneIndex?: number;
/**
* Scale vertical index
*/
verticalScaleIndex?: number;
/**
* Tooltip
*/
tooltip?: ITooltipState;
}
/**
* Represents pane base
*/
abstract class PaneObject extends Eventable implements IPaneObject, IDisposable {
private _pane;
private _prevCursor;
private _verticalScale;
private _tooltip;
private _options;
/**
* Creates an instance of PaneObject.
*
* @param config
*/
protected constructor(config?: IPaneObjectConfig);
protected get options(): TOptions;
protected set options(value: TOptions);
/**
* Get chart
*/
get chart(): Chart;
/**
* Get pane
*/
get pane(): Pane;
set pane(value: Pane);
/**
* Get pane scale vertical
*/
get verticalAxis(): VerticalAxis;
/**
* Get scale coordinate mapper
*/
get coordinateMapper(): ScaleCoordinateMapper;
/**
* Get scale vertical
*/
get verticalScale(): VerticalScale;
set verticalScale(value: VerticalScale);
/**
* Get tooltip
*/
get tooltip(): Tooltip;
set tooltip(tooltip: Tooltip);
/**
* Get visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Get z-index
*/
get zIndex(): number;
set zIndex(value: number);
/**
* Get render
*/
protected get renderer(): IRenderer;
/**
* Adds chart css class
*
* @param cssClass
*/
addChartCssClass(cssClass: string): void;
/**
* Changes cursor
*
* @param cursorCssClass
*/
changeCursor(cursorCssClass?: string): void;
dispose(): void;
/**
* Paints
*/
paint(): void;
/**
* Draws scale vertical floating labels
*/
paintVerticalAxisLabels(): void;
getVerticalAxisLabelMaxWidth(): number;
/**
* Hide tooltip
*/
hideTooltip(): void;
saveState(): IPaneObjectState;
restoreState(state: IPaneObjectState): void;
/**
* Removes chart css class
*
* @param cssClass
*/
removeChartCssClass(cssClass: string): void;
private mapColorsToStrings;
/**
* Shows tooltip
*
* @param point
* @return
*/
showTooltip(point: IPoint): void;
/**
* Handles pane changes
*
* @param oldValue
*/
protected onPaneChanged(oldValue: Pane): void;
/**
* Handles vertical scale changes
*
* @param oldValue
*/
protected onVerticalScaleChanged(oldValue: VerticalScale): void;
/**
* Handles visibility changes
*
* @param oldValue
*/
protected onVisibleChanged(oldValue: boolean): void;
/**
* Sets options
*
* @param key
* @param value
* @param valueChangedEventName
*/
protected setOption(key: string, value: any, valueChangedEventName?: string): void;
}
}
declare module FintaChart {
/**
* Pane container state
*/
interface IPanesContainerState {
/**
* Default height ration
*/
defaultHeightRatio?: number;
/**
* Pane padding
*/
panePadding?: IPadding;
/**
* Panes
*/
panes?: IPaneState[];
}
/**
* Represents Pane container
*/
class PanesContainer extends ChartHtmlControl implements IStateable {
private _options;
private _panes;
private _panesContentFrame;
private _splitters;
/**
* Creates an instance of PanesContainer.
*
* @param config
*/
constructor(config: IChartHtmlControlConfig);
/**
* Get default height ration
*/
get defaultHeightRatio(): number;
set defaultHeightRatio(value: number);
/**
* Get pane padding
*/
get panePadding(): IPadding;
set panePadding(value: IPadding);
/**
* Get panes
*/
get panes(): Pane[];
/**
* Panes content frame
*/
get panesContentFrame(): Bounds;
saveState(): IPanesContainerState;
restoreState(state: IPanesContainerState): void;
/**
* Adds pane
*
* @param index
* @param heightRatio
* @param reduceHeightPrimaryPane
* @return
*/
addPane(index?: number, heightRatio?: number, reduceHeightPrimaryPane?: boolean): Pane;
dispose(): void;
paint(): void;
/**
* Finds pane at
*
* @param y
* @return
*/
findPaneAt(y: number): Pane;
onEvent(event: IWindowEvent): boolean;
resize(frame: IBounds): void;
/**
* Returns layout scale pane
*
* @param panesFrame
* @return
*/
layoutScalePane(panesFrame: Bounds): Bounds;
/**
* Update layout split pane
*
* @param splitter
*/
layoutSplitterPanes(splitter: IPaneSplitter): void;
/**
* Move panes
*
* @param pane
* @param offset
*/
movePane(pane: Pane, offset: number): void;
/**
* Remove pane
*
* @param selectedPane
*/
removePane(selectedPane: number | Pane): void;
/**
* Refreshes auto scale async
*/
refreshAutoScaleAsync(): void;
/**
* Sets pane height ratio
*
* @param pane
* @param ratio
*/
setPaneHeightRatio(pane: Pane, ratio: number): void;
/**
* Returns total pane height
*
* @return
*/
totalPanesHeight(): number;
protected createContainer(): HTMLElement;
protected initMotionEvents(): MotionEventArray;
protected subscribe(): void;
protected unsubscribe(): void;
private adjustHeightRatiosToEncloseNewRatio;
private availableHeightRatio;
private onMouseHover;
private mouseHoverHitTest;
private updateSplitters;
private layoutMaxPane;
private layoutNormalPanes;
}
}
declare module FintaChart {
}
declare module FintaChart {
interface IPaneSplitter extends IHtmlControl {
/**
* The top pane.
*/
readonly topPane: Pane;
/**
* The bottom pane.
*/
readonly bottomPane: Pane;
/**
* Invalidates splitter theme.
*/
invalidateTheme(): void;
/**
* Sets panes.
*
* @param top The top pane.
* @param bottom The bottom pane.
*/
panes(top: Pane, bottom: Pane): void;
}
/**
* Represents pane splitter
*/
class PaneSplitter extends HtmlControl implements IPaneSplitter {
private _bottomPane;
private _isMoving;
private _needsTheme;
private _prevChartState;
private _topPane;
static get height(): number;
get topPane(): Pane;
get bottomPane(): Pane;
/**
* The parent chart.
*/
private get chart();
panes(top: Pane, bottom: Pane): void;
invalidateTheme(): void;
hitTest(point: IPoint): boolean;
resize(frame: Bounds): void;
protected createContainer(): HTMLElement;
protected initMotionEvents(): MotionEventArray;
private applyTheme;
private onMouseHover;
private onMove;
private startMove;
private stopMove;
private move;
}
}
declare module FintaChart {
/**
* Represents break line config
*/
interface IBreakLinesConfig extends IPaneObjectConfig {
/**
* Break lines handler
*/
handler: BreakLinesHandler;
}
/**
* Represents break lines
*/
interface IBreakLines extends IPaneObject {
}
/**
* Represents break lines
*/
class BreakLines extends PaneObject implements IBreakLines {
private readonly _handler;
/**
* Creates an instance of BreakLines.
*
* @param config
*/
constructor(config: IBreakLinesConfig);
paint(): void;
}
}
declare module FintaChart {
type BreakLinesDatePredicate = (date: Date) => boolean;
/**
* Represents time part
*/
interface ITimePart {
/**
* Hours
*/
hours: number;
/**
* Minutes
*/
minutes: number;
}
/**
* Represents break line handler config
*/
interface IBreakLinesHandlerConfig extends IChartComponentConfig {
/**
* Date filter
*/
dateFilter?: BreakLinesDatePredicate;
/**
* Theme
*/
theme?: IStrokeTheme;
/**
* Time
*/
time?: ITimePart;
/**
* Visible
*/
visible?: boolean;
}
/**
* Represents brake lines handler
*/
interface IBreakLinesHandler extends IChartComponent {
/**
* Date filter
*/
dateFilter?: BreakLinesDatePredicate;
/**
* Theme
*/
theme: IStrokeTheme;
/**
* Time
*/
time: ITimePart;
/**
* Visible
*/
visible: boolean;
}
/**
* Represents brake lines handler
*/
class BreakLinesHandler extends ChartComponent implements IBreakLinesHandler {
private readonly _breakLines;
private _time;
theme: IStrokeTheme;
dateFilter: BreakLinesDatePredicate;
/**
* Creates an instance of BreakLinesHandler.
*
* @param config
*/
constructor(config: IBreakLinesHandlerConfig);
/**
* Get pane
*/
get pane(): Pane;
get time(): ITimePart;
set time(value: ITimePart);
get visible(): boolean;
set visible(value: boolean);
/**
* Initializes visual dimensions
*/
InitializeVisualDimensions(): void;
}
}
declare module FintaChart {
/**
* Represents pickup column theme
*/
interface IPickupColumnTheme {
/**
* Fill
*/
fill: IFillTheme;
}
/**
* Represents pickup column config
*/
interface IPickupColumnConfig {
/**
* Date
*/
date: Date;
/**
* Theme
*/
theme?: IPickupColumnTheme;
}
/**
* Represents pickup column
*/
class PickupColumn extends PaneObject {
private readonly _date;
theme: IPickupColumnTheme;
/**
* Get default layout template
*/
get defaultLayoutTemplate(): IPickupColumnTheme;
/**
* Get date
*/
get date(): Date;
/**
* Creates an instance of PickupColumn.
*
* @param config
*/
constructor(config: IPickupColumnConfig);
paint(): void;
dispose(): void;
/**
* Checks date
*
* @param date
* @return
*/
checkDate(date: Date): boolean;
}
}
declare module FintaChart {
type TBarColumn = number | Date | IBar;
/**
* Represents pickup column item
*/
interface IPickupColumnItem {
/**
* Column
*/
column: TBarColumn;
/**
* Theme
*/
theme?: IPickupColumnTheme;
}
type TPickupColumn = TBarColumn | IPickupColumnItem;
/**
* Represents pickup column handler
*/
class PickupColumnHandler extends Control {
private _chart;
private _pickupColumns;
private _visible;
/**
* Creates an instance of PickupColumnHandler.
*
* @param chart
*/
constructor(chart: Chart);
/**
* Get chart
*/
get chart(): Chart;
/**
* Get pane
*/
get pane(): Pane;
/**
* Get pickup columns
*/
get pickupColumns(): PickupColumn[];
/**
* Get visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Adds columns
*
* @param columns
*/
add(...columns: (TPickupColumn)[]): void;
/**
* Removes columns
*
* @param columns
*/
remove(...columns: (TBarColumn)[]): void;
dispose(): void;
protected initMotionEvents(): MotionEventArray;
private addColumn;
private removeColumn;
private clickHitTest;
private onClick;
private findIndex;
private toggle;
}
}
declare module FintaChart {
/**
* Represents pricing line config
*/
export interface IPriceLineConfig extends IPaneObjectConfig {
/**
* Stretch
*/
stretch?: boolean;
/**
* Point
*/
point?: IDataPoint;
/**
* Theme
*/
theme?: IStrokeTheme;
/**
* Visible
*/
visible?: boolean;
}
/**
* Represents pricing line
*/
export interface IPriceLine extends IPaneObject {
/**
* Stretch
*/
stretch: boolean;
/**
* Point
*/
point: DataPoint;
/**
* Theme
*/
theme: IStrokeTheme;
}
/**
* Represents pricing line option
*/
interface IPriceLineOptions extends IPaneObjectOptions {
/**
* Stretch
*/
stretch: boolean;
/**
* Point
*/
point: DataPoint;
/**
* Theme
*/
theme: IStrokeTheme;
}
/**
* Pricing line
*/
export class PriceLine extends PaneObject implements IPriceLine {
/**
* Get stretch
*/
get stretch(): boolean;
set stretch(value: boolean);
/**
* Get point
*/
get point(): DataPoint;
set point(value: DataPoint);
/**
* Get theme
*/
get theme(): IStrokeTheme;
set theme(value: IStrokeTheme);
/**
* Creates an instance of PriceLine.
*
* @param config
*/
constructor(config: IPriceLineConfig);
paint(): void;
restoreState(state: IPaneObjectState): void;
}
export {};
}
declare module FintaChart {
/**
* Describes price spread theme.
*/
interface IPriceSpreadTheme {
/**
* The ask line theme.
*/
ask?: {
line?: IStrokeTheme;
label?: {
fill?: IFillTheme;
text?: ITextTheme;
};
};
/**
* The bid line theme.
*/
bid?: {
line?: IStrokeTheme;
label?: {
fill?: IFillTheme;
text?: ITextTheme;
};
};
}
/**
* Represents price spread config
*/
interface IPriceSpreadConfig extends IPaneObjectConfig {
/**
* Ask
*/
ask?: number;
/**
* Bid
*/
bid?: number;
/**
* Theme
*/
theme?: IPriceSpreadTheme;
}
/**
* Represents price spread
*/
interface IPriceSpread extends IPaneObject {
/**
* Ask
*/
ask: number;
/**
* Bid
*/
bid: number;
/**
* Theme
*/
theme: IPriceSpreadTheme;
}
/**
* Represents price spread options
*/
interface IPriceSpreadOptions extends IPaneObjectOptions {
/**
* Ask
*/
ask?: number;
/**
* Bid
*/
bid?: number;
/**
* Theme
*/
theme?: IPriceSpreadTheme;
}
/**
* Represents price spread
*/
class PriceSpread extends PaneObject implements IPriceSpread {
/**
* Get ask
*/
get ask(): number;
set ask(value: number);
/**
* Get bid
*/
get bid(): number;
set bid(value: number);
/**
* Get theme
*/
get theme(): IPriceSpreadTheme;
set theme(value: IPriceSpreadTheme);
/**
* Creates an instance of PriceSpread.
*
* @param config
*/
constructor(config?: IPriceSpreadConfig);
paint(): void;
paintVerticalAxisLabels(): void;
}
}
declare module FintaChart {
/**
* Represents price spread handler config
*/
interface IPriceSpreadHandlerConfig extends IChartComponentConfig {
/**
* Ask
*/
ask?: number;
/**
* Bid
*/
bid?: number;
/**
* Theme
*/
theme?: IPriceSpreadTheme;
}
/**
* Represents price spread handler
*/
interface IPriceSpreadHandler extends IChartComponent {
/**
* Ask
*/
ask: number;
/**
* Bid
*/
bid: number;
/**
* Theme
*/
theme: IPriceSpreadTheme;
/**
* Visible
*/
visible: boolean;
}
/**
* Represents price spread handler
*/
class PriceSpreadHandler extends ChartComponent implements IPriceSpreadHandler {
private _priceSpread;
/**
* Creates an instance of PriceSpreadHandler.
*
* @param config
*/
constructor(config: IPriceSpreadHandlerConfig);
/**
* Get ask
*/
get ask(): number;
set ask(value: number);
/**
* Get bid
*/
get bid(): number;
set bid(value: number);
/**
* Get pane
*/
get pane(): Pane;
/**
* Get theme
*/
get theme(): IPriceSpreadTheme;
set theme(value: IPriceSpreadTheme);
/**
* Get visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Initializes visual dimensions
*/
InitializeVisualDimensions(): void;
}
}
declare module FintaChart {
/**
* Represents Pane Watermark Theme
*/
interface IPaneWatermarkTheme {
/**
* Pane Watermark Theme's text
*/
text: ITextTheme;
}
/**
* Provides model of Pane Watermark
*/
abstract class PaneWatermark extends PaneHtmlComponent {
protected createContainer(): HTMLElement;
}
}
declare module FintaChart {
/**
* Represents Instrument Watermark Theme
*/
interface IInstrumentWatermarkTheme {
/**
* Instrument Watermark Theme's details
*/
details: ITextTheme;
/**
* Instrument Watermark Theme's symbol
*/
symbol: ITextTheme;
}
/**
* Provides model of Instrument Watermark
*/
class InstrumentWatermark extends PaneWatermark {
/**
* Instrument Watermark's theme
*/
theme: IInstrumentWatermarkTheme;
/**
* Retrieves Instrument Watermark's default layout template
*/
defaultLayoutTemplate(): IInstrumentWatermarkTheme;
/**
* Applies Instrument Watermark's text
*/
applyText(): void;
applyTheme(): void;
refresh(): void;
protected createContainer(): HTMLElement;
protected subscribe(): void;
protected unsubscribe(): void;
}
}
declare module FintaChart {
/**
* Represents Text Watermark Config
*/
interface ITextWatermarkConfig extends IPaneHtmlComponentConfig {
/**
* Text Watermark Config text
*/
text?: string;
/**
* Text Watermark Config theme
*/
theme?: IPaneWatermarkTheme;
}
/**
* Provides model of Text Watermark
*/
class TextWatermark extends PaneWatermark {
/**
* Text Watermark's text
*/
text: string;
/**
* Text Watermark's theme
*/
theme: IPaneWatermarkTheme;
/**
* Get Text Watermark's default layout template
*/
get defaultLayoutTemplate(): IPaneWatermarkTheme;
/**
* Creates an instance of TextWatermark.
*
* @param config
*/
constructor(config?: ITextWatermarkConfig);
applyTheme(): void;
refresh(): void;
/**
* Applies Text Watermark's text
*/
private applyText;
}
}
declare module FintaChart {
}
declare module FintaChart {
/**
* @category Market events
*/
enum CalendarEventVolatility {
VERY_LOW = 1,
LOW = 2,
MEDIUM = 3,
HIGH = 4,
VERY_HIGH = 5
}
/**
* @category Market events
*/
enum MarketEventType {
ECONOMICAL = 0,
SIMPLE = 1
}
/**
* @category Market events
*/
interface IMarketEvent {
id: string;
title: string;
time: number;
type: MarketEventType;
groupingId: string;
volatility: CalendarEventVolatility;
iconUrl: string;
priority?: number;
}
/**
* @category Market events
*/
interface IEconomicalMarketEvent extends IMarketEvent {
actual: string;
consensus: string;
previous: string;
}
}
declare module FintaChart {
/**
* @category Market events
*/
interface IMarketEventPopupBuilder {
createPopupElement(event: IMarketEvent, chart: Chart): Promise;
}
}
declare module FintaChart {
/**
* @category Market events
*/
interface IMarketEventsRequest {
instrument: IInstrument;
fromDate: number;
toDate: number;
}
/**
* @category Market events
*/
class MarketEventsDatafeed {
protected eventsManager: MarketEventsManager;
private _requestId;
init(eventsManager: MarketEventsManager): void;
loadEvents(params: IMarketEventsRequest): Promise;
setEvents(events: IMarketEvent[]): void;
addEvents(events: IMarketEvent[]): void;
updateEvents(events: IMarketEvent[]): void;
removeEvents(eventIds: string[]): void;
protected load(params: IMarketEventsRequest): Promise;
}
}
declare module FintaChart {
}
declare module FintaChart {
}
declare module FintaChart {
/**
* @category Market events
*/
enum CalendarEventsVisibilityMode {
ALL = 0,
FUTURE = 1,
NONE = 2
}
/**
* @category Market events
*/
interface IMarketEventsManagerConfig {
chart: Chart;
visibilityMode?: CalendarEventsVisibilityMode;
}
interface IMarketEventsManagerState {
visibilityMode: CalendarEventsVisibilityMode;
}
/**
* @category Market events
*/
class MarketEventsManager implements IDisposable, IStateable {
private _config;
private readonly _chart;
private _events;
private _eventsGroups;
private _visibleEventsGroups;
private _selectedEventsGroupId;
private _calendarEventsGroupDrawing;
private _visibilityMode;
get visibilityMode(): CalendarEventsVisibilityMode;
set visibilityMode(value: CalendarEventsVisibilityMode);
get eventsDatafeed(): MarketEventsDatafeed;
get chart(): Chart;
get events(): IMarketEvent[];
constructor(config: IMarketEventsManagerConfig);
dispose(): void;
saveState(): IMarketEventsManagerState;
restoreState(state: IMarketEventsManagerState): void;
setEvents(events: IMarketEvent[]): void;
addEvents(events: IMarketEvent[]): void;
removeEvents(eventIds: string[]): void;
updateEvents(events: IMarketEvent[]): void;
clear(): void;
private setEventsInternal;
handleEvent(event: IWindowEvent): boolean;
private onNewBarsAppended;
private onMoreBarsLoaded;
private onNewBarsSet;
private onChartTypeApplied;
private onVisibilityModeChange;
private setGroupsToDrawing;
private stackGroups;
private static sortGroupsByPriority;
private subscribe;
private onSelectedGroupChange;
private onPaneMaximized;
private onReplayModeStartRecord;
private onReplayModeStopped;
private setSelectedGroup;
private combineEventsToGroups;
private constructEventsGroup;
private getEventsGroupDate;
private getVisibleEventsGroups;
private needShowGroup;
}
}
declare module FintaChart {
}
declare module FintaChart {
interface IBarCountdown extends IDisposable {
shouldShow(): boolean;
text(): string;
}
class BarCountdown implements IBarCountdown {
private readonly _interval;
private readonly _chart;
private _lastText;
constructor(chart: Chart);
shouldShow(): boolean;
text(): string;
dispose(): void;
private static currentTime;
private static format;
}
}
declare module FintaChart {
interface IChartSnapshotHandler extends IChartComponent {
/**
* Returns snapshot file name.
*
* @return Snapshot file name.
*/
name(): string;
/**
* Saves chart snapshot.
*/
save(): void;
/**
* Saves chart snapshot to clipboard.
*/
saveToClipboard(): void;
}
/**
* Represents handler to create chart snapshot.
*/
class ChartSnapshotHandler extends ChartComponent implements IChartSnapshotHandler {
name(): string;
save(): void;
saveToClipboard(): void;
private writeBlobToClipboard;
private fallbackDownload;
private showChartMessage;
/**
* Composites the chart's own canvas layers into one bitmap.
* Far cheaper than serializing the whole DOM. Returns null when
* no canvases are found so the caller can fall back.
*/
private compositeCanvasLayers;
private createSnapshot;
private saveImage;
/**
* Returns a human-readable reason why the clipboard cannot be used,
* or `null` when a clipboard write may be attempted.
*/
private clipboardUnavailableReason;
private addBorders;
private trimTransparentMargins;
private loadImage;
}
}
declare module FintaChart {
/**
* Describes theme of the object's hover marker.
*/
interface IHoverMarkerTheme {
/**
* The fill theme.
*/
fill: IFillTheme;
/**
* The border theme.
*/
line: IStrokeTheme;
}
/**
* Describes object's hover marker.
*/
interface IHoverMarker extends IChartComponent {
/**
* The theme.
*/
readonly paintTheme: IHoverMarkerTheme;
/**
* The theme.
*/
theme: IHoverMarkerTheme;
/**
* The width of the marker.
*/
radius: number;
/**
* Paints hover marker.
*
* @param renderer The renderer.
* @param point The point to render marker at.
*/
paint(renderer: IRenderer, point: IPoint | IPoint[]): void;
}
/**
* Describes hover marker configuration.
*/
interface IHoverMarkerConfig {
/**
* The parent chart.
*/
chart: Chart;
/**
* The theme.
*/
theme?: IHoverMarkerTheme;
/**
* The width.
*/
radius?: number;
/**
* The width.
*/
width?: number;
}
/**
* Represents object's hover marker.
*/
class HoverMarker extends ChartComponent implements IHoverMarker {
theme: IHoverMarkerTheme;
radius: number;
width: number;
/**
* Get hover dots brush's default layout template
*/
get paintTheme(): IHoverMarkerTheme;
/**
* Creates an instance of [[HoverMarker]].
*
* @param config The hover marker configuration.
*/
constructor(config: IHoverMarkerConfig);
paint(renderer: IRenderer, points: IPoint | IPoint[]): void;
private paintMarker;
}
}
declare module FintaChart {
/**
* Describes chart state handler.
*/
interface IChartStateHandler extends IChartComponent {
/**
* The flag that indicates whether the state should be loaded automatically.
*/
autoLoad: boolean;
/**
* The flag that indicates whether the state should be saved automatically.
*/
autoSave: boolean;
/**
* Saves chart state.
*
* @return Promise.
*/
save(): Promise;
/**
* Loads chart state.
*
* @return Promise that is resolved to the flag that indicates whether the state has been loaded successfully.
*/
load(): Promise;
/**
* Clears saved chart state.
*
* @return Promise.
*/
clear(): Promise;
}
}
declare module FintaChart {
/**
* Describes chart state handler that works with local storage.
*/
interface ILocalStorageChartStateHandlerConfig extends IChartComponentConfig {
/**
* The flag that indicates whether chart state should be stored automatically.
*/
autoSave?: boolean;
/**
* The flag that indicates whether chart state should be loaded automatically.
*/
autoLoad?: boolean;
}
/**
* Represents chart state handler that works with local storage.
*/
class LocalStorageChartStateHandler extends ChartComponent implements IChartStateHandler {
autoLoad: boolean;
autoSave: boolean;
private _boundOnBeforeUnload;
/**
* Creates an instance of [[LocalStorageChartStateHandler]].
*
* @param config The configuration of chart state handler.
*/
constructor(config?: ILocalStorageChartStateHandlerConfig);
save(): Promise;
load(): Promise;
clear(): Promise;
protected subscribe(): void;
protected unsubscribe(): void;
private static makeKey;
private autoSaveState;
}
}
declare module FintaChart {
}
declare module FintaChart {
/**
*
*/
class RestrictionHandler extends EventEmitter implements IDisposable {
private _chart;
private get allowedIndicatorsLeft();
private get allowedDrawingsLeft();
get allowInstruments(): boolean;
get allowTimeFrames(): boolean;
get allowDrawings(): boolean;
get allowIndicators(): boolean;
get allowMoreHistoryRequest(): boolean;
get allowChartTypes(): boolean;
constructor(chart: Chart);
checkLicense(): void;
dispose(): void;
private subscribe;
private unsubscribe;
private onTimeoutElapsed;
private raiseRestrictionsChangedEvent;
}
}
declare module FintaChart {
/**
* Chart-theme shaped bar style, as emitted by a script (`SetBarStyle`).
* The keys intentionally match `theme.plot.bar.candle.upCandle`, so the
* object can be sent through as-is.
*
* @category Indicators
*/
interface IScriptBarStyleTheme {
/**
* Candle body / bar fill.
*/
fill?: {
fillEnabled?: boolean;
fillColor?: string;
};
/**
* Candle body outline. `enabled` is accepted as an alias of
* `strokeEnabled`.
*/
border?: {
strokeEnabled?: boolean;
enabled?: boolean;
strokeColor?: string;
width?: number;
};
/**
* Candle wick (high / low shadow).
*/
shadow?: {
strokeEnabled?: boolean;
enabled?: boolean;
strokeColor?: string;
width?: number;
};
/**
* Alias of {@link IScriptBarStyleTheme.shadow} - the name the script
* backend uses for the same thing.
*/
wick?: {
strokeEnabled?: boolean;
enabled?: boolean;
strokeColor?: string;
width?: number;
};
}
/**
* A single bar repaint emitted by a script (`SetBarStyle`).
*
* The bar is addressed by its timestamp - never by its position in the
* chart - so the override survives history loading and conflation.
* Colors are given either flat (`fillColor` / `outlineColor` / `wickColor`)
* or as a chart-theme shaped `theme` object; flat values win.
*
* A style with no usable fill color means "this bar is not painted" and
* removes a previously applied override (see
* {@link Indicator.upsertBarStyles}).
*
* @category Indicators
*/
interface IScriptBarStyle {
/**
* Bar timestamp: a `Date`, epoch milliseconds (epoch seconds when
* below 1e11) or a parseable date string.
*/
time?: Date | number | string;
/**
* Alias of {@link IScriptBarStyle.time}, matching the backend payload.
*/
timestamp?: Date | number | string;
/**
* Candle body / bar color.
*/
fillColor?: string | null;
/**
* Candle body outline color. Defaults to `fillColor`.
*/
outlineColor?: string | null;
/**
* Candle wick color. Defaults to `fillColor`.
*/
wickColor?: string | null;
/**
* Outline width, px. Defaults to 1.
*/
outlineWidth?: number;
/**
* Wick width, px. Defaults to 1.
*/
wickWidth?: number;
/**
* Chart-theme shaped alternative to the flat colors above.
*/
theme?: IScriptBarStyleTheme;
}
/**
* Normalized bar override used while painting.
*
* @category Indicators
*/
interface IBarStyleOverride {
/**
* Identity of the visual style, used to batch bars into a single path.
*/
key: string;
/**
* Candle body / bar color.
*/
fillColor: string;
/**
* Candle body theme (`fill` / `border` / `shadow`), ready for
* `IRenderer.fillStroke`.
*/
candleTheme: any;
/**
* Stroke theme for bar (OHLC / HLC / HL) chart types.
*/
barTheme: IStrokeTheme;
}
/**
* Direction of a script supplied background gradient.
*
* @category Indicators
*/
type ScriptGradientDirection = 'toTop' | 'toBottom' | 'toLeft' | 'toRight' | 'toTopLeft' | 'toTopRight' | 'toBottomLeft' | 'toBottomRight';
/**
* Where a script supplied background is painted.
*
* - `pane` - the pane the script's plots live on (default);
* - `price` - the primary (price) pane, wherever the script lives;
* - `chart` - the whole chart backdrop, panes and splitters included.
*
* @category Indicators
*/
type ScriptPanelTarget = 'pane' | 'price' | 'chart';
/**
* Background override emitted by a script (`SetPanelStyle`). One per
* script - the last call wins.
*
* @category Indicators
*/
interface IScriptPanelStyle {
/**
* Paint target. Defaults to `pane`.
*/
target?: ScriptPanelTarget;
/**
* 1..4 gradient stops. A single color is a flat fill, an empty array
* resets to the theme.
*
* `colors[0]` is where the gradient starts (the bottom for `toTop`).
*/
colors: string[];
/**
* Gradient direction. Defaults to `toTop`. Unknown values fall back
* to `toTop`.
*/
direction?: ScriptGradientDirection;
/**
* Explicit angle in degrees (CSS convention: 0 = up, clockwise).
* Overrides {@link IScriptPanelStyle.direction} when set.
*/
angle?: number | null;
/**
* Optional stop positions in `[0..1]`, one per color.
*/
stops?: number[];
}
/**
* Per-bar color overrides supplied by running scripts, keyed by bar
* timestamp and owned by the indicator that emitted them.
*
* Overrides are never serialized into the chart state: they live exactly
* as long as the script that produced them. When several scripts paint the
* same bar, the one registered last wins.
*
* @category Indicators
*/
class ScriptBarStyleRegistry {
private _owners;
private _resolved;
/**
* Whether any bar is currently overridden.
*/
get hasStyles(): boolean;
/**
* Returns the override for a bar, addressed by epoch milliseconds.
*/
get(time: number): IBarStyleOverride | null;
/**
* Replaces the whole set of overrides owned by `owner`.
*
* @return Whether anything changed (i.e. a repaint is needed).
*/
set(owner: any, styles: IScriptBarStyle[] | null): boolean;
/**
* Adds or replaces single bars owned by `owner`, keeping the rest.
* A style that paints nothing removes the override of that bar.
*
* @return Whether anything changed (i.e. a repaint is needed).
*/
upsert(owner: any, styles: IScriptBarStyle[] | null): boolean;
/**
* Drops every override owned by `owner`.
*
* @return Whether anything changed (i.e. a repaint is needed).
*/
remove(owner: any): boolean;
/**
* Drops every override.
*/
clear(): void;
private static styleTime;
private static sameStyles;
private indexOf;
private resolved;
}
/**
* Background overrides supplied by running scripts.
*
* Each override is resolved to a DOM layer - the chart backdrop or a pane
* container - so the user theme is never mutated and the gradient never
* reaches the saved chart state. When two scripts target the same layer,
* the one registered last wins; removing it restores the previous owner,
* or the theme when there is none.
*
* @category Indicators
*/
class ScriptPanelStyleRegistry {
private _chart;
private _entries;
private _painted;
/**
* Creates an instance of ScriptPanelStyleRegistry.
*
* @param chart
*/
constructor(chart: Chart);
/**
* Registers (or updates) the background owned by `owner`. A `null`
* style - or one without colors - removes it.
*/
set(owner: any, style: IScriptPanelStyle | null | undefined): void;
/**
* Drops the background owned by `owner`.
*/
remove(owner: any): void;
/**
* Drops every background and restores the theme.
*/
clear(): void;
/**
* Re-resolves every background and writes it to the DOM. Cheap and
* idempotent - call it after a theme change or when an indicator
* moved to another pane.
*/
apply(): void;
private indexOf;
private targetElement;
private resetElement;
}
}
declare module FintaChart {
/**
* Represents Scrollbar Config
*/
interface IScrollbarConfig {
/**
* Scrollbar Config chart
*/
chart?: Chart;
/**
* Scrollbar Config parent
*/
parent: HTMLElement;
}
/**
* Provides model of Scrollbar
*/
class Scrollbar {
private _chart;
private _scrollbar;
private _scrollingPane;
private _scrollingPaneMinWidth;
private _scrollingPaneWidth;
private _isLocked;
private _draggableController;
private _resizableController;
/**
* The parent chart.
*/
get chart(): Chart;
set chart(value: Chart);
/**
* The outer height.
*/
get outerHeight(): number;
/**
* Creates an instance of [[Scrollbar]].
*
* @param config The configuration.
*/
constructor(config: IScrollbarConfig);
/**
* Resizes scrollbar.
*/
resize(): void;
/**
* Appends scrollbar to specified container.
*
* @param container The container to append scrollbar to.
*/
appendTo(container: HTMLElement): void;
lock(): void;
private init;
animateScrollingToLastBar(): void;
private updateChart;
private subscribe;
private unsubscribe;
private refresh;
}
}
declare module FintaChart {
/**
* Represents undo redo actions controller.
*/
class UndoRedoController {
private readonly _maxCommands;
private _commands;
private _currentCommand;
/**
* Adds specified command.
*
* @param command The command.
*/
add(command: CommandBase): void;
/**
* Removes all commands.
*/
clear(): void;
/**
* Undoes specified number of operations.
*
* @param count The number of operations to undo.
*/
undo(count: number): void;
/**
* Redoes specific number of commands.
*
* @param count The number of commands to redo.
*/
redo(count: number): void;
/**
* Stores command.
*
* @param command The command to store.
*/
private store;
/**
* Executes current command.
*/
private execute;
}
}
declare namespace FintaChart {
/**
* Describes waiting bar.
*/
interface IWaitingBar extends IDisposable {
/**
* Shows waiting bar.
*/
show(): void;
/**
* Hides waiting bar.
*/
hide(): void;
}
/**
* Represents waiting bar.
*/
class WaitingBar implements IWaitingBar {
private readonly _chart;
private _container;
private _isShown;
/**
* Creates an instance of [[WaitingBar]].
*
* @param chart The chart.
*/
constructor(chart: Chart);
dispose(): void;
show(): void;
hide(): void;
private init;
}
}
declare module FintaChart {
enum WindowMode {
NORMAL = "normal",
FULL_SCREEN = "full-screen",
FULL_WINDOW = "full-window"
}
interface IWindowModeHandler extends IChartComponent {
/**
* The current window mode.
*/
readonly mode: WindowMode;
/**
* The previous window mode.
*/
readonly prevMode: WindowMode;
/**
* Resizes chart in full window/screen mode.
*/
resize(): void;
/**
* Switches to specified window mode.
*
* @param mode The window mode.
*/
changeMode(mode: WindowMode): void;
}
class WindowModeHandler extends ChartComponent implements IWindowModeHandler {
private _isSelfRaisedEvent;
private _mode;
private _preFullWindowSize;
private _preFullWindowOffset;
private _prevMode;
private _boundOnFullScreenChanged;
private _boundOnWindowResize;
constructor(config: IChartComponentConfig);
private get isInFullWindowMode();
get mode(): WindowMode;
get prevMode(): WindowMode;
resize(): void;
changeMode(mode: WindowMode): void;
protected subscribe(): void;
protected unsubscribe(): void;
private enterFullWindow;
private exitFullWindow;
private enterFullScreen;
private exitFullScreen;
private onFullScreenChange;
private updateDropdown;
private toggleWindowMode;
}
}
declare module FintaChart {
/**
* Describes zoom control theme.
*/
interface IZoomAreaTheme {
/**
* The zoom rectangle border theme.
*/
border: IStrokeTheme;
/**
* The zoom rectangle fill theme.
*/
fill: IFillTheme;
}
enum ZoomMode {
DATE_RANGE = "dateRange",
BOUNDS = "bounds",
ADJUST_OHLC = "adjustOHLC",
ADJUST_All = "adjustAll"
}
interface IZoomAreaConfig {
zoomMode: ZoomMode;
}
interface IZoomArea extends IControl {
/**
* The pane.
*/
pane: Pane;
/**
* The zoom mode.
*/
zoomMode: ZoomMode;
/**
* The zoom rectangle theme.
*/
theme: IZoomAreaTheme;
/**
* Cancels zoom.
*/
cancel(): void;
}
/**
* Provides model of Zoom In Area Component
*/
class ZoomArea extends Control {
private _controls;
private _movePoint;
private _paneHeight;
private _paneTop;
private _points;
private _startPoint;
theme: IZoomAreaTheme;
pane: Pane;
zoomMode: ZoomMode;
private get chart();
private get container();
private get paintTheme();
constructor(config?: IZoomAreaConfig);
cancel(): void;
dispose(): void;
paint(): void;
hitTest(point: IPoint): boolean;
protected initMotionEvents(): MotionEventArray;
private createControls;
private makeVisible;
private applyTheme;
private addPoint;
private onMouseClick;
private onMouseMove;
private moveTo;
private startZoom;
private finishZoom;
private updateScales;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
interface IPattern {
ID: string;
userfriendName: string;
recognize: (points: number[]) => number;
}
/**
* @category Patterns
*/
class Pattern {
static baseRecognize(array: number[], config: Record): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
interface IPatternRecognitionResult {
recognitionResult: number;
patternName: string;
ID: string;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class ABatPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class ABCDPattern {
static userfriendName: string;
static ID: string;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class AButterflyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class ACrabPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class AGartleyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class AltABCDPattern {
static userfriendName: string;
static ID: string;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class AltBatPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class AltSharkPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class BatPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class ButterflyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class CrabPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class CypherPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class DeepCrabPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class DeepKingsCrownPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class FiveZeroPattern {
static ID: string;
static config: Record;
static userfriendName: string;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class GartleyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class HeadAndShouldersPattern {
static userfriendName: string;
static ID: string;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class KingsCrownPattern {
static userfriendName: string;
static ID: string;
static recognize(array: number[]): 0 | 100;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class MaxBatPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class MaxButterflyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class MaxGartleyPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class ShallowKingsCrownPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class SharkPattern {
static userfriendName: string;
static ID: string;
static config: Record;
static recognize(array: number[]): number;
}
}
declare module FintaChart {
/**
* @category Patterns
*/
class FractalCalculator {
calculateOnArrays(highValues: number[], lowValues: number[], startIndex?: number, limit?: number): IFractal[];
calculateHighLevelFractals(fractals: IFractal[], level: number): any[];
}
}
declare module FintaChart {
/**
* @category Patterns
*/
enum FractalMode {
FRACTAL_MODE_NONE = 0,
FRACTAL_MODE_UP = 1,
FRACTAL_MODE_DOWN = 2
}
/**
* @category Patterns
*/
interface IFractal {
mode: FractalMode;
index: number;
value: number;
position: number;
}
/**
* @category Patterns
*/
class ZigZagCalculator {
calculateOnArrays(highSeries: number[], lowSeries: number[], deviation: number, depth: number, backstep: number, skipLast?: boolean): IFractal[];
}
}
declare module FintaChart {
/**
* Represents plot options
*
* @category Plots
*/
interface IPlotOptions extends IPaneObjectOptions {
/**
* Enable scale vertical labels
*/
enableVerticalAxisLabels: boolean;
/**
* Keeps the plot out of the vertical auto scale calculation.
*
* The plot is still painted, but its values never widen the value range
* of the scale it is bound to. Intended for plots whose values are not
* comparable with the rest of the scale (e.g. a custom script overlay
* that reports zeros on the price pane), where letting them participate
* would squash the primary data and, because the same range gates
* zoom/scroll, lock the axis.
*/
excludeFromAutoScale: boolean;
/**
* Stretch pricing lines
*/
stretchPricingLines: boolean;
/**
* Hoverable
*/
hoverable: boolean;
/**
* Hovered
*/
hovered: boolean;
/**
* isVolume
*/
isVolume: boolean;
/**
* Plot style
*/
plotStyle: string;
/**
* Selectable
*/
selectable: boolean;
/**
* Selected
*/
selected: boolean;
/**
* Show pricing lines
*/
showPricingLines: boolean;
/**
* Number of bars to project into the future beyond the last real bar.
* Lines are drawn with a dashed style.
*/
projectionBarsCount?: number;
/**
* Projection formula type:
* - 'trend' (default): linear extrapolation by last two points: Y = Y_last + deltaY * N
* - 'flat': horizontal extension Y = Y_last
* - 'damped': Y_i = Y_{i-1} + deltaY * gamma^i, gamma in (0.8..0.95)
* - 'regression': linear regression Y = a + b*X over last N bars
* - 'sma': iterative SMA Y_future = avg(k) over real_or_future values
* - 'polynomial': quadratic Y = a*i^2 + b*i + c over last N bars
*/
projectionType?: string;
/**
* Damping coefficient gamma for 'damped' projection (0.8..0.95, default 0.9)
*/
projectionDamping?: number;
/**
* Period for regression / polynomial fits (default 20)
*/
projectionRegressionPeriod?: number;
/**
* Period for SMA projection (default 14)
*/
projectionSmaPeriod?: number;
}
/**
* Represents plot config
*
* @category Plots
*/
interface IPlotConfig extends IPaneObjectConfig {
/**
* Data rows
*/
dataRows?: DataRows | DataRows[];
/**
* Hoverable
*/
hoverable?: boolean;
/**
* Hovered
*/
hovered?: boolean;
/**
* Pane
*/
pane?: Pane;
/**
* Plot style
*/
plotStyle?: string;
/**
* Plot type
*/
plotType?: PlotType;
/**
* Scale vertical
*/
verticalScale?: VerticalScale;
/**
* Selectable
*/
selectable?: boolean;
/**
* Selected
*/
selected?: boolean;
/**
* Theme
*/
theme?: any;
/**
* Z-index
*/
zIndex?: number;
verticalAxisLabel?: IVerticalAxisLabel;
}
/**
* Represents Plot paint parameters
*
* @category Plots
*/
interface IPlotPaintParameters {
/**
* Dates
*/
dates: Date[];
/**
* End index
*/
endIndex: number;
/**
* Renderer
*/
renderer: IRenderer;
/**
* Scale coordinate mapper
*/
scaleCoordinateMapper: ScaleCoordinateMapper;
/**
* Start column
*/
startColumn: number;
/**
* Start index
*/
startIndex: number;
/**
* Theme
*/
theme: any;
/**
* Values
*/
values: number[];
}
/**
* Represents plot bar paint parameters
*
* @category Plots
*/
interface IBarPlotPaintParameters extends IPlotPaintParameters {
/**
* Close
*/
close: number[];
/**
* Dates
*/
dates: Date[];
/**
* High
*/
high: number[];
/**
* Low
*/
low: number[];
/**
* Open
*/
open: number[];
/**
* Conflation step — draw every Nth bar when sub-pixel.
*/
step: number;
}
/**
* Represents plot defaults
*
* @category Plots
*/
interface IPlotDefaults {
/**
* Plot style
*/
plotStyle: string;
}
/**
* @category Plots
*/
const PlotType: {
INDICATOR: PlotType;
CHART_TYPE: PlotType;
USER: PlotType;
};
type PlotType = 'indicator' | 'ChartType' | 'user';
/**
* @category Plots
*/
namespace PlotEvent {
const DATA_ROWS_CHANGED = "plotDataRowsChanged";
const PANE_CHANGED = "plotPaneChanged";
const THEME_CHANGED = "plotThemeChanged";
const STYLE_CHANGED = "plotStyleChanged";
const ENABLE_AXIS_LABELS = "plotEnableAxisLabelsChanged";
const SHOW_VALUE_LINES_CHANGED = "plotShowPricingLinesChanged";
const STRETCH_VALUE_LINES_CHANGED = "plotStretchPricingLinesChanged";
const VISIBLE_CHANGED = "plotVisibleChanged";
const VALUE_SCALE_CHANGED = "plotVerticalScaleChanged";
const BASE_VALUE_CHANGED = "plotBaseValueChanged";
const SELECTED_CHANGED = "plotSelectedValueChanged";
const HOVERED_CHANGED = "plotHoveredValueChanged";
const CONTEXT_MENU = "chartPlotContextMenu";
}
/**
* Represents plot
*
* @category Plots
*/
abstract class Plot extends PaneObject implements IChartObject {
static defaults: IPlotDefaults;
private _dataRows;
private _motionEvents;
private _selected;
private _theme;
protected verticalAxisLabel: IVerticalAxisLabel;
hovered: boolean;
/**
* Is auto scale
*/
isAutoScale: boolean;
/**
* Plot theme key
*/
protected plotThemeKey: string;
/**
* Plot type
*/
private readonly _plotType;
/**
* Get default layout template
*/
get defaultLayoutTemplate(): any;
/**
* Get can hover
*/
get canHover(): boolean;
/**
* Get can select
*/
get canSelect(): boolean;
/**
* Set data rows
*/
get dataRows(): DataRows[];
set dataRows(value: DataRows[]);
/**
* Get enable scale vertical labels
*/
get enableVerticalAxisLabels(): boolean;
set enableVerticalAxisLabels(value: boolean);
/**
* Get stretch pricing license
*/
get stretchPricingLines(): boolean;
set stretchPricingLines(value: boolean);
/**
* Get hoverable
*/
get hoverable(): boolean;
set hoverable(value: boolean);
/**
* Get plot style
*/
get plotStyle(): string;
set plotStyle(value: string);
/**
* Get plot type
*/
get plotType(): PlotType;
/**
* Get selectable
*/
get selectable(): boolean;
set selectable(value: boolean);
/**
* Get selected
*/
get selected(): boolean;
set selected(value: boolean);
/**
* Get show pricing lines
*/
get showPricingLines(): boolean;
set showPricingLines(value: boolean);
/**
* Get theme
*/
get theme(): any;
set theme(value: any);
/**
* Get selectable
*/
get isVolume(): boolean;
set isVolume(value: boolean);
/**
* Get is excluded from the vertical auto scale calculation
*/
get excludeFromAutoScale(): boolean;
set excludeFromAutoScale(value: boolean);
/**
* Creates an instance of Plot.
*
* @param config
*/
constructor(config?: IPlotConfig);
/**
* draws scale vertical floating labels
*/
paintVerticalAxisLabels(): void;
getVerticalAxisLabelMaxWidth(): number;
protected paintPricingLines(lastValue: number, lastRecordIndex: number, theme: IStrokeTheme): void;
/**
* Finds data row
*
* @param rowMarker
* @return
*/
findDataRows(rowMarker: string): DataRows;
/**
* Handles event
*
* @param event
* @return
*/
handleEvent(event: IWindowEvent): boolean;
/**
* Hovers
*/
hover(): void;
/**
* Returns min max values
*
* @param startIndex
* @param count
* @return
*/
minMaxValues(startIndex: number, count: number): IMinMax;
/**
* Selects
*/
select(): void;
/**
* Sets data rows
*
* @param dataRows
*/
setDataRows(dataRows: DataRows | DataRows[]): void;
/**
* hover silent
*/
silentHover(): void;
/**
* Select silent
*/
silentSelect(): void;
getPricePoint(): number;
/**
* Returns bar paint parameters
*
* @return
*/
protected barPaintParameters(): IBarPlotPaintParameters;
/**
* Visualizes hover dots brush
*/
protected paintHoverMarker(): void;
/**
* Visualizes hovered
*
* @param oldTheme
* @return
*/
protected paintHovered(oldTheme: any): any;
/**
* Returns hover dots brush width
*
* @param theme
* @return
*/
protected hoverMarkerWidth(theme: any): number;
/**
* Handles pane changes
*
* @param oldValue
*/
protected onPaneChanged(oldValue: Pane): void;
/**
* handles scale vertical changes
*
* @param oldValue
*/
protected onVerticalScaleChanged(oldValue: VerticalScale): void;
/**
* Handles visibility changes
*
* @param oldValue
*/
protected onVisibleChanged(oldValue: boolean): void;
/**
* Returns paint value parameters
*
* @return
*/
protected valuePaintParameters(): IPlotPaintParameters;
/**
* Hits test
*
* @param point
* @return
*/
protected hitTest(point: IPoint): boolean;
protected verticalAxisLabelTheme(): IVerticalAxisLabelTheme;
private onMouseHover;
private onContextMenu;
private onDoubleClick;
private onMouseHoverInternal;
private initMotionEvents;
}
}
declare module FintaChart {
/**
* Represents Plot area
*
* @category Plots
*/
class AreaPlot extends Plot {
paint(): void;
/**
* Draws area
*
* @param isAbove
* @param theme
* @return
*/
drawArea(isAbove: boolean, theme: any): void;
private addValue;
private paintOneColorArea;
private getIntersectionPoints;
}
}
declare module FintaChart {
/**
* @category Plots
*/
interface IArrowPlotConfig {
value: number;
date: Date;
}
/**
* @category Plots
*/
interface IArrowsPlotConfig {
upArrows: IArrowPlotConfig[];
downArrows: IArrowPlotConfig[];
}
/**
* @category Plots
*/
interface IArrowsPlotTheme {
arrowUp: {
fill: IFillTheme;
stroke: IStrokeTheme;
};
arrowDown: {
fill: IFillTheme;
stroke: IStrokeTheme;
};
}
/**
* @category Plots
*/
class ArrowsPlot extends Plot {
headRatio: number;
tailRatio: number;
private _arrowSize;
private _arrows;
get theme(): IArrowsPlotTheme;
get showValueMarkers(): boolean;
get enableVerticalAxisLabels(): boolean;
get arrowSize(): ISize;
set arrowSize(size: ISize);
paint(): void;
setArrows(arrows: IArrowsPlotConfig): void;
clear(): void;
private paintArrows;
}
}
declare module FintaChart {
/**
* Represents plot bar config
*
* @category Plots
*/
interface IBarPlotConfig extends IPlotConfig {
/**
* Column width ratio
*/
columnWidthRatio?: number;
/**
* Min width
*/
minWidth?: number;
}
/**
* Represents plot bar defaults
*
* @category Plots
*/
interface IBarPlotDefaults extends IPlotDefaults {
/**
* Column width ratio
*/
columnWidthRatio: number;
/**
* Min width
*/
minWidth: number;
}
/**
* @category Plots
*/
namespace PlotEvent {
const COLUMN_WIDTH_RATIO_CHANGED = "plotColumnWidthRatioChanged";
const MIN_WIDTH_CHANGED = "plotMinWidthChanged";
}
const ChartTypeNames: {
OHLC: string;
COLORED_OHLC: string;
HLC: string;
COLORED_HLC: string;
HL: string;
COLORED_HL: string;
CANDLE: string;
HOLLOW_CANDLE: string;
HEIKIN_ASHI: string;
RENKO: string;
RANGE_BAR: string;
LINE_BREAK: string;
POINT_AND_FIGURE: string;
KAGI: string;
CANDLE_VOLUME: string;
EQUI_VOLUME: string;
EQUI_VOLUME_SHADOW: string;
LINE: string;
AREA: string;
};
/**
* Represents plot bar
*
* @category Plots
*/
class BarPlot extends Plot {
/**
* Style
*/
static readonly Style: typeof ChartTypeNames;
/**
* Defaults
*/
static readonly defaults: IBarPlotDefaults;
/**
* Get column width ratio
*/
get columnWidthRatio(): number;
set columnWidthRatio(value: number);
/**
* Get min width
*/
get minWidth(): number;
set minWidth(value: number);
/**
* Creates an instance of BarPlot.
*
* @param config
*/
constructor(config?: IBarPlotConfig);
paint(): void;
/**
* Draws scale vertical floating labels
*/
paintVerticalAxisLabels(): void;
getVerticalAxisLabelMaxWidth(): number;
/**
* Script supplied per-bar overrides for this plot, or `null` when
* there are none. Only the chart-type plot honours them: bars live on
* the price pane, wherever the script's own plots are.
*/
private scriptBarStyleLookup;
private scriptBarStyle;
/**
* Groups the overridden bars of the visible range by style, so each
* color still costs a single path instead of a path per bar.
*/
private scriptBarStyleGroups;
private isScriptStyledBar;
private paintBars;
private paintBarItems;
private paintBrickItems;
private paintBricks;
private paintCandleItems;
private paintCandles;
private paintColoredBarItems;
private paintColoredBars;
private paintEquiVolumeCandles;
private paintEquiVolumeItems;
private paintEquiVolumeShadowCandles;
private paintEquiVolumeShadowItems;
private paintHollowCandleItems;
private paintHollowCandles;
private paintKagi;
private paintKagiItems;
private paintVolumeCandles;
private paintVolumeCandlesItems;
private getLabelFillColor;
private labelTheme;
}
}
declare module FintaChart {
/**
* @category Plots
*/
enum HistogramBars {
UP_BAR = 0,
DOWN_BAR = 1,
MEAN_BAR = 2
}
/**
* Represents plot histogram config
*
* @category Plots
*/
interface IHistogramPlotConfig extends IPlotConfig {
/**
* Base value
*/
baseValue?: number;
/**
* Column width ratio
*/
columnWidthRatio?: number;
/**
* Min column width
*/
minColumnWidth?: number;
}
/**
* Represents plot histogram defaults
*
* @category Plots
*/
interface IHistogramPlotDefaults extends IPlotDefaults {
/**
* Base value
*/
baseValue: number;
/**
* Column width ratio
*/
columnWidthRatio: number;
/**
* Min width
*/
minWidth: number;
}
enum PlotHistogramStyle {
LINE = "line",
COLORED_LINE = "coloredLine",
COLORED_BAR_LINE = "coloredBarLine",
COLORED_MEAN_BAR_LINE = "coloredMeanBarLine",
COLUMN = "column",
COLORED_COLUMN = "coloredColumn",
BYDATES = "bydates"
}
/**
* Public alias matching the name used in documentation
* (`FintaChart.HistogramPlotStyle.COLORED_COLUMN`). Resolves to the
* same enum values as `PlotHistogramStyle` and `HistogramPlot.Style`.
*/
const HistogramPlotStyle: typeof PlotHistogramStyle;
/**
* Represents plot histogram
*
* @category Plots
*/
class HistogramPlot extends Plot {
/**
* Style
*/
static readonly Style: typeof PlotHistogramStyle;
/**
* Defaults
*/
static readonly defaults: IHistogramPlotDefaults;
/**
* Get base value
*/
get baseValue(): number;
set baseValue(value: number);
/**
* Get column width ratio
*/
get columnWidthRatio(): number;
set columnWidthRatio(value: number);
/**
* Get min column width
*/
get minColumnWidth(): number;
set minColumnWidth(value: number);
/**
* Creates an instance of HistogramPlot.
*
* @param config
*/
constructor(config?: IHistogramPlotConfig);
paint(): void;
/**
* Draws scale vertical floating labels
*/
paintVerticalAxisLabels(): void;
private paintByDatesLines;
private paintColoredBarLines;
private paintColoredColumns;
private paintColoredLines;
private paintColumns;
private paintLines;
private setupVerticalAxisLabelTheme;
}
}
declare module FintaChart {
/**
* Represents plot line
*
* @category Plots
*/
class LinePlot extends Plot {
/**
* Style
*/
static readonly Style: any;
/**
* Defaults
*/
static readonly defaults: IPlotDefaults;
/**
* Creates an instance of LinePlot.
*
* @param config
*/
constructor(config?: IPlotConfig);
paint(): void;
private paintAreaLine;
private paintSimpleLine;
private paintStepLine;
private paintSmoothedAreaLine;
private paintSmoothShape;
private paintSmoothedSimpleLine;
private paintProjectionLine;
}
}
declare module FintaChart {
import MoonPhaseType = FintaChart.MoonPhaseType;
interface IMoonPhase {
date: Date;
type: MoonPhaseType;
}
interface IMoonPhasePlotSettings {
showFullMoonMark: boolean;
showNewMoonMark: boolean;
fullMoonMarkColor: string;
newMoonMarkColor: string;
fullMoonMarkSize: number;
newMoonMarkSize: number;
showGrowingMoonOverlay: boolean;
showWaningMoonOverlay: boolean;
growingMoonOverlayColor: string;
waningMoonOverlayColor: string;
}
const DefaultMoonPhasePlotSettings: IMoonPhasePlotSettings;
/**
* @category Plots
*/
class MoonPhasePlot extends Plot {
private _settings;
set settings(value: IMoonPhasePlotSettings);
private _moonPhaseOverlays;
_moonPhases: IMoonPhases;
get moonPhases(): IMoonPhases;
set moonPhases(value: IMoonPhases);
get fullMoonMarkSize(): number;
get newMoonMarkSize(): number;
get showValueMarkers(): boolean;
get enableVerticalAxisLabels(): boolean;
get defaultLayoutTemplate(): any;
paint(): void;
private paintPhases;
private paintOverlays;
private getMoonPhaseMarkFillColor;
private getMoonPhaseOverlayFillColor;
private getPhaseMarkCenterPoint;
private getRecordsRangeMinMax;
private calculateMoonPhaseOverlays;
private getPhaseMarkRadius;
private filterVisibleOverlays;
private filterVisiblePhases;
}
}
declare module FintaChart {
/**
* Represents plot point and figure
*
* @category Plots
*/
class PointAndFigurePlot extends BarPlot {
private _boxSize;
private _showSignals;
private _showMonth;
private _showTrend;
private _applyGrid;
dates: IBoxDateReversed[];
/**
* Get box size
*/
get boxSize(): number;
set boxSize(value: number);
get showSignals(): boolean;
set showSignals(value: boolean);
get showMonth(): boolean;
set showMonth(value: boolean);
get showTrend(): boolean;
set showTrend(value: boolean);
get applyGrid(): boolean;
set applyGrid(value: boolean);
paint(): void;
private findTrendEnd;
private drawTrends;
private getMonth;
private drawTextInBox;
private visualizeColumns;
}
}
declare module FintaChart {
/**
* Describes point plot config.
*
* @category Plots
*/
export interface IPointPlotConfig extends IPlotConfig {
/**
* The size of the point.
*/
pointSize?: number;
}
/**
* Describes point plot defaults.
*
* @category Plots
*/
export interface IPointPlotDefaults extends IPlotDefaults {
/**
* The size of the point.
*/
pointSize: number;
}
/**
* @category Plots
*/
export namespace PlotEvent {
const POINT_SIZE_CHANGED = "plotPointSizeChanged";
}
enum PointPlotStyle {
DOT = "dot"
}
/**
* Represents point plot.
*
* @category Plots
*/
export class PointPlot extends Plot {
/**
* The point plot styles.
*/
static readonly Style: typeof PointPlotStyle;
static readonly defaults: IPointPlotDefaults;
/**
* The size of the point.
*/
get pointSize(): number;
set pointSize(value: number);
/**
* Initializes new instance of the [[PointPlot]] class.
*
* @param config The point plot configuration.
*/
constructor(config?: IPointPlotConfig);
paint(): void;
}
export {};
}
declare module FintaChart {
/**
* @description Represents Volume Profile
* @export
* @interface IVolumeProfile
*/
interface IVolumeProfile {
maxv: number;
rows: IVolumeRows[];
POC: IPOCValue;
VA: number[];
size: number;
}
/**
* @description Represents Daily Profile
* @export
* @interface IDayilyProfile
* @extends {IVolumeProfile}
*/
interface IDayilyProfile extends IVolumeProfile {
t0: number;
t1: number;
high: number;
low: number;
}
/**
* @description Represents Volume Profile Rows
* @export
* @interface IVolumeRows
*/
interface IVolumeRows {
h: number;
l: number;
b: number;
s: number;
v: number;
}
/**
* @description Represents Volume Profile Point Of Control
* @export
* @interface IPOCValue
*/
interface IPOCValue {
i: number;
val: number;
}
/**
* @description Represents Coordinate
* @export
* @interface ICoordinate
*/
interface ICoordinate {
x1: number;
y1: number;
x2: number;
y2: number;
}
const PlotRowStyle: {
RANGE: string;
DAILY: string;
HEATMAP: string;
};
/**
* @description Represents Row Histogram Plot
* @export
* @class
* @extends {Plot}
*/
class RowHistogramPlot extends Plot {
_volumeProfile: IVolumeProfile;
_dailyProfile: IDayilyProfile[];
_heatmap: any;
/**
* @description Set volume profile value
* @property {IVolumeProfile} volumeProfile
* @memberof RowHistogramPlot
*/
set volumeProfile(value: IVolumeProfile);
/**
* @description Get volume profile value
* @property {IVolumeProfile} volumeProfile
* @memberof RowHistogramPlot
*/
get volumeProfile(): IVolumeProfile;
/**
* @description Set daily profile value
* @property {IDayilyProfile} dailyProfile
* @memberof RowHistogramPlot
*/
set dailyProfile(value: IDayilyProfile[]);
/**
* @description Get daily profile value
* @property {IDayilyProfile} dailyProfile
* @memberof RowHistogramPlot
*/
get dailyProfile(): IDayilyProfile[];
set heatmap(value: any);
get heatmap(): any;
/**
* @description Get show value markers
* @property {boolean} showValueMarkers
* @memberof RowHistogramPlot
*/
get showValueMarkers(): boolean;
/**
* @description Get enable scale vertical labels
* @property {boolean} enableScaleVerticalLabels
* @memberof RowHistogramPlot
*/
get enableScaleVerticalLabels(): boolean;
/**
* @description Creates an instance of Plot.
* @constructor
* @param {IPlotConfig} [config]
* @memberof RowHistogramPlot
*/
constructor(config?: IPlotConfig);
/**
* @description Paints
* @memberof RowHistogramPlot
*/
paint(): void;
/**
* @description Draw daily rows
*
* @memberof RowHistogramPlot
*/
private _drawDailyRows;
/**
* @description Draw rows
*
* @memberof RowHistogramPlot
*/
private _drawRows;
/**
* @description Draw reversed rows
* @param {IDayilyProfile} dayliProfile
* @memberof RowHistogramPlot
*/
private _drawReverseRows;
/**
* @description Draw line
* @param {number} ym
* @param {number} right
* @param {number} left
* @memberof RowHistogramPlot
*/
private _drawLine;
/**
* @description Draw rectangle background
* @param {ICoordinate} coordinate
* @memberof RowHistogramPlot
*/
private _drawRectBackground;
private _drawHeatmap;
private _calculateInterColor;
}
}
declare module FintaChart {
interface IHorizontalAxisConfig {
horizontalScale: HorizontalScale;
cssClass: string | null;
visible?: boolean;
}
/**
* Provides model of Scale Horizontal Pane
*/
class HorizontalAxis extends HtmlControl {
private static TRANSPARENT;
private readonly _cssClass;
private readonly _isVisible;
private readonly _scale;
private _layer;
private _isLocked;
/**
* Get trend Scale Horizontal Pane's chart
*/
get chart(): Chart;
/**
* Get trend Scale Horizontal Pane's css class
*/
get cssClass(): string;
/**
* Get trend Scale Horizontal Pane's layer
*/
get layer(): CanvasLayer;
/**
* Get trend Scale Horizontal Pane's scale horizontal
*/
get scale(): HorizontalScale;
/**
* Get trend Scale Horizontal Pane's visible
*/
get visible(): boolean;
/**
* Creates an instance of HorizontalAxis.
*
* @param config
*/
constructor(config: IHorizontalAxisConfig);
/**
* Setups Scale Horizontal Pane's layout theme
*/
setupLayoutTheme(): void;
/**
* Clears Scale Horizontal Pane's pane
*/
clearPane(): void;
/**
* Pains Scale Horizontal Pane
*/
paint(): void;
hitTest(point: IPoint): boolean;
resize(frameInChart: Bounds, isTopPane?: boolean): void;
/**
* Retrieves Scale Horizontal Pane's layout pane
*
* @param frameInChart
* @param isTopPane
* @return Scale Horizontal Pane's layout pane
*/
layoutPane(frameInChart: Bounds, isTopPane: boolean): Bounds;
lock(): void;
protected createContainer(): HTMLElement;
protected initMotionEvents(): MotionEventArray;
private clientHeight;
private onDoubleClick;
private onMove;
private onMouseWheel;
private onPinchZoom;
}
}
declare module FintaChart {
/**
* Represents Scale Horizontal options
*/
interface IHorizontalScaleConfig extends IChartComponentConfig {
autoScrollName?: HorizontalAxisAutoScrollKind;
}
interface IHorizontalScaleOptions {
theme?: unknown;
allowPartialRecords?: boolean;
autoScrollMode?: HorizontalAxisAutoScrollMode;
autoScrollName?: HorizontalAxisAutoScrollKind;
firstVisibleRecord?: number;
lastVisibleRecord?: number;
minVisibleRecords?: number;
maxVisibleRecords?: number;
majorTickMarkLength?: number;
minorTickMarkLength?: number;
height?: number;
rightAdditionalSpaceRatio?: number;
scrollName?: string;
textPadding?: IPadding;
useManualHeight?: boolean;
zoomMode?: string;
zoomName?: string;
}
/**
* Represents Scale Horizontal State
*/
interface IHorizontalScaleState {
/**
* Scale Horizontal State's allow partial records
*/
allowPartialRecords: boolean;
/**
* Scale Horizontal State's allow scroll name
*/
autoScrollName: HorizontalAxisAutoScrollKind;
/**
* Scale Horizontal State's first visible record
*/
firstVisibleRecord: number;
/**
* Scale Horizontal State's formatter
*/
formatter: IDateTimeFormatterState;
/**
* Scale Horizontal State's height
*/
height: number;
/**
* Scale Horizontal State's last visible record
*/
lastVisibleRecord: number;
/**
* Scale Horizontal State's major tick mark length
*/
majorTickMarkLength: number;
/**
* Scale Horizontal State's maximum visible records
*/
maxVisibleRecords: number;
/**
* Scale Horizontal State's minimum visible records
*/
minVisibleRecords: number;
/**
* Scale Horizontal State's minor tick mark length
*/
minorTickMarkLength: number;
/**
* Scale Horizontal State's right additional space ratio
*/
rightAdditionalSpaceRatio: number;
/**
* Scale Horizontal State's scale adapter
*/
scaleAdapter: IHorizontalAxisAdapterState;
/**
* Scale Horizontal State's scroll mode
*/
scrollMode: HorizontalAxisAutoScrollMode;
/**
* Scale Horizontal State's scroll name
*/
scrollName: string;
/**
* Scale Horizontal State's text padding
*/
textPadding: IPadding;
/**
* Scale Horizontal State's theme
*/
theme: unknown;
/**
* Scale Horizontal State's use manual height
*/
useManualHeight: boolean;
/**
* Scale Horizontal State's zoom mode
*/
zoomMode: string;
/**
* Scale Horizontal State's zoom name
*/
zoomName: string;
}
/**
* The scroll behaviour of the horizontal axis.
*/
enum HorizontalAxisScrollKind {
/**
* Scrolls without any specific behaviour.
*/
NORMAL = "normal",
/**
* Applies automatic axis scaling during scrolling.
*/
AUTOSCALED = "autoscaled"
}
/**
* The zoom behaviour of the horizontal axis.
*/
enum HorizontalAxisZoomKind {
/**
* Zooms without any specific behaviour.
*/
NORMAL = "normal",
/**
* Applies automatic axis scaling during zooming.
*/
AUTOSCALED = "autoscaled"
}
/**
* The zoom mode of the horizontal axis.
*/
const HorizontalAxisZoomMode: {
/**
* Pins center of the chart and zooms both sides equally.
*/
PIN_CENTER: string;
/**
* Pins left side of the chart and zooms right side only.
*/
PIN_LEFT: string;
/**
* Pins right side of the chart and zooms left side only.
*/
PIN_RIGHT: string;
/**
* Pins current mouse position and zooms both sides.
*/
PIN_MOUSE: string;
};
/**
* The data rows update kind.
*/
enum DataRowsUpdateKind {
/**
* Existing bar has been updated with a new tick.
*/
TICK = 0,
/**
* New bar has been added.
*/
NEW_BAR = 1
}
/**
* The auto scrolling behaviour of the horizontal axis.
*/
enum HorizontalAxisAutoScrollKind {
/**
* Automatic scrolling is disabled.
*/
NONE = "none",
/**
* Scrolls automatically when new hidden bar appears on the right side.
*/
HIDDEN_BAR = "hidden_bar",
/**
* Automatic scrolling is always enabled.
*/
ALWAYS = "always"
}
/**
* The auto scrolling mode of the horizontal axis.
*/
enum HorizontalAxisAutoScrollMode {
/**
* Scrolls axis automatically when new bar appears.
*/
NEW_BAR = "new_bar",
/**
* Scrolls axis automatically when new tick appears.
*/
TICK = "tick"
}
/**
* Represents Scale Horizontal
*/
class HorizontalScale extends ChartComponent implements IStateable {
private readonly _topAxis;
private readonly _bottomAxis;
private readonly _scaleCoordinateMapper;
private _monospacedColumnWidth;
private _firstVisibleIndex;
private _lastVisibleIndex;
private _maxVisibleBars;
private _moreHistoryRequested;
private _options;
private _axisAdapter;
private _scaleCoordinateMapperFrame;
private _scrollOnRecordsCount;
private _wasAutoscale;
private _horizontalScaleCoordinateMapper;
private _isLocked;
private _initialVisibleRange;
/**
* Scale Horizontal's formatter
*/
private formatter;
columnWidthResolver: IColumnWidthProvider;
/**
* Get Scale Horizontal's default layout template
*/
get defaultLayoutTemplate(): any;
/**
* Get Scale Horizontal's allow partial records
*/
get allowPartialRecords(): boolean;
set allowPartialRecords(value: boolean);
/**
* Get Scale Horizontal's auto scroll mode
*/
get autoScrollMode(): HorizontalAxisAutoScrollMode;
set autoScrollMode(value: HorizontalAxisAutoScrollMode);
/**
* Get Scale Horizontal's auto scroll name
*/
get autoScrollKind(): HorizontalAxisAutoScrollKind;
set autoScrollKind(value: HorizontalAxisAutoScrollKind);
/**
* Get Scale Horizontal's top pane
*/
get topAxis(): HorizontalAxis;
/**
* Get Scale Horizontal's bottom pane
*/
get bottomAxis(): HorizontalAxis;
/**
* Get Scale Horizontal's top pane css class
*/
get topAxisCssClass(): string;
/**
* Get Scale Horizontal's bottom pane css class
*/
get bottomAxisCssClass(): string;
/**
* Get Scale Horizontal's top pane visible
*/
get topAxisVisible(): boolean;
/**
* Get Scale Horizontal's bottom pane visible
*/
get bottomAxisVisible(): boolean;
/**
* Get Scale Horizontal's column width
*/
get monospacedColumnWidth(): number;
/**
* Get Scale Horizontal's columns count
*/
get columnsCount(): number;
/**
* Get Scale Horizontal's first visible index
*/
get firstVisibleIndex(): number;
/**
* Get Scale Horizontal's last visible index
*/
get lastVisibleIndex(): number;
/**
* Get Scale Horizontal's first visible record
*/
get firstVisibleRecord(): number;
set firstVisibleRecord(record: number);
/**
* Get Scale Horizontal's last visible record
*/
get lastVisibleRecord(): number;
set lastVisibleRecord(value: number);
/**
* Get Scale Horizontal's minimum visible records
*/
get minVisibleRecords(): number;
set minVisibleRecords(value: number);
/**
* Get Scale Horizontal's maximum visible records
*/
get maxVisibleRecords(): number;
set maxVisibleRecords(value: number);
/**
* Get Scale Horizontal's maximum allowed record
*/
get maxAllowedRecord(): number;
/**
*
* Set Scale Horizontal's maximum bars visible
*/
get maxVisibleBars(): number;
set maxVisibleBars(count: number);
/**
* Get Scale Horizontal's visible date range
*/
get visibleDateRange(): IMinMax;
/**
* Get Scale Horizontal's major tick mark length
*/
get majorTickHeight(): number;
set majorTickHeight(value: number);
/**
* Get Scale Horizontal's minor tick mark length
*/
get minorTickHeight(): number;
set minorTickHeight(value: number);
/**
* Get Scale Horizontal's manual height
*/
get manualHeight(): number;
set manualHeight(value: number);
/**
* Get Scale Horizontal's right additional space ratio
*/
get rightAdditionalSpaceRatio(): number;
set rightAdditionalSpaceRatio(value: number);
/**
* Get Scale Horizontal's scale adapter
*/
get axisAdapter(): IHorizontalAxisAdapter;
set axisAdapter(value: IHorizontalAxisAdapter);
get horizontalScaleCoordinateMapper(): IHorizontalScaleCoordinateMapper;
/**
* Get Scale Horizontal's scale coordinate mapper
*/
get scaleCoordinateMapper(): ScaleCoordinateMapper;
/**
* Get Scale Horizontal's scale coordinate mapper frame
*/
get scaleCoordinateMapperFrame(): Bounds;
/**
* Get Scale Horizontal's scroll name
*/
get scrollKind(): string;
set scrollKind(value: string);
/**
* Get Scale Horizontal's scroll on records count
*/
get scrollOnRecordsCount(): number;
set scrollOnRecordsCount(count: number);
/**
* Get Scale Horizontal's text padding
*/
get textPadding(): IPadding;
set textPadding(value: IPadding);
/**
* Get Scale Horizontal's theme
*/
get theme(): unknown;
set theme(value: unknown);
/**
* Get Scale Horizontal's use manual height
*/
get useManualHeight(): boolean;
set useManualHeight(value: boolean);
/**
* Get Scale Horizontal's zoom mode
*/
get zoomMode(): string;
set zoomMode(value: string);
/**
* Set Scale Horizontal's zoom name
*/
get zoomKind(): string;
set zoomKind(value: string);
get locale(): string;
set locale(value: string);
/**
* Gets whether a pinch zoom gesture is in progress
*/
get isTouchZooming(): boolean;
/**
* Creates an instance of HorizontalScale.
*
* @param config
*/
constructor(config: IHorizontalScaleConfig);
/**
* Scale Horizontal's canvas start x
*
* @return Scale Horizontal's canvas start x
*/
canvasStartX(): number;
/**
* Handles Scale Horizontal's zoom
*
* @param pixels
* @param multiplier
*/
onZoom(pixels: number, multiplier?: number): void;
/**
* Handles Scale Horizontal's scroll
*
* @param pixels
*/
onScroll(pixels: number): void;
/**
* Retrieves Scale Horizontal's text paint bounds
*
* @return Scale Horizontal's text paint bounds
*/
textPaintBounds(): IBounds;
/**
* Applies Scale Horizontal's auto scale
*
* @param name
*/
applyAutoScroll(name: DataRowsUpdateKind): void;
/**
* Auto scales Scale Horizontal's
*/
autoScale(): void;
/**
* Can sets visible Scale Horizontal's records
*
* @param record
* @return Can sets visible Scale Horizontal's records
*/
canSetVisibleRecord(record: number): boolean;
/**
* Clears Scale Horizontal
*/
clear(): void;
/**
* Paints Scale Horizontal - optimized: avoid duplicate draw for selected shapes already handled in Pane.paint,
* and skip shapes not matching current instrument.
*/
paint(): void;
/**
* Formats Scale Horizontal date
*
* @param date
* @return Formatted Scale Horizontal date
*/
formatDate(date: Date): string;
/**
* Retrieves Scale Horizontal date data rows
*
* @return Scale Horizontal date data rows
*/
getDateDataRows(): DataRows;
/**
* Handles Scale Horizontal events
*
* @param event
* @return is handled Scale Horizontal events
*/
onEvent(event: IWindowEvent): boolean;
/**
* Initializes Scale Horizontal visual dimensions
*
* @param frame
* @param scaleCoordinateMapperFrame
*/
InitializeVisualDimensions(frame: Bounds, scaleCoordinateMapperFrame: Bounds): void;
/**
* Retrieves Scale Horizontal's layout scale pane
*
* @param chartFrame
* @return Scale Horizontal's layout scale pane
*/
layout(chartFrame: Bounds): Bounds;
saveState(): IHorizontalScaleState;
restoreState(state: IHorizontalScaleState): void;
/**
* Makes Scale Horizontal's auto scale
*
* @return Makes Scale Horizontal's auto scale
*/
shouldAutoScale(): boolean;
/**
* On complete more history request
*/
onCompleteMoreHistoryRequest(): void;
/**
* Requests Scale Horizontal's more history if need
*/
private requestMoreBars;
/**
* Scrolls Scale Horizontal's on pixels
*
* @param pixels
* @return Is scrolled
*/
scrollOnPixels(pixels: number): boolean;
/**
* Scrolls Scale Horizontal's on records
*
* @param records
* @return Is scrolled
*/
scrollOnRecords(records: number): boolean;
/**
* Refreshes Scale Horizontal's auto scale async
*/
refreshAutoScaleAsync(): void;
private _optimizeRefresh;
/**
* Refreshes Scale Horizontal's async
*
* @param autoScale
*/
refreshAsync(autoScale?: boolean): void;
/**
* Zooms Scale Horizontal's on pixels
*
* @param leftPixels
* @param rightPixels
* @return Is zoomed
*/
zoomOnPixels(leftPixels: number, rightPixels?: number): boolean;
/**
* Zooms Scale Horizontal's on records
*
* @param leftRecords
* @param rightRecords
* @return Is zoomed
*/
zoomOnRecords(leftRecords: number, rightRecords?: number): boolean;
setHorizontalScaleCoordinateMapper(mapper: IHorizontalScaleCoordinateMapper): void;
getColumnWidth(record: number): number;
lock(): void;
onTimezoneChanged(): void;
/**
* Applies pinch zoom anchored at the gesture midpoint
*
* @param scale The scale relative to gesture start.
* @param centerX The gesture midpoint x, in scale coordinates.
*/
/**
* Applies pinch zoom anchored at the gesture midpoint
*
* @param scale The scale relative to gesture start.
* @param anchorRatio The midpoint position across the plot, from 0 to 1.
*/
handlePinchZoom(scale: number, anchorRatio: number): void;
/**
* Reset touch zoom state
*/
resetTouchZoom(): void;
protected subscribe(): void;
protected unsubscribe(): void;
private updateCoordinateMapper;
private autoScroll;
private refresh;
}
}
declare module FintaChart {
/**
* Represents Scale Vertical Pane Config
*/
interface IVerticalAxisConfig {
/**
* Scale Vertical Pane Config custom format
*/
customFormat?: string;
/**
* Scale Vertical Pane Config decimal digits
*/
decimalDigits?: number;
/**
* Scale Vertical Pane Config major tick mark length
*/
majorTickMarkLength?: number;
/**
* Scale Vertical Pane Config maximum allowed value
*/
maxAllowedValue?: number;
/**
* Scale Vertical Pane Config maximum allowed value ratio
*/
maxAllowedValueRatio?: number;
/**
* Scale Vertical Pane Config maximum allowed range ratio
*/
maxValueRangeRatio?: number;
/**
* Scale Vertical Pane Config maximum visible value
*/
maxVisibleValue?: number;
/**
* Scale Vertical Pane Config minimum allowed value
*/
minAllowedValue?: number;
/**
* Scale Vertical Pane Config minimum allowed value ratio
*/
minAllowedValueRatio?: number;
/**
* Scale Vertical Pane Config minimum value offset
*/
minValueOffset?: number;
/**
* Scale Vertical Pane Config minimum value range ratio
*/
minValueRangeRatio?: number;
/**
* Scale Vertical Pane Config minimum visible value
*/
minVisibleValue?: number;
/**
* Scale Vertical Pane Config minor tick mark length
*/
minorTickMarkLength?: number;
/**
* Scale Vertical Pane Config name
*/
name?: ScaleKind;
/**
* Scale Vertical Pane Config padding
*/
padding?: IPadding;
/**
* Scale Vertical Pane Config pane
*/
pane: Pane;
/**
* Scale Vertical Pane Config range
*/
range?: object;
}
/**
* Represents Scale Vertical Pane options
*/
interface IVerticalAxisOptions {
theme?: unknown;
autoScaleMultiplier?: number;
disablePaddings?: boolean;
minorTickMarkLength?: number;
majorTickMarkLength?: number;
minAllowedValue?: number;
maxAllowedValue?: number;
minAllowedValueRatio?: number;
maxAllowedValueRatio?: number;
minValueRangeRatio?: number;
maxValueRangeRatio?: number;
minVisibleValue?: number;
maxVisibleValue?: number;
name?: ScaleKind;
padding?: {
left: number;
top: number;
right: number;
bottom: number;
};
range?: IMinMax;
}
/**
* Represents Scale Vertical Pane State
*/
interface IVerticalAxisState {
/**
* Scale Vertical Pane State's formatter
*/
formatter: INumberFormatterState;
/**
* Scale Vertical Pane State's options
*/
options: IVerticalAxisOptions;
/**
* Scale Vertical Pane State's scale adapter
*/
scaleAdapter: IVerticalAxisAdapterState;
}
enum ScaleKind {
LINEAR = "linear",
LOGARITHMIC = "logarithmic"
}
/**
* Provides model of Scale Vertical Pane
*/
class VerticalAxis extends Control implements IStateable {
private readonly _pane;
private readonly _coordinateMapper;
private _formatter;
private _leftContentFrame;
private _leftFrame;
private _maxValueRange;
private _minValueRange;
private _options;
private _rightContentFrame;
private _rightFrame;
private _scaleAdapter;
private _coordinateMapperFrame;
private _range;
get range(): IMinMax;
set range(value: IMinMax);
/**
* Get Scale Vertical Pane's default layout template
*/
get defaultLayoutTemplate(): any;
/**
* Get Scale Vertical Pane's auto scale multiplayer
*/
get autoScaleMultiplier(): number;
set autoScaleMultiplier(value: number);
/**
* Get disable paddings for scale
*/
get disablePaddings(): boolean;
set disablePaddings(value: boolean);
/**
* Get Scale Vertical Pane's chart
*/
get chart(): Chart;
/**
* Get Scale Vertical Pane's chart scale vertical
*/
get verticalScale(): VerticalScale;
/**
* Get Scale Vertical Pane's formatter
*/
get formatter(): INumberFormatter;
set formatter(value: INumberFormatter);
/**
* Get Scale Vertical Pane's left frame
*/
get leftFrame(): Bounds;
/**
* Get Scale Vertical Pane's minor tick mark length
*/
get minorTickLength(): number;
set minorTickLength(value: number);
/**
* Get Scale Vertical Pane's major tick mark length
*/
get majorTickLength(): number;
set majorTickLength(value: number);
/**
* Get Scale Vertical Pane's maximum allowed value
*/
get minAllowedValue(): number;
set minAllowedValue(value: number);
/**
* Get Scale Vertical Pane's maximum allowed value
*/
get maxAllowedValue(): number;
set maxAllowedValue(value: number);
/**
* Get Scale Vertical Pane's maximum allowed value ratio
*/
get minAllowedValueRatio(): number;
set minAllowedValueRatio(value: number);
/**
* Get Scale Vertical Pane's maximum allowed value ratio
*/
get maxAllowedValueRatio(): number;
set maxAllowedValueRatio(value: number);
/**
* Get Scale Vertical Pane's minimum value range
*/
get minValueRange(): number;
set minValueRange(value: number);
/**
* Get Scale Vertical Pane's maximum value range
*/
get maxValueRange(): number;
set maxValueRange(value: number);
/**
* Get Scale Vertical Pane's minimum value range ratio
*/
get minValueRangeRatio(): number;
set minValueRangeRatio(value: number);
/**
* Get Scale Vertical Pane's maximum value range ratio
*/
get maxValueRangeRatio(): number;
set maxValueRangeRatio(value: number);
/**
* Get Scale Vertical Pane's minimum visible value
*/
get minVisibleValue(): number;
set minVisibleValue(value: number);
/**
* Get Scale Vertical Pane's maximum visible value
*/
get maxVisibleValue(): number;
set maxVisibleValue(value: number);
/**
* Get Scale Vertical Pane's name
*/
get kind(): ScaleKind;
set kind(value: ScaleKind);
/**
* Get Scale Vertical Pane's padding
*/
get padding(): IPadding;
/**
* Get Scale Vertical Pane's pane
*/
get pane(): Pane;
/**
* Get Scale Vertical Pane's right frame
*/
get rightFrame(): Bounds;
/**
* Get Scale Vertical Pane's scale adapter
*/
get scaleAdapter(): IVerticalAxisAdapter;
set scaleAdapter(value: IVerticalAxisAdapter);
/**
* Get Scale Vertical Pane's scale coordinate mapper
*/
get coordinateMapper(): ScaleCoordinateMapper;
/**
* Get Scale Vertical Pane's scale coordinate mapper frame
*/
get coordinateMapperFrame(): Bounds;
/**
* Get Scale Vertical Pane's theme
*/
get theme(): unknown;
set theme(value: unknown);
/**
* Creates an instance of VerticalAxis.
*
* @param config
*/
constructor(config: IVerticalAxisConfig);
/**
* Auto scales Scale Vertical Pane
*/
autoScale(): void;
/**
* Auto scales all Scale Vertical Pane
*
* @param minimum
* @param maximum
*/
autoScaleAll(minimum: number, maximum: number): void;
/**
* Clips Scale Vertical Pane
*
* @return Is Scale Vertical Pane clip
*/
clip(): boolean;
dispose(): void;
/**
* Paints Scale Vertical Pane
*/
paint(): void;
/**
* Formats Scale Vertical Pane value
*
* @param value
* @return Formatted Scale Vertical Pane value
*/
formatValue(value: number): string;
hitTest(point: IPoint): boolean;
resize(frame: Bounds): void;
saveState(): IVerticalAxisState;
restoreState(state: IVerticalAxisState): void;
/**
* Makes Scale Vertical Pane auto scale
*
* @return Scale Vertical Pane auto scale is made
*/
makeAutoScale(): boolean;
/**
* Retrieves Scale Vertical Pane's preferred width
*
* @return Scale Vertical Pane's preferred width
*/
preferredWidth(): number;
/**
* Scrolls Scale Vertical Pane on pixels
*
* @param pixels
* @return Scrolled Scale Vertical Pane on pixels
*/
scrollOnPixels(pixels: number): boolean;
/**
* Scrolls Scale Vertical Pane on value
*
* @param valueOffset
* @return Scrolled Scale Vertical Pane on value
*/
scrollOnValue(valueOffset: number): boolean;
/**
* Sets Scale Vertical Pane's formatters decimal digits
*
* @param decimalDigits
*/
setFormattersDecimalDigits(decimalDigits: number): void;
/**
* Refreshes Scale Vertical Pane's scale async
*/
refreshScaleAsync(): void;
/**
* Refreshes Scale Vertical Pane's auto scale all async
*
* @param minimum
* @param maximum
*/
refreshAutoScaleAllAsync(minimum: number, maximum: number): void;
/**
* Zooms Scale Vertical Pane on pixels
*
* @param pixels
* @return Zoomed Scale Vertical Pane on pixels
*/
zoomOnPixels(pixels: number): boolean;
/**
* Zooms Scale Vertical Pane on value
*
* @param valueOffset
* @return Zoomed Scale Vertical Pane on value
*/
zoomOnValue(valueOffset: number): boolean;
zoomOrScrollWithUpdate(offset: number, func: (value: number) => void): void;
protected initMotionEvents(): MotionEventArray;
private canSetVisibleValueRange;
private onDoubleClick;
private onMouseWheel;
private onMove;
private index;
private layoutContentFrames;
private updateFormatter;
private valueOffset;
}
}
declare module FintaChart {
/**
* Represents Scale Vertical Container Config
*/
interface IVerticalAxisPaneConfig {
/**
* Scale Vertical Container Config css class
*/
cssClass: string;
/**
* Scale Vertical Container Config scale vertical
*/
verticalScale: VerticalScale;
/**
* Scale Vertical Container Config visible
*/
visible?: boolean;
}
/**
* Provides model of Scale Vertical Container
*/
class VerticalAxisPane extends HtmlControl {
private static TRANSPARENT;
private readonly _cssClass;
private readonly _verticalScale;
private _isVisible;
/**
* Get Scale Vertical Container's chart
*/
get chart(): Chart;
/**
* Get Scale Vertical Container's content size
*/
get contentSize(): ISize;
/**
* Get Scale Vertical Container's css class
*/
get cssClass(): string;
/**
* Get Scale Vertical Container's scale vertical
*/
get verticalScale(): VerticalScale;
/**
* Get Scale Vertical Container's size
*/
get size(): ISize;
/**
* Get Scale Vertical Container's visible
*/
get visible(): boolean;
set visible(value: boolean);
/**
* Creates an instance of VerticalAxisPane.
*
* @param config
*/
constructor(config: IVerticalAxisPaneConfig);
/**
* Setups Scale Vertical Container's layout theme
*/
setupLayoutTheme(): void;
/**
* Retrieves Scale Vertical Container's width
*
* @return Scale Vertical Container's width
*/
getWidth(): number;
resize(frame: Bounds, isLeftPane?: boolean): Bounds;
protected createContainer(): HTMLElement;
}
}
declare module FintaChart {
/**
* Represents Scale Vertical Config
*/
interface IVerticalScaleOptions {
showLeftPane?: boolean;
showRightPane?: boolean;
width?: number;
useManualWidth?: boolean;
}
interface IVerticalScaleConfig extends IChartComponentConfig {
/**
* Represents Scale Vertical Config show left pane
*/
showLeftPane?: boolean;
/**
* Represents Scale Vertical Config show right pane
*/
showRightPane?: boolean;
/**
* Represents Scale Vertical Config use manual width
*/
useManualWidth?: boolean;
/**
* Represents Scale Vertical Config width
*/
width?: number;
}
/**
* Provides model of Scale Vertical
*/
class VerticalScale extends ChartComponent implements IStateable