From 785cc5d123ae7117a6acb1fd8153aea12a91be91 Mon Sep 17 00:00:00 2001 From: lihu Date: Wed, 25 Mar 2020 11:23:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=B0=BA=E5=AF=B8=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/klinecharts.development.js | 26 ++++++++++++++------------ dist/klinecharts.development.js.map | 2 +- dist/klinecharts.production.min.js | 2 +- src/view/View.js | 26 ++++++++++++++------------ 4 files changed, 30 insertions(+), 26 deletions(-) diff --git a/dist/klinecharts.development.js b/dist/klinecharts.development.js index 46a77338e..c9c3e4360 100644 --- a/dist/klinecharts.development.js +++ b/dist/klinecharts.development.js @@ -3518,19 +3518,21 @@ function () { value: function setSize(width, height) { var _this = this; - this._redraw(function () { - var pixelRatio = getPixelRatio(_this._ctx); - _this._width = width; - _this._height = height; - _this._canvas.style.top = '0'; - _this._canvas.style.width = "".concat(width, "px"); - _this._canvas.style.height = "".concat(height, "px"); - _this._canvas.width = width * pixelRatio; - _this._canvas.height = height * pixelRatio; - - _this._ctx.scale(pixelRatio, pixelRatio); // this._ctx.translate(0.5, 0.5) + if (this._width !== width || this._height !== height) { + this._redraw(function () { + var pixelRatio = getPixelRatio(_this._ctx); + _this._width = width; + _this._height = height; + _this._canvas.style.top = '0'; + _this._canvas.style.width = "".concat(width, "px"); + _this._canvas.style.height = "".concat(height, "px"); + _this._canvas.width = width * pixelRatio; + _this._canvas.height = height * pixelRatio; + + _this._ctx.scale(pixelRatio, pixelRatio); // this._ctx.translate(0.5, 0.5) - }); + }); + } } /** * 刷新 diff --git a/dist/klinecharts.development.js.map b/dist/klinecharts.development.js.map index 24d65ecac..56909c5ed 100644 --- a/dist/klinecharts.development.js.map +++ b/dist/klinecharts.development.js.map @@ -1 +1 @@ -{"version":3,"file":"klinecharts.development.js","sources":["../src/utils/typeChecks.js","../src/data/options/styleOptions.js","../src/data/options/technicalIndicatorParamOptions.js","../src/data/options/precisionOptions.js","../src/data/calcIndicator.js","../src/utils/format.js","../src/data/ChartData.js","../src/utils/canvas.js","../src/series/Series.js","../src/widget/Widget.js","../src/utils/compatible.js","../src/view/View.js","../src/view/TechnicalIndicatorView.js","../src/view/TechnicalIndicatorFloatLayerView.js","../src/widget/TechnicalIndicatorWidget.js","../src/view/YAxisView.js","../src/view/AxisFloatLayerView.js","../src/view/YAxisFloatLayerView.js","../src/widget/YAxisWidget.js","../src/component/Axis.js","../src/component/YAxis.js","../src/series/TechnicalIndicatorSeries.js","../src/view/CandleStickView.js","../src/view/CandleStickFloatLayerView.js","../src/utils/graphic.js","../src/event/EventBase.js","../src/event/EventHandler.js","../src/event/GraphicMarkEventHandler.js","../src/view/GraphicMarkView.js","../src/widget/CandleStickWidget.js","../src/series/CandleStickSeries.js","../src/view/XAxisView.js","../src/view/XAxisFloatLayerView.js","../src/widget/XAxisWidget.js","../src/component/XAxis.js","../src/series/XAxisSeries.js","../src/series/SeparatorSeries.js","../src/event/ZoomDragEventHandler.js","../src/event/KeyBoardEventHandler.js","../src/event/ChartEvent.js","../src/series/ChartSeries.js","../src/Chart.js","../src/index.js"],"sourcesContent":["export function merge (target, source) {\n if (!isObject(target) || !isObject(source)) {\n return\n }\n for (const key in source) {\n if (target.hasOwnProperty(key)) {\n const targetProp = target[key]\n const sourceProp = source[key]\n if (isObject(sourceProp) &&\n isObject(targetProp) &&\n !isArray(sourceProp) &&\n !isArray(targetProp)\n ) {\n merge(targetProp, sourceProp)\n } else {\n if (source[key] || source[key] === 0 || source[key] === false) {\n target[key] = source[key]\n }\n }\n }\n }\n}\n\nexport function clone (target) {\n if (!target || !isObject(target)) {\n return target\n }\n\n let copy\n if (isArray(target)) {\n copy = []\n } else {\n copy = {}\n }\n let p\n let v\n for (p in target) {\n if (target.hasOwnProperty(p)) {\n v = target[p]\n if (v && isObject(v)) {\n copy[p] = clone(v)\n } else {\n copy[p] = v\n }\n }\n }\n\n return copy\n}\n\nexport function isArray (value) {\n return Object.prototype.toString.call(value) === '[object Array]'\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nexport function isFunction (value) {\n return typeof value === 'function'\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nexport function isObject (value) {\n const type = typeof value\n return type === 'function' || (!!value && type === 'object')\n}\n\n/**\n * 判断是否是数字\n * @param value\n * @returns {boolean}\n */\nexport function isNumber (value) {\n return typeof value === 'number' && !isNaN(value)\n}\n\n/**\n * 判断是否是boolean\n * @param value\n * @returns {boolean}\n */\nexport function isBoolean (value) {\n return typeof value === 'boolean'\n}\n","/**\n * 线的样式\n * @type {{DASH: string, SOLID: string}}\n */\nexport const LineStyle = {\n DASH: 'dash',\n SOLID: 'solid'\n}\n\n/**\n * y轴位置\n * @type {{LEFT: string, RIGHT: string}}\n */\nexport const YAxisPosition = {\n LEFT: 'left',\n RIGHT: 'right'\n}\n\n/**\n * y轴文字位置\n * @type {{OUTSIDE: string, INSIDE: string}}\n */\nexport const YAxisTextPosition = {\n INSIDE: 'inside',\n OUTSIDE: 'outside'\n}\n\n/**\n * 主图类型\n * @type {{TIME_LINE: string, CANDLE: string}}\n */\nexport const ChartType = {\n REAL_TIME: 'real_time',\n CANDLE_STICK: 'candle_stick'\n}\n\n/**\n * 蜡烛图样式\n * @type {{STROKE: string, DECREASING_STROKE: string, OHLC: string, INCREASING_STROKE: string, SOLID: string}}\n */\nexport const CandleStickStyle = {\n SOLID: 'solid',\n STROKE: 'stroke',\n UP_STROKE: 'up_stroke',\n DOWN_STROKE: 'down_stroke',\n OHLC: 'ohlc'\n}\n\n/**\n * 提示文字显示规则\n * @type {{FOLLOW_CROSS: string, NONE: string, ALWAYS: string}}\n */\nexport const FloatLayerPromptDisplayRule = {\n ALWAYS: 'always',\n FOLLOW_CROSS: 'follow_cross',\n NONE: 'none'\n}\n\n/**\n * 主图数据提示显示类型\n * @type {{FLOAT: string, FIXED: string}}\n */\nexport const FloatLayerPromptCandleStickTextDisplayType = {\n RECT: 'rect',\n STANDARD: 'standard'\n}\n\n/**\n * 默认网格配置\n * @type {{horizontal: {size: number, color: string, dashValue: number[], display: boolean, style: string}, display: boolean, vertical: {size: number, color: string, dashValue: number[], display: boolean, style: string}}}\n */\nconst defaultGrid = {\n display: true,\n horizontal: {\n display: true,\n size: 1,\n color: '#393939',\n style: LineStyle.DASH,\n dashValue: [2, 2]\n },\n vertical: {\n display: false,\n size: 1,\n color: '#393939',\n style: LineStyle.DASH,\n dashValue: [2, 2]\n }\n}\n\n/**\n * 默认蜡烛柱图配置\n * @type {{bar: {upColor: string, style: string, downColor: string}}}\n */\nconst defaultCandleStick = {\n bar: {\n /**\n * 蜡烛样式\n */\n style: CandleStickStyle.SOLID,\n /**\n * 上涨颜色\n */\n upColor: '#26A69A',\n /**\n * 下跌颜色\n */\n downColor: '#EF5350',\n /**\n * 无变化时颜色\n */\n noChangeColor: '#666666'\n },\n priceMark: {\n display: true,\n high: {\n display: true,\n color: '#D9D9D9',\n textMargin: 5,\n textSize: 10\n },\n low: {\n display: true,\n color: '#D9D9D9',\n textMargin: 5,\n textSize: 10\n },\n last: {\n display: true,\n upColor: '#26A69A',\n downColor: '#EF5350',\n noChangeColor: '#666666',\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 4],\n size: 1\n },\n text: {\n display: true,\n size: 12,\n paddingLeft: 2,\n paddingTop: 2,\n paddingRight: 2,\n paddingBottom: 2,\n color: '#FFFFFF'\n }\n }\n }\n}\n\n/**\n * 默认的分时图配置\n * @type {{timeLine: {areaFillColor: string, color: string, size: number}, averageLine: {color: string, size: number, display: boolean}}}\n */\nconst defaultRealTime = {\n timeLine: {\n color: '#1e88e5',\n size: 1,\n areaFillColor: 'rgba(30, 136, 229, 0.08)'\n },\n /**\n * 均线\n */\n averageLine: {\n display: true,\n color: '#F5A623',\n size: 1\n }\n}\n\n/**\n * 默认的技术指标图配置\n * @type {{decreasingColor: string, lineColors: [string, string, string, string, string], increasingColor: string, lineSize: number}}\n */\nconst defaultTechnicalIndicator = {\n bar: {\n upColor: '#26A69A',\n downColor: '#EF5350',\n noChangeColor: '#666666'\n },\n line: {\n size: 1,\n colors: ['#D9D9D9', '#F5A623', '#F601FF', '#1587DD', '#1e88e5']\n }\n}\n\nconst defaultXAxis = {\n /**\n * 是否显示整个轴\n */\n display: true,\n /**\n * x轴最大高度\n */\n maxHeight: 50,\n /**\n * x轴最小高度\n */\n minHeight: 30,\n /**\n * 轴线配置\n */\n axisLine: {\n display: true,\n color: '#888888',\n size: 1\n },\n\n /**\n * tick文字\n */\n tickText: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n margin: 3\n },\n // tick线\n tickLine: {\n display: true,\n size: 1,\n length: 3,\n color: '#888888'\n }\n}\n\nconst defaultYAxis = {\n /**\n * 是否显示整个轴\n */\n display: true,\n /**\n * x轴最大宽度\n */\n maxWidth: 100,\n /**\n * x轴最小宽度\n */\n minWidth: 60,\n /**\n * 轴位置\n */\n position: YAxisPosition.RIGHT,\n /**\n * 轴线配置\n */\n axisLine: {\n display: true,\n color: '#888888',\n size: 1\n },\n\n /**\n * tick文字\n */\n tickText: {\n position: YAxisTextPosition.OUTSIDE,\n display: true,\n color: '#D9D9D9',\n size: 12,\n margin: 3\n },\n // tick线\n tickLine: {\n display: true,\n size: 1,\n length: 3,\n color: '#888888'\n }\n}\n\n/**\n * 默认浮层配置\n * @type {{display: boolean}}\n */\nconst defaultFloatLayer = {\n crossHair: {\n display: true,\n horizontal: {\n display: true,\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 2],\n size: 1,\n color: '#888888'\n },\n text: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n paddingLeft: 2,\n paddingRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n borderSize: 1,\n borderColor: '#505050',\n backgroundColor: '#505050'\n }\n },\n vertical: {\n display: true,\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 2],\n size: 1,\n color: '#888888'\n },\n text: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n paddingLeft: 2,\n paddingRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n borderSize: 1,\n borderColor: '#505050',\n backgroundColor: '#505050'\n }\n }\n },\n prompt: {\n displayRule: FloatLayerPromptDisplayRule.ALWAYS,\n candleStick: {\n showType: FloatLayerPromptCandleStickTextDisplayType.STANDARD,\n labels: ['时间', '开', '收', '高', '低', '成交量'],\n values: null,\n rect: {\n paddingLeft: 0,\n paddingRight: 0,\n paddingTop: 0,\n paddingBottom: 6,\n left: 8,\n top: 8,\n right: 8,\n borderRadius: 4,\n borderSize: 1,\n borderColor: '#3f4254',\n fillColor: 'rgba(17, 17, 17, .3)'\n },\n text: {\n size: 12,\n color: '#D9D9D9',\n marginLeft: 8,\n marginTop: 6,\n marginRight: 8,\n marginBottom: 0\n }\n },\n technicalIndicator: {\n text: {\n size: 12,\n color: '#D9D9D9',\n marginTop: 6,\n marginRight: 8,\n marginBottom: 0,\n marginLeft: 8\n }\n }\n }\n}\n\n/**\n * 默认图形标记配置\n * @type {{line: {color: string, size: number}, text: {marginRight: number, color: string, size: number, valueFormatter: null, marginBottom: number, marginTop: number, marginLeft: number}, point: {backgroundColor: string, borderColor: string, activeBorderSize: number, activeRadius: number, activeBorderColor: string, activeBackgroundColor: string, borderSize: number, radius: number}}}\n */\nconst defaultGraphicMark = {\n line: {\n color: '#1e88e5',\n size: 1\n },\n point: {\n backgroundColor: '#1e88e5',\n borderColor: '#1e88e5',\n borderSize: 1,\n radius: 4,\n activeBackgroundColor: '#1e88e5',\n activeBorderColor: '#1e88e5',\n activeBorderSize: 1,\n activeRadius: 6\n },\n text: {\n color: '#1e88e5',\n size: 12,\n marginLeft: 2,\n marginRight: 2,\n marginTop: 2,\n marginBottom: 6\n }\n}\n\n/**\n * 图表之间默认分割配置\n * @type {{size: number, color: string}}\n */\nconst defaultSeparator = {\n size: 1,\n color: '#888888',\n fill: true\n}\n\nexport const defaultStyleOptions = {\n grid: defaultGrid,\n candleStick: defaultCandleStick,\n realTime: defaultRealTime,\n technicalIndicator: defaultTechnicalIndicator,\n xAxis: defaultXAxis,\n yAxis: defaultYAxis,\n separator: defaultSeparator,\n floatLayer: defaultFloatLayer,\n graphicMark: defaultGraphicMark\n}\n","export const TechnicalIndicatorType = {\n NO: 'NO',\n AVERAGE: 'AVERAGE',\n MA: 'MA',\n VOL: 'VOL',\n MACD: 'MACD',\n BOLL: 'BOLL',\n KDJ: 'KDJ',\n RSI: 'RSI',\n BIAS: 'BIAS',\n BRAR: 'BRAR',\n CCI: 'CCI',\n DMI: 'DMI',\n CR: 'CR',\n PSY: 'PSY',\n DMA: 'DMA',\n TRIX: 'TRIX',\n OBV: 'OBV',\n VR: 'VR',\n WR: 'WR',\n MTM: 'MTM',\n EMV: 'EMV',\n SAR: 'SAR'\n}\n\nexport const defaultTechnicalIndicatorParamOptions = {\n [TechnicalIndicatorType.MA]: [5, 10, 30, 60],\n [TechnicalIndicatorType.VOL]: [5, 10, 20],\n [TechnicalIndicatorType.MACD]: [12, 26, 9],\n [TechnicalIndicatorType.BOLL]: [20],\n [TechnicalIndicatorType.KDJ]: [9, 3, 3],\n [TechnicalIndicatorType.RSI]: [6, 12, 24],\n [TechnicalIndicatorType.BIAS]: [6, 12, 24],\n [TechnicalIndicatorType.BRAR]: [26],\n [TechnicalIndicatorType.CCI]: [13],\n [TechnicalIndicatorType.DMI]: [14, 6],\n [TechnicalIndicatorType.CR]: [26, 10, 20, 40, 60],\n [TechnicalIndicatorType.PSY]: [12],\n [TechnicalIndicatorType.DMA]: [10, 50, 10],\n [TechnicalIndicatorType.TRIX]: [12, 20],\n [TechnicalIndicatorType.OBV]: [30],\n [TechnicalIndicatorType.VR]: [24, 30],\n [TechnicalIndicatorType.WR]: [13, 34, 89],\n [TechnicalIndicatorType.MTM]: [6, 10],\n [TechnicalIndicatorType.EMV]: [14, 9],\n [TechnicalIndicatorType.SAR]: [2, 2, 20]\n}\n","import { TechnicalIndicatorType } from '../options/technicalIndicatorParamOptions'\n\nexport const defaultPrecisionOptions = {\n price: 2,\n volume: 0,\n [TechnicalIndicatorType.NO]: 2,\n [TechnicalIndicatorType.MA]: 2,\n [TechnicalIndicatorType.VOL]: 0,\n [TechnicalIndicatorType.MACD]: 2,\n [TechnicalIndicatorType.BOLL]: 2,\n [TechnicalIndicatorType.KDJ]: 2,\n [TechnicalIndicatorType.RSI]: 2,\n [TechnicalIndicatorType.BIAS]: 2,\n [TechnicalIndicatorType.BRAR]: 4,\n [TechnicalIndicatorType.CCI]: 4,\n [TechnicalIndicatorType.DMI]: 4,\n [TechnicalIndicatorType.CR]: 2,\n [TechnicalIndicatorType.PSY]: 2,\n [TechnicalIndicatorType.DMA]: 4,\n [TechnicalIndicatorType.TRIX]: 4,\n [TechnicalIndicatorType.OBV]: 4,\n [TechnicalIndicatorType.VR]: 4,\n [TechnicalIndicatorType.WR]: 4,\n [TechnicalIndicatorType.MTM]: 4,\n [TechnicalIndicatorType.EMV]: 4,\n [TechnicalIndicatorType.SAR]: 2\n}\n","import { TechnicalIndicatorType } from './options/technicalIndicatorParamOptions'\nimport { isArray } from '../utils/typeChecks'\n\nconst calcIndicator = {}\n\nexport default calcIndicator\n\n/**\n * 计算均价\n * @param dataList\n * @returns {*}\n */\ncalcIndicator[TechnicalIndicatorType.AVERAGE] = function (dataList) {\n let totalTurnover = 0\n let totalVolume = 0\n return calc(dataList, (i) => {\n const turnover = dataList[i].turnover || 0\n totalVolume += dataList[i].volume || 0\n totalTurnover += turnover\n if (totalVolume !== 0) {\n dataList[i].average = totalTurnover / totalVolume\n } else {\n dataList[i].average = 0\n }\n })\n}\n\n/**\n * 计算均线数据\n * 默认参数5,10,20,60\n * @param dataList\n * @param params\n * @returns {*}\n */\ncalcIndicator[TechnicalIndicatorType.MA] = function (dataList, params) {\n if (!checkParams(params)) {\n return dataList\n }\n const closeSums = []\n const paramsLength = params.length\n return calc(dataList, (i) => {\n const ma = {}\n const close = dataList[i].close\n for (let j = 0; j < paramsLength; j++) {\n closeSums[j] = (closeSums[j] || 0) + close\n const p = params[j]\n if (i < p) {\n ma[`ma${p}`] = closeSums[j] / (i + 1)\n } else {\n closeSums[j] -= dataList[i - p].close\n ma[`ma${p}`] = closeSums[j] / p\n }\n }\n dataList[i].ma = ma\n })\n}\n\n/**\n * 计算成交量包含ma5、ma10、ma20\n * 默认参数5,10,20\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.VOL] = function (dataList, params) {\n if (!checkParams(params)) {\n return dataList\n }\n const volumeSums = []\n const paramsLength = params.length\n return calc(dataList, (i) => {\n const num = dataList[i].volume\n const vol = {}\n for (let j = 0; j < paramsLength; j++) {\n volumeSums[j] = (volumeSums[j] || 0) + num\n const p = params[j]\n if (i < p) {\n vol[`ma${p}`] = volumeSums[j] / (i + 1)\n } else {\n volumeSums[j] -= dataList[i - p].volume\n vol[`ma${p}`] = volumeSums[j] / p\n }\n }\n vol.num = num\n dataList[i].vol = vol\n })\n}\n\n/**\n * 计算MACD指标\n *\n * MACD:参数快线移动平均、慢线移动平均、移动平均,\n * 默认参数值12、26、9。\n * 公式:⒈首先分别计算出收盘价12日指数平滑移动平均线与26日指数平滑移动平均线,分别记为EMA(12)与EMA(26)。\n * ⒉求这两条指数平滑移动平均线的差,即:DIFF=EMA(SHORT)-EMA(LONG)。\n * ⒊再计算DIFF的M日的平均的指数平滑移动平均线,记为DEA。\n * ⒋最后用DIFF减DEA,得MACD。MACD通常绘制成围绕零轴线波动的柱形图。MACD柱状大于0涨颜色,小于0跌颜色。\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.MACD] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let emaShort\n let emaLong\n let oldEmaShort = 0\n let oldEmaLong = 0\n let diff = 0\n let dea = 0\n let oldDea = 0\n let macd = 0\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n if (i === 0) {\n emaShort = closePrice\n emaLong = closePrice\n } else {\n emaShort = (2 * closePrice + (params[0] - 1) * oldEmaShort) / (params[0] + 1)\n emaLong = (2 * closePrice + (params[1] - 1) * oldEmaLong) / (params[1] + 1)\n }\n\n diff = emaShort - emaLong\n dea = (diff * 2 + oldDea * (params[2] - 1)) / (params[2] + 1)\n macd = (diff - dea) * 2\n oldEmaShort = emaShort\n oldEmaLong = emaLong\n oldDea = dea\n\n dataList[i].macd = { diff, dea, macd }\n })\n}\n\n/**\n * 计算BOLL指标\n * 默认参数20\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BOLL] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let closeSum = 0\n let ma// 中轨线\n let md// 标准差\n let up// 上轨线\n let dn// 下轨线\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n closeSum += closePrice\n if (i < params[0]) {\n ma = closeSum / (i + 1)\n md = getBollMd(dataList.slice(0, i + 1), ma)\n } else {\n closeSum -= dataList[i - params[0]].close\n ma = closeSum / params[0]\n md = getBollMd(dataList.slice(i - (params[0] - 1), i + 1), ma)\n }\n up = ma + 2 * md\n dn = ma - 2 * md\n dataList[i].boll = { up, mid: ma, dn }\n })\n}\n\n/**\n * 计算KDJ\n * 默认参数9,3,3\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.KDJ] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let k\n let d\n let j\n\n // n日内最低价\n let ln\n // n日内最高价\n let hn\n\n return calc(dataList, (i) => {\n // n日收盘价\n const cn = dataList[i].close\n\n if (i < (params[0] - 1)) {\n ln = getLow(dataList.slice(0, i + 1))\n hn = getHigh(dataList.slice(0, i + 1))\n } else {\n ln = getLow(dataList.slice(i - (params[0] - 1), i + 1))\n hn = getHigh(dataList.slice(i - (params[0] - 1), i + 1))\n }\n const rsv = (cn - ln) / (hn - ln === 0 ? 1 : hn - ln) * 100\n // 当日K值=2/3×前一日K值+1/3×当日RSV\n // 当日D值=2/3×前一日D值+1/3×当日K值\n // 若无前一日K 值与D值,则可分别用50来代替。\n // J值=3*当日K值-2*当日D值\n k = (params[1] - 1) / params[1] * (i < (params[0] - 1) ? 50.0 : dataList[i - 1].kdj.k) + 1.0 / params[1] * rsv\n d = (params[2] - 1) / params[2] * (i < (params[0] - 1) ? 50.0 : dataList[i - 1].kdj.d) + 1.0 / params[2] * k\n j = 3.0 * k - 2.0 * d\n dataList[i].kdj = { k, d, j }\n })\n}\n\n/**\n * 计算RSI\n * 默认参数6,12,24\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.RSI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n // N日RSI =\n // N日内收盘涨幅的平均值/(N日内收盘涨幅均值+N日内收盘跌幅均值) ×100%\n let sumCloseA1 = 0\n let sumCloseB1 = 0\n\n let sumCloseA2 = 0\n let sumCloseB2 = 0\n\n let sumCloseA3 = 0\n let sumCloseB3 = 0\n\n let a1\n let b1\n\n let a2\n let b2\n\n let a3\n let b3\n\n return calc(dataList, (i) => {\n const rsi = { [`rsi${params[0]}`]: 0, [`rsi${params[1]}`]: 0, [`rsi${params[2]}`]: 0 }\n if (i > 0) {\n const tmp = dataList[i].close - dataList[i - 1].close\n if (tmp > 0) {\n sumCloseA1 += tmp\n sumCloseA2 += tmp\n sumCloseA3 += tmp\n } else {\n const absTmp = Math.abs(tmp)\n sumCloseB1 += absTmp\n sumCloseB2 += absTmp\n sumCloseB3 += absTmp\n }\n\n if (i < params[0]) {\n a1 = sumCloseA1 / (i + 1)\n b1 = (sumCloseA1 + sumCloseB1) / (i + 1)\n } else {\n if (i > params[0]) {\n const agoTmp = dataList[i - params[0]].close - dataList[i - params[0] - 1].close\n if (agoTmp > 0) {\n sumCloseA1 -= agoTmp\n } else {\n sumCloseB1 -= Math.abs(agoTmp)\n }\n }\n a1 = sumCloseA1 / params[0]\n b1 = (sumCloseA1 + sumCloseB1) / params[0]\n }\n rsi[`rsi${params[0]}`] = b1 !== 0.0 ? a1 / b1 * 100 : 0.0\n\n if (i < params[1]) {\n a2 = sumCloseA2 / (i + 1)\n b2 = (sumCloseA2 + sumCloseB2) / (i + 1)\n } else {\n if (i > params[1]) {\n const agoTmp = dataList[i - params[1]].close - dataList[i - params[1] - 1].close\n if (agoTmp > 0) {\n sumCloseA2 -= agoTmp\n } else {\n sumCloseB2 -= Math.abs(agoTmp)\n }\n }\n a2 = sumCloseA2 / params[1]\n b2 = (sumCloseA2 + sumCloseB2) / params[1]\n }\n rsi[`rsi${params[1]}`] = b2 !== 0.0 ? a2 / b2 * 100 : 0.0\n\n if (i < params[2]) {\n a3 = sumCloseA3 / (i + 1)\n b3 = (sumCloseA3 + sumCloseB3) / (i + 1)\n } else {\n if (i > params[2]) {\n const agoTmp = dataList[i - params[2]].close - dataList[i - params[2] - 1].close\n if (agoTmp > 0) {\n sumCloseA3 -= agoTmp\n } else {\n sumCloseB3 -= Math.abs(agoTmp)\n }\n }\n a3 = sumCloseA3 / params[2]\n b3 = (sumCloseA3 + sumCloseB3) / params[2]\n }\n rsi[`rsi${params[2]}`] = b3 !== 0.0 ? a3 / b3 * 100 : 0.0\n }\n dataList[i].rsi = rsi\n })\n}\n\n/**\n * 计算BIAS指标\n * 乖离率=[(当日收盘价-N日平均价)/N日平均价]*100%\n * 默认参数:6,12、24\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BIAS] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let mean1\n let mean2\n let mean3\n let closes1 = 0\n let closes2 = 0\n let closes3 = 0\n\n return calc(dataList, (i) => {\n const bias = {}\n const closePrice = dataList[i].close\n closes1 += closePrice\n closes2 += closePrice\n closes3 += closePrice\n\n if (i < params[0]) {\n mean1 = closes1 / (i + 1)\n } else {\n closes1 -= dataList[i - params[0]].close\n mean1 = closes1 / params[0]\n }\n bias[`bias${params[0]}`] = ((closePrice - mean1) / mean1) * 100\n\n if (i < params[1]) {\n mean2 = closes2 / (i + 1)\n } else {\n closes2 -= dataList[i - params[1]].close\n mean2 = closes2 / params[1]\n }\n bias[`bias${params[1]}`] = ((closePrice - mean2) / mean2) * 100\n\n if (i < params[2]) {\n mean3 = closes3 / (i + 1)\n } else {\n closes3 -= dataList[i - params[2]].close\n mean3 = closes3 / params[2]\n }\n bias[`bias${params[2]}`] = ((closePrice - mean3) / mean3) * 100\n\n dataList[i].bias = bias\n })\n}\n\n/**\n * 计算BRAR指标\n * 默认参数是26。\n * 公式N日BR=N日内(H-CY)之和除以N日内(CY-L)之和*100,\n * 其中,H为当日最高价,L为当日最低价,CY为前一交易日的收盘价,N为设定的时间参数。\n * N日AR=(N日内(H-O)之和除以N日内(O-L)之和)*100,\n * 其中,H为当日最高价,L为当日最低价,O为当日开盘价,N为设定的时间参数\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BRAR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let br = 0\n let ar = 0\n let hcy = 0\n let cyl = 0\n let ho = 0\n let ol = 0\n\n return calc(dataList, (i) => {\n const high = dataList[i].high\n const low = dataList[i].low\n const open = dataList[i].open\n ho += (high - open)\n ol += (open - low)\n if (i > 0) {\n const refClose = dataList[i - 1].close\n hcy += (high - refClose)\n cyl += (refClose - low)\n if (i > params[0] - 1) {\n const agoHigh = dataList[i - params[0]].high\n const agoLow = dataList[i - params[0]].low\n const agoOpen = dataList[i - params[0]].open\n if (i > params[0]) {\n const agoRefClose = dataList[i - params[0] - 1].close\n hcy -= (agoHigh - agoRefClose)\n cyl -= (agoRefClose - agoLow)\n }\n ho -= (agoHigh - agoOpen)\n ol -= (agoOpen - agoLow)\n }\n if (ol !== 0) {\n ar = ho / ol * 100\n } else {\n ar = 0\n }\n if (cyl !== 0) {\n br = hcy / cyl * 100\n } else {\n br = 0\n }\n }\n dataList[i].brar = { br, ar }\n })\n}\n\n/**\n * 计算CCI指标\n * CCI(N日)=(TP-MA)÷MD÷0.015\n * 其中,TP=(最高价+最低价+收盘价)÷3\n * MA=近N日收盘价的累计之和÷N\n * MD=近N日(MA-收盘价)的累计之和÷N\n * 默认参数13\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.CCI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let closes = 0.0\n let closeMa\n const closeMaList = []\n let md\n let maCloseSum = 0.0\n let cci\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n closes += closePrice\n\n const tp = (dataList[i].high + dataList[i].low + closePrice) / 3\n if (i < params[0]) {\n closeMa = closes / (i + 1)\n maCloseSum += Math.abs(closeMa - closePrice)\n closeMaList.push(closeMa)\n md = maCloseSum / (i + 1)\n } else {\n const agoClosePrice = dataList[i - params[0]].close\n closes -= agoClosePrice\n closeMa = closes / params[0]\n closeMaList.push(closeMa)\n maCloseSum += Math.abs(closeMa - closePrice)\n maCloseSum -= Math.abs(closeMaList[i - params[0]] - agoClosePrice)\n md = maCloseSum / params[0]\n }\n cci = md !== 0.0 ? (tp - closeMa) / md / 0.015 : 0.0\n dataList[i].cci = { cci }\n })\n}\n\n/**\n * 计算DMI\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.DMI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n // 默认参数 14,6\n // MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N)\n // HD :=HIGH-REF(HIGH,1);\n // LD :=REF(LOW,1)-LOW;\n // DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);\n // DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);\n //\n // PDI: DMP*100/MTR;\n // MDI: DMM*100/MTR;\n // ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,MM);\n // ADXR:EXPMEMA(ADX,MM);\n // 公式含义:\n // MTR赋值:最高价-最低价和最高价-昨收的绝对值的较大值和昨收-最低价的绝对值的较大值的N日指数平滑移动平均\n // HD赋值:最高价-昨日最高价\n // LD赋值:昨日最低价-最低价\n // DMP赋值:如果HD>0并且HD>LD,返回HD,否则返回0的N日指数平滑移动平均\n // DMM赋值:如果LD>0并且LD>HD,返回LD,否则返回0的N日指数平滑移动平均\n // 输出PDI:DMP*100/MTR\n // 输出MDI:DMM*100/MTR\n // 输出ADX:MDI-PDI的绝对值/(MDI+PDI)*100的MM日指数平滑移动平均\n // 输出ADXR:ADX的MM日指数平滑移动平均\n let pdi = 0.0\n let mdi = 0.0\n let adx = 0.0\n let adxr = 0.0\n\n const trList = [0.0]\n let trSum = 0.0\n const dmpList = [0.0]\n let dmpSum = 0.0\n const dmmList = [0.0]\n let dmmSum = 0.0\n const dxList = [0.0]\n let dxSum = 0.0\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const refClose = dataList[i - 1].close\n const highPrice = dataList[i].high\n const lowPrice = dataList[i].low\n const hl = highPrice - lowPrice\n const hcy = Math.abs(highPrice - refClose)\n const lcy = Math.abs(lowPrice - refClose)\n const hhy = highPrice - dataList[i - 1].high\n const lyl = dataList[i - 1].low - lowPrice\n const tr = Math.max(Math.max(hl, hcy), lcy)\n trSum += tr\n trList.push(tr)\n\n const h = (hhy > 0.0 && hhy > lyl) ? hhy : 0.0\n dmpSum += h\n dmpList.push(h)\n\n const l = (lyl > 0 && lyl > hhy) ? lyl : 0.0\n dmmSum += l\n dmmList.push(l)\n\n if (i > params[0] - 1) {\n trSum -= trList[i - params[0]]\n dmpSum -= dmpList[i - params[0]]\n dmmSum -= dmmList[i - params[0]]\n }\n\n if (trSum === 0) {\n pdi = 0\n mdi = 0\n } else {\n pdi = dmpSum * 100 / trSum\n mdi = dmmSum * 100 / trSum\n }\n\n const dx = Math.abs((mdi - pdi)) / (mdi + pdi) * 100\n dxSum += dx\n dxList.push(dx)\n if (i < params[1]) {\n adx = dxSum / (i + 1)\n adxr = adx\n } else {\n const agoAdx = dxList[i - params[1]]\n dxSum -= agoAdx\n adx = dxSum / params[1]\n adxr = (adx + agoAdx) / 2\n }\n }\n dataList[i].dmi = { pdi, mdi, adx, adxr }\n })\n}\n\n/**\n * 计算CR\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.CR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 5)) {\n return dataList\n }\n // 默认参数26、10、20、40、60\n // MID:=REF(HIGH+LOW,1)/2;\n // CR:SUM(MAX(0,HIGH-MID),N)/SUM(MAX(0,MID-LOW),N)*100;\n // MA1:REF(MA(CR,M1),M1/2.5+1);\n // MA2:REF(MA(CR,M2),M2/2.5+1);\n // MA3:REF(MA(CR,M3),M3/2.5+1);\n // MA4:REF(MA(CR,M4),M4/2.5+1);\n // MID赋值:(昨日最高价+昨日最低价)/2\n // 输出带状能量线:0和最高价-MID的较大值的N日累和/0和MID-最低价的较大值的N日累和*100\n // 输出MA1:M1(5)/2.5+1日前的CR的M1(5)日简单移动平均\n // 输出MA2:M2(10)/2.5+1日前的CR的M2(10)日简单移动平均\n // 输出MA3:M3(20)/2.5+1日前的CR的M3(20)日简单移动平均\n // 输出MA4:M4/2.5+1日前的CR的M4日简单移动平均\n let cr = 0\n let ma1\n let ma2\n let ma3\n let ma4\n let p1 = 0\n let p2 = 0\n let ma1Sum = 0\n let ma1Mean\n const ma1List = []\n let ma2Sum = 0\n let ma2Mean\n const ma2List = []\n let ma3Sum = 0\n let ma3Mean\n const ma3List = []\n let ma4Sum = 0\n let ma4Mean\n const ma4List = []\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const preHighestPrice = dataList[i - 1].high\n const preLowestPrice = dataList[i - 1].low\n const preClosePrice = dataList[i - 1].close\n const preOpenPrice = dataList[i - 1].open\n const preMidPrice = (preHighestPrice + preClosePrice + preLowestPrice + preOpenPrice) / 4\n\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n\n let highSubPreMid = highestPrice - preMidPrice\n if (highSubPreMid < 0) {\n highSubPreMid = 0\n }\n p1 += highSubPreMid\n\n let preMidSubLow = preMidPrice - lowestPrice\n if (preMidSubLow < 0) {\n preMidSubLow = 0\n }\n p2 += preMidSubLow\n\n if (i > params[0]) {\n const firstHighestPrice = dataList[i - params[0] - 1].high\n const firstLowestPrice = dataList[i - params[0] - 1].low\n const firstClosePrice = dataList[i - params[0] - 1].close\n const firstOpenPrice = dataList[i - params[0] - 1].open\n const firstMidPrice = (firstHighestPrice + firstLowestPrice + firstClosePrice + firstOpenPrice) / 4\n\n const secondHighestPrice = dataList[i - params[0]].high\n const secondLowestPrice = dataList[i - params[0]].low\n\n let secondHighSubFirstMid = secondHighestPrice - firstMidPrice\n if (secondHighSubFirstMid < 0) {\n secondHighSubFirstMid = 0\n }\n\n let firstMidSubSecondLow = firstMidPrice - secondLowestPrice\n if (firstMidSubSecondLow < 0) {\n firstMidSubSecondLow = 0\n }\n p1 -= secondHighSubFirstMid\n p2 -= firstMidSubSecondLow\n }\n\n if (p2 !== 0) {\n cr = p1 / p2 * 100\n }\n\n const YM = (dataList[i - 1].high + dataList[i - 1].low + dataList[i - 1].close) / 3\n const HYM = dataList[i].high - YM\n p1 += (HYM <= 0 ? 0 : HYM)\n const LYM = YM - dataList[i].low\n p2 += (LYM <= 0 ? 0 : LYM)\n }\n ma1Sum += cr\n ma2Sum += cr\n ma3Sum += cr\n ma4Sum += cr\n\n if (i < params[1]) {\n ma1Mean = ma1Sum / (i + 1)\n } else {\n ma1Sum -= dataList[i - params[1]].cr.cr\n ma1Mean = ma1Sum / params[1]\n }\n ma1List.push(ma1Mean)\n\n if (i < params[2]) {\n ma2Mean = ma2Sum / (i + 1)\n } else {\n ma2Sum -= dataList[i - params[2]].cr.cr\n ma2Mean = ma2Sum / params[2]\n }\n ma2List.push(ma2Mean)\n\n if (i < params[3]) {\n ma3Mean = ma3Sum / (i + 1)\n } else {\n ma3Sum -= dataList[i - params[3]].cr.cr\n ma3Mean = ma3Sum / params[3]\n }\n ma3List.push(ma3Mean)\n\n if (i < params[4]) {\n ma4Mean = ma4Sum / (i + 1)\n } else {\n ma4Sum -= dataList[i - params[4]].cr.cr\n ma4Mean = ma4Sum / params[4]\n }\n ma4List.push(ma4Mean)\n\n if (i < 5) {\n ma1 = ma1List[0]\n } else {\n ma1 = ma1List[i - 5]\n }\n\n if (i < 9) {\n ma2 = ma2List[0]\n } else {\n ma2 = ma2List[i - 9]\n }\n\n if (i < 17) {\n ma3 = ma3List[0]\n } else {\n ma3 = ma3List[i - 17]\n }\n\n if (i < 25) {\n ma4 = ma4List[0]\n } else {\n ma4 = ma4List[i - 25]\n }\n dataList[i].cr = { cr, ma1, ma2, ma3, ma4 }\n })\n}\n\n/**\n * 计算PSY\n * 默认参数是12。公式:PSY=N日内的上涨天数/N×100%。\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.PSY] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let psy = 0\n let upDay = 0\n\n return calc(dataList, (i) => {\n if (i > 0) {\n upDay += (dataList[i].close - dataList[i - 1].close > 0 ? 1 : 0)\n if (i < params[0]) {\n psy = upDay / (i + 1) * 100\n } else {\n if (i > params[0]) {\n upDay -= ((dataList[i - params[0] + 1].close - dataList[i - params[0]].close > 0) ? 1.0 : 0.0)\n }\n psy = upDay / params[0] * 100\n }\n }\n dataList[i].psy = { psy }\n })\n}\n\n/**\n * 计算DMA\n * 默认参数是10、50、10。\n * 公式:DIF:MA(CLOSE,N1)-MA(CLOSE,N2);DIFMA:MA(DIF,M)\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.DMA] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let dif\n let difMa\n let ma1Sum = 0\n let ma1\n let ma2Sum = 0\n let ma2\n let difSum = 0\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n\n ma1Sum += closePrice\n ma2Sum += closePrice\n\n if (i < params[0]) {\n ma1 = ma1Sum / (i + 1)\n } else {\n ma1Sum -= dataList[i - params[0]].close\n ma1 = ma1Sum / params[0]\n }\n\n if (i < params[1]) {\n ma2 = ma2Sum / (i + 1)\n } else {\n ma2Sum -= dataList[i - params[1]].close\n ma2 = ma2Sum / params[1]\n }\n dif = ma1 - ma2\n difSum += dif\n\n if (i < params[2]) {\n difMa = difSum / (i + 1)\n } else {\n difSum -= dataList[i - params[2]].dma.dif\n difMa = difSum / params[2]\n }\n\n dataList[i].dma = { dif, difMa }\n })\n}\n\n/**\n * 计算TRIX\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.TRIX] = function (dataList, params) {\n // TR=收盘价的N日指数移动平均的N日指数移动平均的N日指数移动平均;\n // TRIX=(TR-昨日TR)/昨日TR*100;\n // MATRIX=TRIX的M日简单移动平均;\n // 默认参数N设为12,默认参数M设为20;\n // 默认参数12、20\n // 公式:MTR:=EMA(EMA(EMA(CLOSE,N),N),N)\n // TRIX:(MTR-REF(MTR,1))/REF(MTR,1)*100;\n // TRMA:MA(TRIX,M)\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let trix = 0\n let maTrix\n let sumTrix = 0\n\n let emaClose1\n let oldEmaClose1 = 0.0\n\n let emaClose2\n let oldEmaClose2 = 0.0\n\n let emaClose3\n let oldEmaClose3 = 0.0\n const emaClose3List = []\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n if (i === 0) {\n emaClose1 = closePrice\n emaClose2 = emaClose1\n emaClose3 = emaClose2\n } else {\n emaClose1 = (2 * closePrice + (params[0] - 1) * oldEmaClose1) / (params[0] + 1)\n emaClose2 = (2 * emaClose1 + (params[0] - 1) * oldEmaClose2) / (params[0] + 1)\n emaClose3 = (2 * emaClose2 + (params[0] - 1) * oldEmaClose3) / (params[0] + 1)\n const refEmaClose3 = emaClose3List[i - 1]\n trix = refEmaClose3 === 0.0 ? 0.0 : (emaClose3 - refEmaClose3) / refEmaClose3 * 100\n }\n oldEmaClose1 = emaClose1\n oldEmaClose2 = emaClose2\n oldEmaClose3 = emaClose3\n emaClose3List.push(emaClose3)\n sumTrix += trix\n if (i < params[1]) {\n maTrix = sumTrix / (i + 1)\n } else {\n sumTrix -= dataList[i - params[1]].trix.trix\n maTrix = sumTrix / params[1]\n }\n dataList[i].trix = { trix, maTrix }\n })\n}\n\n/**\n * 计算obv指标\n * VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);\n * OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);\n * MAOBV:MA(OBV,M);\n * VA赋值:如果收盘价>昨收,返回成交量(手),否则返回-成交量(手)\n * 输出OBV:如果收盘价=昨收,返回0,否则返回VA的历史累和\n * 输出MAOBV:OBV的M日简单移动平均\n * 默认参数30\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.OBV] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let obv\n let sumObv = 0.0\n let maObv\n let sumVa = 0.0\n\n return calc(dataList, (i) => {\n const volume = dataList[i].volume\n if (i === 0) {\n obv = volume\n sumVa += volume\n } else {\n const refClosePrice = dataList[i - 1].close\n const closePrice = dataList[i].close\n const va = closePrice > refClosePrice ? volume : -volume\n\n sumVa += va\n obv = closePrice === refClosePrice ? 0.0 : sumVa\n }\n sumObv += obv\n if (i < params[0]) {\n maObv = sumObv / (i + 1)\n } else {\n sumObv -= dataList[i - params[0]].obv.obv\n maObv = sumObv / params[0]\n }\n dataList[i].obv = { obv, maObv }\n })\n}\n\n/**\n * 计算vr指标\n * 默认参数24 , 30\n * VR=(AVS+1/2CVS)/(BVS+1/2CVS)\n * 24天以来凡是股价上涨那一天的成交量都称为AV,将24天内的AV总和相加后称为AVS\n * 24天以来凡是股价下跌那一天的成交量都称为BV,将24天内的BV总和相加后称为BVS\n * 24天以来凡是股价不涨不跌,则那一天的成交量都称为CV,将24天内的CV总和相加后称为CVS\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.VR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let avs = 0\n let bvs = 0\n let cvs = 0\n let vr = 0\n let maVr\n let sumVr = 0\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n const openPrice = dataList[i].open\n const volume = dataList[i].volume\n if (closePrice > openPrice) {\n avs += volume\n } else if (closePrice < openPrice) {\n bvs += volume\n } else {\n cvs += volume\n }\n\n if (i > params[0] - 1) {\n const agoClosePrice = dataList[i - params[0]].close\n const agoOpenPrice = dataList[i - params[0]].open\n const agoVolume = dataList[i - params[0]].volume\n if (agoClosePrice > agoOpenPrice) {\n avs -= agoVolume\n } else if (agoClosePrice < agoOpenPrice) {\n bvs -= agoVolume\n } else {\n cvs -= agoVolume\n }\n }\n\n const v = bvs + 1 / 2 * cvs\n if (v !== 0) {\n vr = (avs + 1 / 2 * cvs) / v * 100\n }\n sumVr += vr\n if (i < params[1]) {\n maVr = sumVr / (i + 1)\n } else {\n sumVr -= dataList[i - params[1]].vr.vr\n maVr = sumVr / params[1]\n }\n dataList[i].vr = { vr, maVr }\n })\n}\n\n/**\n * 计算wr指标\n * 默认参数13 34 89\n * 公式 WR(N) = 100 * [ HIGH(N)-C ] / [ HIGH(N)-LOW(N) ]\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.WR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let wr1\n let wr2\n let wr3\n let h1 = Number.MIN_SAFE_INTEGER\n let l1 = Number.MAX_SAFE_INTEGER\n let h2 = Number.MIN_SAFE_INTEGER\n let l2 = Number.MAX_SAFE_INTEGER\n let h3 = Number.MIN_SAFE_INTEGER\n let l3 = Number.MAX_SAFE_INTEGER\n\n let hl1\n let hl2\n let hl3\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n const highPrice = dataList[i].high\n const lowPrice = dataList[i].low\n\n if (i < params[0]) {\n h1 = Math.max(highPrice, h1)\n l1 = Math.min(lowPrice, l1)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[0], i))\n h1 = highLowPriceArray[0]\n l1 = highLowPriceArray[1]\n }\n hl1 = h1 - l1\n wr1 = hl1 !== 0 ? (h1 - closePrice) / hl1 * 100 : 0.0\n\n if (i < params[1]) {\n h2 = Math.max(highPrice, h2)\n l2 = Math.min(lowPrice, l2)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[1], i))\n h2 = highLowPriceArray[0]\n l2 = highLowPriceArray[1]\n }\n hl2 = h2 - l2\n wr2 = hl2 !== 0 ? (h2 - closePrice) / hl2 * 100 : 0.0\n\n if (i < params[2]) {\n h3 = Math.max(highPrice, h3)\n l3 = Math.min(lowPrice, l3)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[2], i))\n h3 = highLowPriceArray[0]\n l3 = highLowPriceArray[1]\n }\n hl3 = h3 - l3\n wr3 = hl3 !== 0.0 ? (h3 - closePrice) / hl3 * 100 : 0.0\n\n dataList[i].wr = { wr1, wr2, wr3 }\n })\n}\n\n/**\n * 计算mtm指标\n * 默认参数6 10\n * 公式 MTM(N日)=C-CN\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.MTM] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let mtm\n let mtmSum = 0\n let mtmMa\n return calc(dataList, (i) => {\n if (i < params[0]) {\n mtm = 0.0\n mtmMa = 0.0\n } else {\n const closePrice = dataList[i].close\n mtm = closePrice - dataList[i - params[0]].close\n mtmSum += mtm\n if (i < params[0] + params[1]) {\n mtmMa = mtmSum / (i - params[0] + 1)\n } else {\n mtmMa = mtmSum / params[1]\n mtmSum -= dataList[i - params[1]].mtm.mtm\n }\n }\n dataList[i].mtm = { mtm, mtmMa }\n })\n}\n\n/**\n * 简易波动指标\n * 默认参数N为14,默认参数M为9\n * 公式:\n * A=(今日最高+今日最低)/2\n * B=(前日最高+前日最低)/2\n * C=今日最高-今日最低\n * EM=(A-B)*C/今日成交额\n * EMV=N日内EM的累和\n * MAEMV=EMV的M日的简单移动平均\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.EMV] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n\n let emv = 0\n let maEmv\n let sumEmv = 0\n let em = 0\n\n const emList = []\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const turnover = dataList[i].turnover\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n const preHighestPrice = dataList[i - 1].high\n const preLowestPrice = dataList[i - 1].low\n const highSubLow = highestPrice - lowestPrice\n const halfHighAddLow = (highestPrice + lowestPrice) / 2\n const preHalfHighAddLow = (preHighestPrice + preLowestPrice) / 2\n em = (halfHighAddLow - preHalfHighAddLow) * highSubLow / turnover\n }\n emList.push(em)\n if (i < params[0]) {\n emv += em\n } else {\n emv -= emList[i - params[0]]\n }\n sumEmv += emv\n if (i < params[1]) {\n maEmv = sumEmv / (i + 1)\n } else {\n sumEmv -= dataList[i - params[1]].emv.emv\n maEmv = sumEmv / params[1]\n }\n dataList[i].emv = { emv, maEmv }\n })\n}\n\n/**\n * 计算sar\n * 默认参数2, 2, 20(开始值,步长,最大值)\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.SAR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n const startAf = params[0] / 100\n const step = params[1] / 100\n const maxAf = params[2] / 100\n // 加速因子\n let af = startAf\n // 极值\n let ep = -100\n // 判断是上涨还是下跌 false:下跌\n let isIncreasing = false\n let sar = 0\n\n return calc(dataList, (i) => {\n // 上一个周期的sar\n const preSar = sar\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n if (isIncreasing) {\n // 上涨\n if (ep === -100 || ep < highestPrice) {\n // 重新初始化值\n ep = highestPrice\n af = Math.min(af + step, maxAf)\n }\n sar = preSar + af * (ep - preSar)\n const lowestPriceMin = Math.min(dataList[Math.max(1, i) - 1].low, lowestPrice)\n if (sar > dataList[i].low) {\n sar = ep\n // 重新初始化值\n af = startAf\n ep = -100\n isIncreasing = !isIncreasing\n } else if (sar > lowestPriceMin) {\n sar = lowestPriceMin\n }\n } else {\n if (ep === -100 || ep > lowestPrice) {\n // 重新初始化值\n ep = lowestPrice\n af = Math.min(af + step, maxAf)\n }\n sar = preSar + af * (ep - preSar)\n const highestPriceMax = Math.max(dataList[Math.max(1, i) - 1].high, highestPrice)\n if (sar < dataList[i].high) {\n sar = ep\n // 重新初始化值\n af = 0\n ep = -100\n isIncreasing = !isIncreasing\n } else if (sar < highestPriceMax) {\n sar = highestPriceMax\n }\n }\n dataList[i].sar = { sar }\n })\n}\n\n/**\n * 计算\n * @param dataList\n * @param calcIndicator\n */\nfunction calc (dataList, calcIndicator) {\n const dataSize = dataList.length\n for (let i = 0; i < dataSize; i++) {\n calcIndicator(i)\n }\n return dataList\n}\n\n/**\n * 计算布林指标中的标准差\n *\n * @param list\n * @param ma\n * @return\n */\nfunction getBollMd (list, ma) {\n let sum = 0\n for (let i = 0; i < list.length; i++) {\n const closeMa = list[i].close - ma\n sum += closeMa * closeMa\n }\n const b = sum > 0\n sum = Math.abs(sum)\n const md = Math.sqrt(sum / list.length)\n return b ? md : -1 * md\n}\n\n/**\n * 获取list中的最大的最高价\n *\n * @param list\n * @return\n */\nfunction getHigh (list) {\n let high = 0\n if (list && list.length > 0) {\n const size = list.length\n high = list[0].high\n for (let i = 1; i < size; i++) {\n high = Math.max(list[i].high, high)\n }\n }\n return high\n}\n\n/**\n * 获取list中的最小的最低价\n *\n * @param list\n * @return\n */\nfunction getLow (list) {\n let low = 0\n if (list && list.length > 0) {\n const size = list.length\n low = list[0].low\n for (let i = 1; i < size; i++) {\n low = Math.min(list[i].low, low)\n }\n }\n return low\n}\n\n/**\n * 获取最大最小值\n * @param list\n * @returns {number[]}\n */\nfunction getHighLow (list) {\n let high = 0\n let low = 0\n if (list && list.length > 0) {\n const size = list.length\n high = list[0].high\n low = list[0].low\n for (let i = 1; i < size; i++) {\n high = Math.max(list[i].high, high)\n low = Math.min(list[i].low, low)\n }\n }\n return [high, low]\n}\n\n/**\n * 检查参数\n * @param params\n */\nfunction checkParams (params) {\n return params && isArray(params)\n}\n\n/**\n * 检查参数, 并检查参数个数\n * @param params\n * @param paramsSize\n */\nfunction checkParamsWithSize (params, paramsSize) {\n return checkParams(params) && params.length === paramsSize\n}\n","import { isNumber, isObject } from './typeChecks'\n\n/**\n * 格式化值\n * @param data\n * @param key\n * @param defaultValue\n * @returns {string|*}\n */\nexport function formatValue (data, key, defaultValue = '--') {\n if (data && isObject(data)) {\n const value = data[key]\n if (value || value === 0 || value === false) {\n return value\n }\n }\n return defaultValue\n}\n\n/**\n * 格式化时间\n * @param timestamp\n * @param format\n * @param timezone\n * @returns {string}\n */\nconst locales = 'en-us'\nexport function formatDate (timestamp, format, timezone) {\n if (timestamp && isNumber(timestamp)) {\n const date = new Date(timestamp)\n let dateTimeString\n try {\n dateTimeString = new Intl.DateTimeFormat(\n locales, { hour12: false, timeZone: timezone, year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' }\n ).format(date)\n } catch (e) {\n dateTimeString = new Intl.DateTimeFormat(\n locales, { hour12: false, year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' }\n ).format(date)\n }\n const dateString = dateTimeString.match(/^[\\d]{1,2}\\/[\\d]{1,2}\\/[\\d]{4}/)[0]\n const dateStringArray = dateString.split('/')\n const month = `${dateStringArray[0].length === 1 ? `0${dateStringArray[0]}` : dateStringArray[0]}`\n const day = `${dateStringArray[1].length === 1 ? `0${dateStringArray[1]}` : dateStringArray[1]}`\n let timeString = dateTimeString.match(/[\\d]{2}:[\\d]{2}$/)[0]\n // 这里将小时24转换成00\n if (timeString.match(/^[\\d]{2}/)[0] === '24') {\n timeString = timeString.replace(/^[\\d]{2}/, '00')\n }\n switch (format) {\n case 'YYYY': {\n return dateStringArray[2]\n }\n case 'YYYY-MM': {\n return `${dateStringArray[2]}-${month}`\n }\n case 'YYYY-MM-DD': {\n return `${dateStringArray[2]}-${month}-${day}`\n }\n case 'YYYY-MM-DD hh:mm': {\n return `${dateStringArray[2]}-${month}-${day} ${timeString}`\n }\n case 'MM-DD': {\n return `${month}-${day}`\n }\n case 'hh:mm': {\n return timeString\n }\n default: {\n return `${month}-${day} ${timeString}`\n }\n }\n }\n return '--'\n}\n\n/**\n * 格式化精度\n */\nexport function formatPrecision (value, precision = 2) {\n const v = +value\n if ((v || v === 0) && isNumber(v)) {\n return value.toFixed(precision)\n }\n return `${v}`\n}\n\n/**\n * 格式化大数据\n * @param value\n */\nexport function formatBigNumber (value) {\n if (isNumber(+value)) {\n if (value > 50000) {\n return `${+((value / 1000).toFixed(1))}K`\n }\n if (value > 5000000) {\n return `${+((value / 1000000).toFixed(3))}M`\n }\n return `${value}`\n }\n return '--'\n}\n","import { isArray, isObject, merge, clone, isFunction, isBoolean } from '../utils/typeChecks'\nimport { defaultStyleOptions } from './options/styleOptions'\nimport { defaultTechnicalIndicatorParamOptions, TechnicalIndicatorType } from './options/technicalIndicatorParamOptions'\nimport { defaultPrecisionOptions } from './options/precisionOptions'\n\nimport calcIndicator from './calcIndicator'\nimport { formatValue } from '../utils/format'\n\nexport const InvalidateLevel = {\n FLOAT_LAYER: 1,\n GRAPHIC_MARK: 2,\n FULL: 3\n}\n\nexport const GraphicMarkType = {\n NONE: 'none',\n HORIZONTAL_STRAIGHT_LINE: 'horizontalStraightLine',\n VERTICAL_STRAIGHT_LINE: 'verticalStraightLine',\n STRAIGHT_LINE: 'straightLine',\n HORIZONTAL_RAY_LINE: 'horizontalRayLine',\n VERTICAL_RAY_LINE: 'verticalRayLine',\n RAY_LINE: 'rayLine',\n HORIZONTAL_SEGMENT_LINE: 'horizontalSegmentLine',\n VERTICAL_SEGMENT_LINE: 'verticalSegmentLine',\n SEGMENT_LINE: 'segmentLine',\n PRICE_LINE: 'priceLine',\n PRICE_CHANNEL_LINE: 'priceChannelLine',\n PARALLEL_STRAIGHT_LINE: 'parallelStraightLine',\n FIBONACCI_LINE: 'fibonacciLine'\n}\n\nconst BAR_MARGIN_SPACE_RATE = 0.25\n\nconst MAX_DATA_SPACE = 30\nconst MIN_DATA_SPACE = 2\n\nexport default class ChartData {\n constructor (styleOptions, invalidateHandler) {\n // 刷新持有者\n this._invalidateHandler = invalidateHandler\n // 样式配置\n this._styleOptions = clone(defaultStyleOptions)\n merge(this._styleOptions, styleOptions)\n // 指标参数配置\n this._technicalIndicatorParamOptions = clone(defaultTechnicalIndicatorParamOptions)\n // 精度配置\n this._precisionOptions = clone(defaultPrecisionOptions)\n // 时区\n this._timezone = null\n\n // 数据源\n this._dataList = []\n\n // 是否在加载中\n this._loading = true\n // 加载更多回调\n this._loadMoreCallback = null\n // 还有更多\n this._more = true\n\n // 可见区域数据占用的空间\n this._totalDataSpace = 0\n // 向右偏移的空间\n this._offsetRightSpace = 50\n // 开始绘制的索引\n this._from = 0\n // 结束的索引\n this._to = 0\n // 绘制区间数据数量\n this._range = 0\n // 每一条数据的空间\n this._dataSpace = 4\n // bar的空间\n this._barSpace = this._calcBarSpace()\n\n // 十字光标位置\n this._crossHairPoint = null\n // 标识十字光标在哪个series\n this._crossHairSeriesTag = null\n // 用来记录开始拖拽时数据绘制开始位置\n this._preFrom = 0\n\n // 当前绘制的标记图形的类型\n this._graphicMarkType = GraphicMarkType.NONE\n // 标记图形点\n this._graphicMarkPoint = null\n // 拖拽标记图形标记\n this._dragGraphicMarkFlag = false\n // 绘图标记数据\n this._graphicMarkDatas = {\n // 水平直线\n horizontalStraightLine: [],\n // 垂直直线\n verticalStraightLine: [],\n // 直线\n straightLine: [],\n // 水平射线\n horizontalRayLine: [],\n // 垂直射线\n verticalRayLine: [],\n // 射线\n rayLine: [],\n // 水平线段\n horizontalSegmentLine: [],\n // 垂直线段\n verticalSegmentLine: [],\n // 线段\n segmentLine: [],\n // 价格线\n priceLine: [],\n // 平行直线\n parallelStraightLine: [],\n // 价格通道线\n priceChannelLine: [],\n // 斐波那契线\n fibonacciLine: []\n }\n }\n\n /**\n * 加载更多持有者\n * @private\n */\n _loadMoreHandler () {\n // 有更多并且没有在加载则去加载更多\n if (this._more && !this._loading && this._loadMoreCallback && isFunction(this._loadMoreCallback)) {\n this._loading = true\n this._loadMoreCallback(formatValue(this._dataList[0], 'timestamp'))\n }\n }\n\n /**\n * 计算绘制区间\n * @private\n */\n _calcRange () {\n this._range = Math.floor(this._totalDataSpace / this._dataSpace)\n this.adjustFromTo()\n }\n\n /**\n * 计算一条柱子的空间\n * @returns {number}\n * @private\n */\n _calcBarSpace () {\n return (1 - BAR_MARGIN_SPACE_RATE) * this._dataSpace\n }\n\n /**\n * 计算rang dif\n * @private\n */\n _calcRangDif () {\n const offsetRightRange = Math.floor(this._offsetRightSpace / this._dataSpace)\n return this._range - offsetRightRange\n }\n\n /**\n * 内部用来设置一条数据的空间\n * @param dataSpace\n * @returns {boolean}\n * @private\n */\n _innerSetDataSpace (dataSpace) {\n if (!dataSpace || dataSpace < MIN_DATA_SPACE || dataSpace > MAX_DATA_SPACE || this._dataSpace === dataSpace) {\n return false\n }\n this._dataSpace = dataSpace\n this._barSpace = this._calcBarSpace()\n this._calcRange()\n return true\n }\n\n /**\n * 获取样式配置\n */\n styleOptions () {\n return this._styleOptions\n }\n\n applyStyleOptions (options) {\n merge(this._styleOptions, options)\n }\n\n /**\n * 获取计算指标参数配置\n */\n technicalIndicatorParamOptions () {\n return this._technicalIndicatorParamOptions\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n applyTechnicalIndicatorParams (technicalIndicatorType, params = []) {\n if (this._technicalIndicatorParamOptions.hasOwnProperty(technicalIndicatorType)) {\n this._technicalIndicatorParamOptions[technicalIndicatorType] = params\n }\n }\n\n /**\n * 精度配置\n */\n precisionOptions () {\n return this._precisionOptions\n }\n\n /**\n * 设置时区\n * @param timezone\n */\n setTimezone (timezone) {\n this._timezone = timezone\n }\n\n /**\n * 获取时区\n * @returns {null}\n */\n timezone () {\n return this._timezone\n }\n\n /**\n * 加载精度\n * @param pricePrecision\n * @param volumePrecision\n */\n applyPrecision (pricePrecision, volumePrecision) {\n if ((pricePrecision || pricePrecision === 0) && !(pricePrecision < 0)) {\n this._precisionOptions.price = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.MA] = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.BOLL] = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.SAR] = pricePrecision\n }\n if ((volumePrecision || volumePrecision === 0) && !(volumePrecision < 0)) {\n this._precisionOptions.volume = volumePrecision\n this._precisionOptions[TechnicalIndicatorType.VOL] = volumePrecision\n }\n }\n\n /**\n * 计算指标\n * @param technicalIndicatorType\n * @returns {boolean}\n */\n calcTechnicalIndicator (technicalIndicatorType) {\n if (technicalIndicatorType === TechnicalIndicatorType.NO) {\n return true\n }\n const calcFun = calcIndicator[technicalIndicatorType]\n if (calcFun) {\n this._dataList = calcFun(this._dataList, this._technicalIndicatorParamOptions[technicalIndicatorType])\n return true\n }\n return false\n }\n\n /**\n * 获取数据源\n * @returns {[]|*[]}\n */\n dataList () {\n return this._dataList\n }\n\n /**\n * 清空数据源\n */\n clearDataList () {\n this._more = true\n this._loading = true\n this._dataList = []\n this._from = 0\n this._to = 0\n }\n\n /**\n * 添加数据\n * @param data\n * @param pos\n * @param more\n */\n addData (data, pos, more) {\n if (isObject(data)) {\n if (isArray(data)) {\n if (this._dataList.length === 0) {\n this._loading = false\n this._more = isBoolean(more) ? more : true\n this._dataList = data.concat(this._dataList)\n const rangeDif = this._calcRangDif()\n this._from = this._dataList.length - rangeDif\n this.adjustFromTo()\n } else {\n this._loading = false\n this._more = more\n this._dataList = data.concat(this._dataList)\n this._from += data.length\n this.adjustFromTo()\n }\n } else {\n if (pos >= this._dataList.length) {\n const oldDataSize = this._dataList.length\n this._dataList.push(data)\n if (this._from !== 0) {\n if (this._to === oldDataSize) {\n this._to += 1\n const rangeDif = this._calcRangDif()\n if (this._to - this._from > rangeDif) {\n this._from += 1\n }\n }\n } else {\n const rangeDif = this._calcRangDif()\n if (this._dataList.length < rangeDif) {\n this._to = this._dataList.length\n } else {\n this._from += 1\n this._to += 1\n }\n }\n } else {\n this._dataList[pos] = data\n }\n }\n }\n }\n\n /**\n * 获取一条数据的空间\n * @returns {number}\n */\n dataSpace () {\n return this._dataSpace\n }\n\n /**\n * 获取绘制一条数据的空间(不包括bar之间的间隙)\n * @returns {*}\n */\n barSpace () {\n return this._barSpace\n }\n\n /**\n * 设置一条数据的空间\n * @param dataSpace\n */\n setDataSpace (dataSpace) {\n if (this._innerSetDataSpace(dataSpace)) {\n this._invalidateHandler()\n }\n }\n\n /**\n * 设置可见区域数据占用的总空间\n * @param totalSpace\n */\n setTotalDataSpace (totalSpace) {\n if (this._totalDataSpace === totalSpace) {\n return\n }\n this._totalDataSpace = totalSpace\n this._calcRange()\n }\n\n /**\n * 设置右边可以偏移的空间\n * @param space\n */\n setOffsetRightSpace (space) {\n if (space < 0) {\n space = 0\n }\n this._offsetRightSpace = space\n }\n\n /**\n * 获取数据绘制起点\n * @returns {number}\n */\n from () {\n return this._from\n }\n\n /**\n * 获取数据绘制终点\n * @returns {number}\n */\n to () {\n return this._to\n }\n\n /**\n * 获取绘制数据个数\n * @returns {number}\n */\n range () {\n return this._range\n }\n\n /**\n * 获取十字光标点\n * @returns {null}\n */\n crossHairPoint () {\n return this._crossHairPoint\n }\n\n /**\n * 获取十字光标点所在的series的标识\n * @returns {null}\n */\n crossHairSeriesTag () {\n return this._crossHairSeriesTag\n }\n\n /**\n * 设置十字光标点所在的series的标识\n * @param tag\n */\n setCrossHairSeriesTag (tag) {\n this._crossHairSeriesTag = tag\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n }\n\n /**\n * 设置十字光标点\n * @param point\n */\n setCrossHairPoint (point) {\n this._crossHairPoint = point\n }\n\n /**\n * 开始拖拽\n */\n startDrag () {\n this._preFrom = this._from\n }\n\n /**\n * 拖动\n * @param distance\n */\n drag (distance) {\n if (Math.abs(distance) < this._dataSpace / 2) {\n return\n }\n let distanceRange = distance / this._dataSpace\n distanceRange = distanceRange < 0 ? Math.floor(distanceRange) : Math.ceil(distanceRange)\n if (distanceRange === 0) {\n this._loadMoreHandler()\n return\n }\n if (distanceRange > 0) {\n // 右移\n if (this._from === 0) {\n this._loadMoreHandler(formatValue(this._dataList[0], 'timestamp'))\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n return\n }\n } else {\n // 左移\n const rangeDif = this._calcRangDif()\n const dataSize = this._dataList.length\n if (this._from === dataSize - rangeDif) {\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n return\n }\n }\n this._from = this._preFrom - distanceRange\n this.adjustFromTo()\n if (this._from === 0) {\n this._loadMoreHandler()\n }\n this._invalidateHandler()\n }\n\n /**\n * 缩放\n * @param zoomScale\n */\n zoom (zoomScale) {\n const dataSpace = this._dataSpace + zoomScale * (this._dataSpace / 10)\n if (this._innerSetDataSpace(dataSpace)) {\n this._invalidateHandler()\n }\n }\n\n /**\n * 调整from和to\n */\n adjustFromTo () {\n const dataSize = this._dataList.length\n const rangeDif = this._calcRangDif()\n if (this._from > dataSize - rangeDif) {\n this._from = dataSize - rangeDif\n }\n if (this._from < 0) {\n this._from = 0\n }\n this._to = this._from + this._range\n if (this._to > dataSize) {\n this._to = dataSize\n }\n }\n\n /**\n * 获取图形标记类型\n * @returns {string}\n */\n graphicMarkType () {\n return this._graphicMarkType\n }\n\n /**\n * 设置图形标记类型\n * @param graphicMarkType\n */\n setGraphicMarkType (graphicMarkType) {\n this._graphicMarkType = graphicMarkType\n }\n\n /**\n * 获取图形标记拖拽标记\n * @returns {boolean}\n */\n dragGraphicMarkFlag () {\n return this._dragGraphicMarkFlag\n }\n\n /**\n * 设置图形标记拖拽标记\n * @param flag\n */\n setDragGraphicMarkFlag (flag) {\n this._dragGraphicMarkFlag = flag\n }\n\n /**\n * 获取图形标记开始的点\n * @returns {null}\n */\n graphicMarkPoint () {\n return this._graphicMarkPoint\n }\n\n /**\n * 设置图形标记开始的点\n * @param point\n */\n setGraphicMarkPoint (point) {\n this._graphicMarkPoint = point\n }\n\n /**\n * 获取图形标记的数据\n * @returns {{straightLine: [], verticalRayLine: [], rayLine: [], segmentLine: [], horizontalRayLine: [], horizontalSegmentLine: [], fibonacciLine: [], verticalStraightLine: [], priceChannelLine: [], priceLine: [], verticalSegmentLine: [], horizontalStraightLine: [], parallelStraightLine: []}}\n */\n graphicMarkData () {\n return this._graphicMarkDatas\n }\n\n /**\n * 设置图形标记的数据\n * @param datas\n */\n setGraphicMarkData (datas) {\n this._graphicMarkDatas = datas\n this._invalidateHandler(InvalidateLevel.GRAPHIC_MARK)\n }\n\n /**\n * 设置加载更多\n * @param callback\n */\n loadMore (callback) {\n this._loadMoreCallback = callback\n }\n}\n","/**\n * 获取屏幕比\n * @param ctx\n * @returns {number}\n */\nexport function getPixelRatio (ctx) {\n const backingStore = ctx.backingStorePixelRatio ||\n ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1\n return (window.devicePixelRatio || 1) / backingStore\n}\n\n/**\n * 测量文字的宽度\n * @param ctx\n * @param text\n * @returns {number}\n */\nexport function calcTextWidth (ctx, text) {\n return ctx.measureText(text).width\n}\n\n/**\n * 获取字体\n * @param fontSize\n * @returns {string}\n */\nexport function getFont (fontSize) {\n return `${fontSize}px Arial`\n}\n\n/**\n * 绘制水平直线\n * @param ctx\n * @param y\n * @param left\n * @param right\n */\nexport function drawHorizontalLine (ctx, y, left, right) {\n ctx.beginPath()\n const correction = (ctx.lineWidth % 2) ? 0.5 : 0\n ctx.moveTo(left, y + correction)\n ctx.lineTo(right, y + correction)\n ctx.stroke()\n ctx.closePath()\n}\n\n/**\n * 绘制垂直直线\n * @param ctx\n * @param x\n * @param top\n * @param bottom\n */\nexport function drawVerticalLine (ctx, x, top, bottom) {\n ctx.beginPath()\n const correction = (ctx.lineWidth % 2) ? 0.5 : 0\n ctx.moveTo(x + correction, top)\n ctx.lineTo(x + correction, bottom)\n ctx.stroke()\n ctx.closePath()\n}\n\n/**\n * 绘制线\n * @param ctx\n * @param drawFuc\n */\nexport function strokeInPixel (ctx, drawFuc) {\n ctx.save()\n if (ctx.lineWidth % 2) {\n ctx.translate(0.5, 0.5)\n }\n drawFuc()\n ctx.restore()\n}\n","import { InvalidateLevel } from '../data/ChartData'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class Series {\n constructor (props) {\n this._container = props.container\n this._chartData = props.chartData\n this._width = -1\n this._height = -1\n this._initBefore(props)\n this._initElement()\n this._mainWidget = this._createMainWidget(this._mainWidgetCell, props)\n this._yAxisWidget = this._createYAxisWidget(this._yAxisWidgetCell, props)\n }\n\n _initBefore (props) {}\n\n _initElement () {\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.position = 'relative'\n this._element.style.overflow = 'hidden'\n this._element.style.width = '100%'\n this._mainWidgetCell = this._createCell()\n this._yAxisWidgetCell = this._createCell()\n this._element.appendChild(this._mainWidgetCell)\n this._element.appendChild(this._yAxisWidgetCell)\n const lastElement = this._container.lastChild\n if (lastElement) {\n this._container.insertBefore(this._element, lastElement)\n } else {\n this._container.appendChild(this._element)\n }\n }\n\n _createCell () {\n const cell = document.createElement('div')\n cell.style.display = 'table-cell'\n cell.style.position = 'absolute'\n cell.style.margin = '0'\n cell.style.padding = '0'\n cell.style.top = '0'\n cell.style.zIndex = '1'\n return cell\n }\n\n /**\n * 创建主组件\n * @param container\n * @param props\n * @private\n */\n _createMainWidget (container, props) {}\n\n /**\n * 创建y轴组件\n * @param container\n * @param props\n * @private\n */\n _createYAxisWidget (container, props) {}\n\n /**\n * 设置cell的尺寸\n * @param cell\n * @param size\n * @private\n */\n _setCellSize (cell, size) {\n cell.style.left = `${size.left}px`\n cell.style.width = `${size.width}px`\n cell.style.height = `${size.height}px`\n }\n\n /**\n * 计算轴\n * @private\n */\n _computeAxis () {}\n\n /**\n * 获取宽度\n * @returns {number}\n */\n width () {\n return this._element.offsetWidth\n }\n\n /**\n * 获取高度\n */\n height () {\n return this._height\n }\n\n /**\n * 设置临时高度\n * @param height\n */\n setTempHeight (height) {\n this._height = height\n }\n\n /**\n * 设置尺寸\n * @param mainWidgetSize\n * @param yAxisWidgetSize\n */\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._height = mainWidgetSize.height\n this._element.style.height = `${mainWidgetSize.height}px`\n this._setCellSize(this._mainWidgetCell, mainWidgetSize)\n this._setCellSize(this._yAxisWidgetCell, yAxisWidgetSize)\n this._mainWidget.setSize(mainWidgetSize.width, this._height)\n if (this._yAxisWidget) {\n this._yAxisWidget.setSize(yAxisWidgetSize.width, yAxisWidgetSize.height)\n }\n }\n\n /**\n * 刷新\n * @param level\n */\n invalidate (level) {\n if (level === InvalidateLevel.FULL) {\n this._computeAxis()\n }\n if (level !== InvalidateLevel.GRAPHIC_MARK) {\n if (this._yAxisWidget) {\n this._yAxisWidget.invalidate(level)\n }\n }\n this._mainWidget.invalidate(level)\n }\n\n getImage (includeFloatLayer, includeGraphicMark) {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._element.offsetWidth\n const height = this._element.offsetHeight\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n\n const mainWidgetWidth = this._mainWidgetCell.offsetWidth\n const mainWidgetHeight = this._mainWidgetCell.offsetHeight\n const mainWidgetOffsetLeft = parseInt(this._mainWidgetCell.style.left)\n\n const yAxisWidgetWidth = this._yAxisWidgetCell.offsetWidth\n const yAxisWidgetHeight = this._yAxisWidgetCell.offsetHeight\n const yAxisWidgetOffsetLeft = parseInt(this._yAxisWidgetCell.style.left)\n\n ctx.drawImage(\n this._mainWidget.getImage(includeFloatLayer, includeGraphicMark),\n mainWidgetOffsetLeft, 0,\n mainWidgetWidth, mainWidgetHeight\n )\n if (this._yAxisWidget) {\n ctx.drawImage(\n this._yAxisWidget.getImage(includeFloatLayer),\n yAxisWidgetOffsetLeft, 0,\n yAxisWidgetWidth, yAxisWidgetHeight\n )\n }\n return canvas\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._container.removeChild(this._element)\n delete this\n }\n}\n","import { InvalidateLevel } from '../data/ChartData'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class Widget {\n constructor (props) {\n this._width = 0\n this._height = 0\n this._initElement(props.container)\n this._mainView = this._createMainView(this._element, props)\n this._expandView = this._createExpandView(this._element, props)\n this._floatLayerView = this._createFloatLayerView(this._element, props)\n }\n\n /**\n * 初始化element\n * @param container\n * @private\n */\n _initElement (container) {\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.width = '100%'\n this._element.style.height = '100%'\n this._element.style.position = 'relative'\n this._element.style.overflow = 'hidden'\n container.appendChild(this._element)\n }\n\n /**\n * 创建主view\n * @param container\n * @param props\n * @private\n */\n _createMainView (container, props) {}\n\n /**\n * 创建拓展的view\n * @param container\n * @param props\n * @private\n */\n _createExpandView (container, props) {}\n\n /**\n * 创建浮层view\n * @param container\n * @param props\n * @private\n */\n _createFloatLayerView (container, props) {}\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n this._width = width\n this._height = height\n this._mainView.setSize(width, height)\n this._floatLayerView.setSize(width, height)\n }\n\n /**\n * 更新\n * @param level\n */\n invalidate (level) {\n switch (level) {\n case InvalidateLevel.FLOAT_LAYER: {\n this._floatLayerView.flush()\n break\n }\n case InvalidateLevel.FULL: {\n this._mainView.flush()\n this._floatLayerView.flush()\n break\n }\n default: {\n break\n }\n }\n }\n\n /**\n * 将widget转换成图片\n * @param includeFloatLayer\n * @param includeGraphicMark\n * @returns {HTMLCanvasElement}\n */\n getImage (includeFloatLayer, includeGraphicMark) {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n canvas.style.width = `${this._width}px`\n canvas.style.height = `${this._height}px`\n canvas.width = this._width * pixelRatio\n canvas.height = this._height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n\n ctx.drawImage(this._mainView.getImage(), 0, 0, this._width, this._height)\n\n if (includeGraphicMark && this._expandView) {\n ctx.drawImage(this._expandView.getImage(), 0, 0, this._width, this._height)\n }\n if (includeFloatLayer) {\n ctx.drawImage(this._floatLayerView.getImage(), 0, 0, this._width, this._height)\n }\n return canvas\n }\n}\n","/**\n * requestAnimationFrame兼容\n * @param fn\n */\nexport function requestAnimationFrame (fn) {\n if (!window.requestAnimationFrame) {\n return window.setTimeout(() => { fn() }, 1000 / 60)\n }\n return window.requestAnimationFrame(fn)\n}\n\n/**\n * cancelAnimationFrame兼容\n * @param id\n */\nexport function cancelAnimationFrame (id) {\n if (!window.cancelAnimationFrame) {\n clearTimeout(id)\n }\n window.cancelAnimationFrame(id)\n}\n","import { getPixelRatio } from '../utils/canvas'\nimport { cancelAnimationFrame, requestAnimationFrame } from '../utils/compatible'\n\nclass View {\n constructor (container, chartData) {\n this._chartData = chartData\n this._initCanvas(container)\n }\n\n /**\n * 初始化画布\n * @param container\n * @private\n */\n _initCanvas (container) {\n this._canvas = document.createElement('canvas')\n this._canvas.style.position = 'absolute'\n this._canvas.style.right = '0'\n this._canvas.style.left = '0'\n this._canvas.style.zIndex = '2'\n this._ctx = this._canvas.getContext('2d')\n container.appendChild(this._canvas)\n }\n\n /**\n * 重新绘制\n * @param extendFun\n * @private\n */\n _redraw (extendFun) {\n this._ctx.clearRect(0, 0, this._width, this._height)\n if (extendFun) {\n extendFun()\n }\n this._draw()\n }\n\n /**\n * 绘制\n */\n _draw () {\n }\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n this._redraw(() => {\n const pixelRatio = getPixelRatio(this._ctx)\n this._width = width\n this._height = height\n this._canvas.style.top = '0'\n this._canvas.style.width = `${width}px`\n this._canvas.style.height = `${height}px`\n this._canvas.width = width * pixelRatio\n this._canvas.height = height * pixelRatio\n this._ctx.scale(pixelRatio, pixelRatio)\n // this._ctx.translate(0.5, 0.5)\n })\n }\n\n /**\n * 刷新\n */\n flush () {\n if (this.requestAnimationId) {\n cancelAnimationFrame(this.requestAnimationId)\n }\n this.requestAnimationId = requestAnimationFrame(() => {\n this._redraw()\n })\n }\n\n /**\n * 获取图片\n * @returns {HTMLCanvasElement}\n */\n getImage () {\n return this._canvas\n }\n}\n\nexport default View\n","import View from './View'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { LineStyle } from '../data/options/styleOptions'\nimport { drawHorizontalLine, drawVerticalLine, strokeInPixel } from '../utils/canvas'\n\nexport default class TechnicalIndicatorView extends View {\n constructor (container, chartData, xAxis, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawGrid()\n this._drawTechnicalIndicator()\n }\n\n /**\n * 绘制网格\n * @private\n */\n _drawGrid () {\n const grid = this._chartData.styleOptions().grid\n if (!grid.display) {\n return\n }\n const horizontalGrid = grid.horizontal\n if (horizontalGrid.display) {\n this._ctx.strokeStyle = horizontalGrid.color\n this._ctx.lineWidth = horizontalGrid.size\n if (horizontalGrid.style === LineStyle.DASH) {\n this._ctx.setLineDash(horizontalGrid.dashValue)\n }\n this._yAxis.ticks().forEach(tick => {\n drawHorizontalLine(this._ctx, tick.y, 0, this._width)\n })\n }\n\n const verticalGrid = grid.vertical\n if (verticalGrid.display) {\n this._ctx.strokeStyle = verticalGrid.color\n this._ctx.lineWidth = verticalGrid.size\n if (verticalGrid.style === LineStyle.DASH) {\n this._ctx.setLineDash(verticalGrid.dashValue)\n } else {\n this._ctx.setLineDash([])\n }\n this._xAxis.ticks().forEach(tick => {\n drawVerticalLine(this._ctx, tick.x, 0, this._height)\n })\n }\n\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制指标\n * @private\n */\n _drawTechnicalIndicator () {\n let onDrawing\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n const technicalIndicatorParams = this._chartData.technicalIndicatorParamOptions()[technicalIndicatorType] || []\n const linePoints = []\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n switch (technicalIndicatorType) {\n case TechnicalIndicatorType.MA: {\n const dataKeys = []\n technicalIndicatorParams.forEach(p => {\n dataKeys.push(`ma${p}`)\n })\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, dataKeys,\n this._yAxis.isCandleStickYAxis(), (values) => {\n this._prepareLinePoints(x, values, linePoints)\n }\n )\n }\n break\n }\n\n case TechnicalIndicatorType.MACD: {\n const dataList = this._chartData.dataList()\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n const macd = kLineData.macd || {}\n this._prepareLinePoints(x, [macd.diff, macd.dea], linePoints)\n const preKLineData = dataList[i - 1] || {}\n const macdValue = macd.macd\n const preMacdValue = (preKLineData.macd || {}).macd || -Infinity\n if (macdValue > 0) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.upColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.upColor\n } else if (macdValue < 0) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.downColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.downColor\n } else {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.noChangeColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.noChangeColor\n }\n const isFill = !((preMacdValue || preMacdValue === 0) && macdValue > preMacdValue)\n this._drawBars(x, halfBarSpace, macdValue, isFill)\n }\n break\n }\n\n case TechnicalIndicatorType.VOL: {\n const dataList = this._chartData.dataList()\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n const vol = kLineData.vol || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(vol[`ma${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n const preKLineData = dataList[i - 1] || {}\n const close = kLineData.close\n const preClose = (preKLineData || {}).close || close\n if (close > preClose) {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.upColor\n } else if (close < preClose) {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.downColor\n } else {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.noChangeColor\n }\n this._drawBars(x, halfBarSpace, vol.num, true)\n }\n break\n }\n\n case TechnicalIndicatorType.BOLL: {\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, ['up', 'mid', 'dn'],\n this._yAxis.isCandleStickYAxis(), (values) => {\n this._prepareLinePoints(x, values, linePoints)\n }\n )\n }\n break\n }\n\n case TechnicalIndicatorType.BIAS: {\n onDrawing = (x, i, kLineData) => {\n const bias = kLineData.bias || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(bias[`bias${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.BRAR: {\n onDrawing = (x, i, kLineData) => {\n const brar = kLineData.brar || {}\n this._prepareLinePoints(x, [brar.br, brar.ar], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.CCI: {\n onDrawing = (x, i, kLineData) => {\n const cci = kLineData.cci || {}\n this._prepareLinePoints(x, [cci.cci], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.CR: {\n onDrawing = (x, i, kLineData) => {\n const cr = kLineData.cr || {}\n this._prepareLinePoints(x, [cr.cr, cr.ma1, cr.ma2, cr.ma3, cr.ma4], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.DMA: {\n onDrawing = (x, i, kLineData) => {\n const dma = kLineData.dma || {}\n this._prepareLinePoints(x, [dma.dif, dma.difMa], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.DMI: {\n onDrawing = (x, i, kLineData) => {\n const dmi = kLineData.dmi || {}\n this._prepareLinePoints(x, [dmi.mdi, dmi.pdi, dmi.adx, dmi.adxr], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.KDJ: {\n onDrawing = (x, i, kLineData) => {\n const kdj = kLineData.kdj || {}\n this._prepareLinePoints(x, [kdj.k, kdj.d, kdj.j], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.RSI: {\n onDrawing = (x, i, kLineData) => {\n const rsi = kLineData.rsi || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(rsi[`rsi${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.PSY: {\n onDrawing = (x, i, kLineData) => {\n const psy = kLineData.psy || {}\n this._prepareLinePoints(x, [psy.psy], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.TRIX: {\n onDrawing = (x, i, kLineData) => {\n const trix = kLineData.trix || {}\n this._prepareLinePoints(x, [trix.trix, trix.maTrix], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.OBV: {\n onDrawing = (x, i, kLineData) => {\n const obv = kLineData.obv || {}\n this._prepareLinePoints(x, [obv.obv, obv.maObv], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.VR: {\n onDrawing = (x, i, kLineData) => {\n const vr = kLineData.vr || {}\n this._prepareLinePoints(x, [vr.vr, vr.maVr], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.WR: {\n onDrawing = (x, i, kLineData) => {\n const wr = kLineData.wr || {}\n this._prepareLinePoints(x, [wr.wr1, wr.wr2, wr.wr3], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.MTM: {\n onDrawing = (x, i, kLineData) => {\n const mtm = kLineData.mtm || {}\n this._prepareLinePoints(x, [mtm.mtm, mtm.mtmMa], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.EMV: {\n onDrawing = (x, i, kLineData) => {\n const emv = kLineData.emv || {}\n this._prepareLinePoints(x, [emv.emv, emv.maEmv], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.SAR: {\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, ['sar'],\n this._yAxis.isCandleStickYAxis(), (values) => {\n const sar = values[0]\n if (sar || sar === 0) {\n const dataY = this._yAxis.convertToPixel(sar)\n if (sar < (kLineData.high + kLineData.low) / 2) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.upColor\n } else {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.downColor\n }\n this._ctx.beginPath()\n this._ctx.arc(x, dataY, halfBarSpace, Math.PI * 2, 0, true)\n this._ctx.stroke()\n this._ctx.closePath()\n }\n }\n )\n }\n }\n }\n this._drawGraphics(onDrawing,\n () => {\n this._drawLines(linePoints, technicalIndicatorOptions)\n }\n )\n }\n\n /**\n * 需要绘制ohlc指标每条数据渲染\n * @param i\n * @param x\n * @param halfBarSpace\n * @param technicalIndicatorOptions\n * @param kLineData\n * @param technicalIndicatorType\n * @param dataKeys\n * @param isCandleStick\n * @param prepare\n */\n _ohlcTechnicalIndicatorDrawing (\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType,\n dataKeys, isCandleStick, prepare\n ) {\n const technicalIndicatorData = kLineData[technicalIndicatorType.toLowerCase()] || {}\n const values = []\n dataKeys.forEach(key => {\n values.push(technicalIndicatorData[key])\n })\n if (prepare) {\n prepare(values)\n }\n const dataList = this._chartData.dataList()\n if (!isCandleStick) {\n const preKLineData = dataList[i - 1] || {}\n this._drawOhlc(\n halfBarSpace, x, kLineData,\n preKLineData, technicalIndicatorOptions.bar.upColor,\n technicalIndicatorOptions.bar.downColor, technicalIndicatorOptions.bar.noChangeColor\n )\n }\n }\n\n /**\n * 准备绘制线的数据\n * @param x\n * @param lineValues\n * @param linePoints\n */\n _prepareLinePoints (x, lineValues, linePoints) {\n for (let i = 0; i < lineValues.length; i++) {\n const value = lineValues[i]\n const valueY = this._yAxis.convertToPixel(value)\n if (!linePoints[i]) {\n linePoints[i] = [{ x: x, y: valueY }]\n } else {\n linePoints[i].push({ x: x, y: valueY })\n }\n }\n }\n\n /**\n * 绘制线\n * @param linePoints\n * @param technicalIndicatorOptions\n */\n _drawLines (linePoints, technicalIndicatorOptions) {\n const colors = technicalIndicatorOptions.line.colors\n const pointCount = linePoints.length\n const colorSize = (colors || []).length\n this._ctx.lineWidth = technicalIndicatorOptions.line.size\n strokeInPixel(this._ctx, () => {\n for (let i = 0; i < pointCount; i++) {\n const points = linePoints[i]\n if (points.length > 0) {\n this._ctx.strokeStyle = colors[i % colorSize]\n this._ctx.beginPath()\n this._ctx.moveTo(points[0].x, points[0].y)\n for (let j = 1; j < points.length; j++) {\n this._ctx.lineTo(points[j].x, points[j].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n }\n }\n })\n }\n\n /**\n * 绘制柱状图\n * @param x\n * @param halfBarSpace\n * @param barData\n * @param isFill\n */\n _drawBars (x, halfBarSpace, barData, isFill) {\n if (barData || barData === 0) {\n this._ctx.lineWidth = 1\n const dataY = this._yAxis.convertToPixel(barData)\n const zeroY = this._yAxis.convertToPixel(0)\n let y = dataY\n if (barData < 0) {\n y = zeroY\n }\n const yDif = zeroY - dataY\n let barHeight = Math.abs(yDif)\n if (barHeight < 1) {\n barHeight = 1\n y = barData < 0 ? y + 1 : y - 1\n }\n if (isFill) {\n this._ctx.fillRect(x - halfBarSpace, y, halfBarSpace * 2, barHeight)\n } else {\n this._ctx.strokeRect(x - halfBarSpace, y, halfBarSpace * 2, barHeight)\n }\n }\n }\n\n /**\n * 绘制ohlc\n * @param halfBarSpace\n * @param x\n * @param kLineData\n * @param preKLineData\n * @param upColor\n * @param downColor\n * @param noChangeColor\n * @private\n */\n _drawOhlc (halfBarSpace, x, kLineData, preKLineData, upColor, downColor, noChangeColor) {\n const close = kLineData.close\n const openY = this._yAxis.convertToPixel(kLineData.open)\n const closeY = this._yAxis.convertToPixel(close)\n const highY = this._yAxis.convertToPixel(kLineData.high)\n const lowY = this._yAxis.convertToPixel(kLineData.low)\n const preClose = (preKLineData || {}).close || close\n if (close > preClose) {\n this._ctx.strokeStyle = upColor\n } else if (close < preClose) {\n this._ctx.strokeStyle = downColor\n } else {\n this._ctx.strokeStyle = noChangeColor\n }\n this._ctx.lineWidth = 1\n this._ctx.beginPath()\n this._ctx.moveTo(x, highY)\n this._ctx.lineTo(x, lowY)\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x - halfBarSpace, openY)\n this._ctx.lineTo(x, openY)\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x, closeY)\n this._ctx.lineTo(x + halfBarSpace, closeY)\n this._ctx.stroke()\n this._ctx.closePath()\n }\n\n /**\n * 绘制图形\n * @param onDrawing\n * @param onDrawEnd\n * @private\n */\n _drawGraphics (onDrawing, onDrawEnd) {\n let startX = 0\n const dataList = this._chartData.dataList()\n const barSpace = this._chartData.barSpace()\n const dataSpace = this._chartData.dataSpace()\n const halfBarSpace = barSpace / 2\n const to = this._chartData.to()\n for (let i = this._chartData.from(); i < to; i++) {\n const endX = startX + barSpace\n const x = (startX + endX) / 2\n const kLineData = dataList[i]\n if (onDrawing) {\n onDrawing(x, i, kLineData, halfBarSpace, barSpace)\n }\n startX += dataSpace\n }\n if (onDrawEnd) {\n onDrawEnd()\n }\n }\n}\n","import View from './View'\nimport { FloatLayerPromptDisplayRule, LineStyle } from '../data/options/styleOptions'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { isArray } from '../utils/typeChecks'\nimport { formatPrecision, formatValue } from '../utils/format'\nimport { calcTextWidth, drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\n\nexport default class TechnicalIndicatorFloatLayerView extends View {\n constructor (container, chartData, xAxis, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n const crossHairPoint = this._chartData.crossHairPoint()\n let dataPos\n if (crossHairPoint) {\n dataPos = this._xAxis.convertFromPixel(crossHairPoint.x)\n } else {\n dataPos = this._chartData.dataList().length - 1\n }\n const kLineData = this._chartData.dataList()[dataPos]\n const x = this._xAxis.convertToPixel(dataPos)\n this._drawCrossHairHorizontalLine()\n this._drawCrossHairVerticalLine(kLineData, x)\n const displayRule = this._chartData.styleOptions().floatLayer.prompt.displayRule\n if (displayRule === FloatLayerPromptDisplayRule.ALWAYS ||\n (displayRule === FloatLayerPromptDisplayRule.FOLLOW_CROSS && this._chartData.crossHairSeriesTag())) {\n this._drawPrompt(kLineData, x)\n }\n }\n\n /**\n * 绘制提示\n * @param kLineData\n * @param x\n * @private\n */\n _drawPrompt (kLineData, x) {\n this._drawTechnicalIndicatorPrompt(kLineData, x)\n }\n\n /**\n * 绘制十字光标水平线\n * @private\n */\n _drawCrossHairHorizontalLine () {\n if (this._chartData.crossHairSeriesTag() !== this._additionalDataProvider.tag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairHorizontal = crossHair.horizontal\n const crossHairHorizontalLine = crossHairHorizontal.line\n if (!crossHair.display || !crossHairHorizontal.display || !crossHairHorizontalLine.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n if (!crossHairPoint) {\n return\n }\n // 绘制十字光标水平线\n this._ctx.lineWidth = crossHairHorizontalLine.size\n this._ctx.strokeStyle = crossHairHorizontalLine.color\n if (crossHairHorizontalLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(crossHairHorizontalLine.dashValue)\n }\n drawHorizontalLine(this._ctx, crossHairPoint.y, 0, this._width)\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制十字光标垂直线\n * @param kLineData\n * @param x\n * @private\n */\n _drawCrossHairVerticalLine (kLineData, x) {\n if (!this._chartData.crossHairSeriesTag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairVertical = crossHair.vertical\n const crossHairVerticalLine = crossHairVertical.line\n if (!crossHair.display || !crossHairVertical.display || !crossHairVerticalLine.display) {\n return\n }\n if (!kLineData) {\n return\n }\n this._ctx.lineWidth = crossHairVerticalLine.size\n this._ctx.strokeStyle = crossHairVerticalLine.color\n\n if (crossHairVerticalLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(crossHairVerticalLine.dashValue)\n }\n drawVerticalLine(this._ctx, x, 0, this._height)\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制指标提示\n * @param kLineData\n * @param x\n * @param offsetTop\n * @private\n */\n _drawTechnicalIndicatorPrompt (kLineData, x, offsetTop = 0) {\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n const data = this._getTechnicalIndicatorPromptData(kLineData)\n const colors = technicalIndicatorOptions.line.colors\n this._drawTechnicalIndicatorPromptText(\n data, colors, offsetTop\n )\n this._drawTechnicalIndicatorPromptPoint(\n data.values, colors, x\n )\n }\n\n /**\n * 绘制指标提示文字\n * @param data\n * @param colors\n * @param offsetTop\n * @private\n */\n _drawTechnicalIndicatorPromptText (data, colors, offsetTop) {\n const floatLayerPromptTechnicalIndicatorText = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.text\n const nameText = data.name\n const labels = data.labels\n const values = data.values\n const textMarginLeft = floatLayerPromptTechnicalIndicatorText.marginLeft\n const textMarginRight = floatLayerPromptTechnicalIndicatorText.marginRight\n let labelX = textMarginLeft\n const labelY = floatLayerPromptTechnicalIndicatorText.marginTop + offsetTop\n const textSize = floatLayerPromptTechnicalIndicatorText.size\n const textColor = floatLayerPromptTechnicalIndicatorText.color\n const colorSize = colors.length\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(textSize)\n const nameTextWidth = calcTextWidth(this._ctx, nameText)\n this._ctx.fillStyle = textColor\n this._ctx.fillText(nameText, labelX, labelY)\n labelX += (textMarginLeft + nameTextWidth)\n for (let i = 0; i < labels.length; i++) {\n const text = `${labels[i].toUpperCase()}: ${values[i] || '--'}`\n const textWidth = calcTextWidth(this._ctx, text)\n this._ctx.fillStyle = colors[i % colorSize] || textColor\n this._ctx.fillText(text, labelX, labelY)\n labelX += (textMarginLeft + textMarginRight + textWidth)\n }\n }\n\n /**\n * 绘制指标提示点\n * @param values\n * @param colors\n * @param x\n * @private\n */\n _drawTechnicalIndicatorPromptPoint (values, colors, x) {\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n if (!this._chartData.crossHairSeriesTag() ||\n technicalIndicatorType === TechnicalIndicatorType.SAR) {\n return\n }\n const colorSize = colors.length\n const valueSize = technicalIndicatorType === TechnicalIndicatorType.MACD || technicalIndicatorType === TechnicalIndicatorType.VOL ? values.length - 1 : values.length\n\n for (let i = 0; i < valueSize; i++) {\n const value = values[i]\n if (value || value === 0) {\n const y = this._yAxis.convertToPixel(value)\n this._ctx.fillStyle = colors[i % colorSize]\n this._ctx.beginPath()\n this._ctx.arc(x, y, 3, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.fill()\n }\n }\n }\n\n /**\n * 获取需要绘制的指标提示数据\n * @param kLineData\n * @returns {{values: Array, labels: Array}}\n */\n _getTechnicalIndicatorPromptData (kLineData) {\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n const params = this._chartData.technicalIndicatorParamOptions()[technicalIndicatorType] || []\n const values = []\n let labels = []\n switch (technicalIndicatorType) {\n case TechnicalIndicatorType.MA: {\n params.forEach(p => {\n labels.push(`ma${p}`)\n })\n break\n }\n case TechnicalIndicatorType.VOL: {\n params.forEach(p => {\n labels.push(`ma${p}`)\n })\n labels.push('num')\n break\n }\n case TechnicalIndicatorType.MACD: {\n labels = ['diff', 'dea', 'macd']\n break\n }\n case TechnicalIndicatorType.BOLL: {\n labels = ['up', 'mid', 'dn']\n break\n }\n case TechnicalIndicatorType.BIAS: {\n params.forEach(p => {\n labels.push(`bias${p}`)\n })\n break\n }\n case TechnicalIndicatorType.BRAR: {\n labels = ['br', 'ar']\n break\n }\n case TechnicalIndicatorType.CCI: {\n labels = ['cci']\n break\n }\n case TechnicalIndicatorType.CR: {\n labels = ['cr', 'ma1', 'ma2', 'ma3', 'ma4']\n break\n }\n case TechnicalIndicatorType.DMA: {\n labels = ['dif', 'difMa']\n break\n }\n case TechnicalIndicatorType.DMI: {\n labels = ['mdi', 'pdi', 'adx', 'adxr']\n break\n }\n case TechnicalIndicatorType.KDJ: {\n labels = ['k', 'd', 'j']\n break\n }\n\n case TechnicalIndicatorType.RSI: {\n params.forEach(p => {\n labels.push(`rsi${p}`)\n })\n break\n }\n case TechnicalIndicatorType.PSY: {\n labels = ['psy']\n break\n }\n case TechnicalIndicatorType.TRIX: {\n labels = ['trix', 'maTrix']\n break\n }\n case TechnicalIndicatorType.OBV: {\n labels = ['obv', 'maObv']\n break\n }\n case TechnicalIndicatorType.VR: {\n labels = ['vr', 'maVr']\n break\n }\n case TechnicalIndicatorType.WR: {\n labels = ['wr1', 'wr2', 'wr3']\n break\n }\n case TechnicalIndicatorType.MTM: {\n labels = ['mtm', 'mtmMa']\n break\n }\n\n case TechnicalIndicatorType.EMV: {\n labels = ['emv', 'maEmv']\n break\n }\n\n case TechnicalIndicatorType.SAR: {\n labels = ['sar']\n break\n }\n }\n let name = ''\n if (labels.length > 0) {\n name = `${technicalIndicatorType}`\n if (params && isArray(params) && params.length > 0) {\n name = `${name}(${params.join(',')})`\n }\n const indicatorData = formatValue(kLineData, technicalIndicatorType.toLowerCase())\n labels.forEach(label => {\n values.push(formatValue(indicatorData, label))\n })\n const decimal = this._chartData.precisionOptions()[technicalIndicatorType]\n values.forEach((value, index) => {\n values[index] = formatPrecision(value, decimal)\n })\n }\n return { labels, values, name }\n }\n}\n","import Widget from './Widget'\nimport TechnicalIndicatorView from '../view/TechnicalIndicatorView'\nimport TechnicalIndicatorFloatLayerView from '../view/TechnicalIndicatorFloatLayerView'\n\nexport default class TechnicalIndicatorWidget extends Widget {\n _createMainView (container, props) {\n return new TechnicalIndicatorView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n _createFloatLayerView (container, props) {\n return new TechnicalIndicatorFloatLayerView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n}\n","import View from './View'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\nimport { calcTextWidth, drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\nimport { formatBigNumber, formatPrecision } from '../utils/format'\n\nexport default class YAxisView extends View {\n constructor (container, chartData, yAxis) {\n super(container, chartData)\n this._yAxis = yAxis\n }\n\n _draw () {\n const yAxisOptions = this._chartData.styleOptions().yAxis\n if (yAxisOptions.display) {\n this._drawAxisLine(yAxisOptions)\n this._drawTickLines(yAxisOptions)\n this._drawTickLabels(yAxisOptions)\n this._drawLastPriceLabel(yAxisOptions)\n }\n }\n\n _drawAxisLine (yAxisOptions) {\n const axisLine = yAxisOptions.axisLine\n if (!axisLine.display) {\n return\n }\n this._ctx.strokeStyle = axisLine.color\n this._ctx.lineWidth = axisLine.size\n let x\n if (this._isDrawFromStart(yAxisOptions)) {\n x = 0\n } else {\n x = this._width\n }\n drawVerticalLine(this._ctx, x, 0, this._height)\n }\n\n _drawTickLines (yAxisOptions) {\n const tickLine = yAxisOptions.tickLine\n if (!tickLine.display) {\n return\n }\n this._ctx.lineWidth = tickLine.size\n this._ctx.strokeStyle = tickLine.color\n\n const tickLineLength = tickLine.length\n\n let startX\n let endX\n if (this._isDrawFromStart(yAxisOptions)) {\n startX = 0\n if (yAxisOptions.axisLine.display) {\n startX += yAxisOptions.axisLine.size\n }\n endX = startX + tickLineLength\n } else {\n startX = this._width\n if (yAxisOptions.axisLine.display) {\n startX -= yAxisOptions.axisLine.size\n }\n endX = startX - tickLineLength\n }\n this._yAxis.ticks().forEach(tick => {\n drawHorizontalLine(this._ctx, tick.y, startX, endX)\n })\n }\n\n _drawTickLabels (yAxisOptions) {\n const tickText = yAxisOptions.tickText\n if (!tickText.display) {\n return\n }\n const tickLine = yAxisOptions.tickLine\n const tickLineDisplay = tickLine.display\n const tickLineLength = tickLine.length\n const tickTextMargin = tickText.margin\n let labelX\n if (this._isDrawFromStart(yAxisOptions)) {\n labelX = tickTextMargin\n if (yAxisOptions.axisLine.display) {\n labelX += yAxisOptions.axisLine.size\n }\n if (tickLineDisplay) {\n labelX += tickLineLength\n }\n this._ctx.textAlign = 'left'\n } else {\n labelX = this._width - tickTextMargin\n if (yAxisOptions.axisLine.display) {\n labelX -= yAxisOptions.axisLine.size\n }\n if (tickLineDisplay) {\n labelX -= tickLineLength\n }\n this._ctx.textAlign = 'right'\n }\n const textSize = tickText.size\n this._ctx.textBaseline = 'middle'\n this._ctx.font = getFont(textSize)\n this._ctx.fillStyle = tickText.color\n this._yAxis.ticks().forEach(tick => {\n const text = formatBigNumber(tick.v)\n this._ctx.fillText(text, labelX, tick.y)\n })\n this._ctx.textAlign = 'left'\n }\n\n /**\n * 绘制最新价文字\n * @private\n */\n _drawLastPriceLabel (yAxisOptions) {\n if (!this._yAxis.isCandleStickYAxis()) {\n return\n }\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lastPriceMark = priceMark.last\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n if (!priceMark.display || !lastPriceMark.display || !lastPriceMark.text.display || dataSize === 0) {\n return\n }\n const lastPrice = dataList[dataSize - 1].close\n const preKLineData = dataList[dataSize - 2] || {}\n const preLastPrice = preKLineData.close || lastPrice\n let priceY = this._yAxis.convertToPixel(lastPrice)\n priceY = +(Math.max(this._height * 0.05, Math.min(priceY, this._height * 0.98))).toFixed(0)\n let color\n if (lastPrice > preLastPrice) {\n color = lastPriceMark.upColor\n } else if (lastPrice < preLastPrice) {\n color = lastPriceMark.downColor\n } else {\n color = lastPriceMark.noChangeColor\n }\n const priceMarkText = lastPriceMark.text\n const text = formatPrecision(lastPrice, this._chartData.precisionOptions().price)\n const textSize = lastPriceMark.text.size\n this._ctx.font = getFont(textSize)\n const rectWidth = calcTextWidth(this._ctx, text) + priceMarkText.paddingLeft + priceMarkText.paddingRight\n const rectHeight = priceMarkText.paddingTop + textSize + priceMarkText.paddingBottom\n let rectStartX\n if (this._isDrawFromStart(yAxisOptions)) {\n rectStartX = 0\n } else {\n rectStartX = this._width - rectWidth\n }\n this._ctx.fillStyle = color\n this._ctx.fillRect(rectStartX, priceY - priceMarkText.paddingTop - textSize / 2, rectWidth, rectHeight)\n this._ctx.fillStyle = priceMarkText.color\n this._ctx.textBaseline = 'middle'\n this._ctx.fillText(text, rectStartX + priceMarkText.paddingLeft, priceY)\n }\n\n /**\n * 判断是否从开始点绘制\n * @private\n */\n _isDrawFromStart (yAxisOptions) {\n return ((yAxisOptions.position === YAxisPosition.LEFT && yAxisOptions.tickText.position === YAxisTextPosition.INSIDE) ||\n (yAxisOptions.position === YAxisPosition.RIGHT && yAxisOptions.tickText.position === YAxisTextPosition.OUTSIDE))\n }\n}\n","import View from './View'\n\nexport default class AxisFloatLayerView extends View {\n constructor (container, chartData, axis, additionalDataProvider) {\n super(container, chartData)\n this._axis = axis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\n /**\n * 绘制十字光标文字\n * @private\n */\n _drawCrossHairLabel () {\n }\n}\n","import AxisFloatLayerView from './AxisFloatLayerView'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\n\nexport default class YAxisFloatLayerView extends AxisFloatLayerView {\n _drawCrossHairLabel () {\n if (this._chartData.crossHairSeriesTag() !== this._additionalDataProvider.tag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairHorizontal = crossHair.horizontal\n const crossHairHorizontalText = crossHairHorizontal.text\n if (!crossHair.display || !crossHairHorizontal.display || !crossHairHorizontalText.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n if (!crossHairPoint) {\n return\n }\n const value = this._axis.convertFromPixel(crossHairPoint.y)\n const precision = this._chartData.precisionOptions()[this._axis.isCandleStickYAxis() ? 'price' : this._additionalDataProvider.technicalIndicatorType()]\n const yAxisDataLabel = formatPrecision(value, precision)\n const textSize = crossHairHorizontalText.size\n this._ctx.font = getFont(textSize)\n const yAxisDataLabelWidth = calcTextWidth(this._ctx, yAxisDataLabel)\n let rectStartX\n\n const paddingLeft = crossHairHorizontalText.paddingLeft\n const paddingRight = crossHairHorizontalText.paddingRight\n const paddingTop = crossHairHorizontalText.paddingTop\n const paddingBottom = crossHairHorizontalText.paddingBottom\n const borderSize = crossHairHorizontalText.borderSize\n\n const rectWidth = yAxisDataLabelWidth + borderSize * 2 + paddingLeft + paddingRight\n const rectHeight = textSize + borderSize * 2 + paddingTop + paddingBottom\n const yAxis = this._chartData.styleOptions().yAxis\n if (\n (yAxis.position === YAxisPosition.LEFT && yAxis.tickText.position === YAxisTextPosition.INSIDE) ||\n (yAxis.position === YAxisPosition.RIGHT && yAxis.tickText.position === YAxisTextPosition.OUTSIDE)\n ) {\n rectStartX = 0\n } else {\n rectStartX = this._width - rectWidth\n }\n\n const rectY = crossHairPoint.y - borderSize - paddingTop - textSize / 2\n // 绘制y轴文字外的边框\n this._ctx.fillStyle = crossHairHorizontalText.backgroundColor\n this._ctx.fillRect(rectStartX, rectY, rectWidth, rectHeight)\n\n this._ctx.lineWidth = borderSize\n this._ctx.strokeStyle = crossHairHorizontalText.borderColor\n this._ctx.strokeRect(rectStartX, rectY, rectWidth, rectHeight)\n\n this._ctx.textBaseline = 'middle'\n this._ctx.fillStyle = crossHairHorizontalText.color\n this._ctx.fillText(yAxisDataLabel, rectStartX + borderSize + paddingLeft, crossHairPoint.y)\n }\n}\n","import Widget from './Widget'\nimport YAxisView from '../view/YAxisView'\nimport YAxisFloatLayerView from '../view/YAxisFloatLayerView'\n\nexport default class YAxisWidget extends Widget {\n _createMainView (container, props) {\n return new YAxisView(container, props.chartData, props.yAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new YAxisFloatLayerView(container, props.chartData, props.yAxis, props.additionalDataProvider)\n }\n}\n","export default class Axis {\n constructor (chartData) {\n this._chartData = chartData\n this._width = 0\n this._height = 0\n this._minValue = 0\n this._maxValue = 0\n this._range = 0\n this._ticks = []\n }\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n this._width = width\n this._height = height\n }\n\n /**\n * 获取ticks\n * @returns {[]|*[]}\n */\n ticks () {\n return this._ticks\n }\n\n /**\n * 计算轴\n */\n computeAxis () {\n const { min, max, range } = this._computeMinMaxValue()\n this._minValue = min\n this._maxValue = max\n this._range = range\n this._ticks = this._computeOptimalTicks(this._computeTicks())\n }\n\n /**\n * 计算最大最小值\n */\n _computeMinMaxValue () {}\n\n /**\n * 计算最佳的tick\n * @param ticks\n */\n _computeOptimalTicks (ticks) {}\n\n /**\n * 计算轴上的tick值\n */\n _computeTicks () {\n const ticks = []\n if (this._range >= 0) {\n const interval = +this._nice(this._range / 8.0)\n const precision = this._getIntervalPrecision(interval)\n const first = +this._round(Math.ceil(this._minValue / interval) * interval, precision)\n const last = +this._round(Math.floor(this._maxValue / interval) * interval, precision)\n let n = 0\n let f = first\n\n if (interval !== 0) {\n while (f <= (+last)) {\n ++n\n f += interval\n }\n }\n f = first\n for (let i = 0; i < n; i++) {\n ticks[i] = { v: f.toFixed(precision) }\n f += interval\n }\n }\n return ticks\n }\n\n _nice (value) {\n const exponent = Math.floor(Math.log(value) / Math.log(10.0))\n const exp10 = Math.pow(10.0, exponent)\n const f = value / exp10 // 1 <= f < 10\n let nf = 0\n if (f < 1) {\n nf = 1\n } else if (f < 2) {\n nf = 2\n } else if (f < 3) {\n nf = 3\n } else if (f < 5) {\n nf = 5\n } else {\n nf = 10\n }\n value = nf * exp10\n return exponent >= -20 ? +value.toFixed(exponent < 0 ? -exponent : 0) : value\n }\n\n _getIntervalPrecision (value) {\n const str = value.toString()\n\n // Consider scientific notation: '3.4e-12' '3.4e+12'\n const eIndex = str.indexOf('e')\n if (eIndex > 0) {\n const precision = +str.slice(eIndex + 1)\n return precision < 0 ? -precision : 0\n } else {\n const dotIndex = str.indexOf('.')\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex\n }\n }\n\n _round (x, precision) {\n if (precision == null) {\n precision = 10\n }\n // Avoid range error\n precision = Math.min(Math.max(0, precision), 20)\n x = (+x).toFixed(precision)\n return x\n }\n}\n","import Axis from './Axis'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { formatValue } from '../utils/format'\n\nexport const YAxisType = {\n CANDLE_STICK: 'candle_stick',\n TECHNICAL_INDICATOR: 'technical_indicator'\n}\n\nexport default class YAxis extends Axis {\n constructor (chartData, yAxisType) {\n super(chartData)\n this._yAxisType = yAxisType\n }\n\n _compareMinMax (kLineData, technicalIndicatorType, minMaxArray) {\n const technicalIndicatorData = formatValue(kLineData, technicalIndicatorType.toLowerCase(), {})\n Object.keys(technicalIndicatorData).forEach(key => {\n const value = technicalIndicatorData[key]\n if (value || value === 0) {\n minMaxArray[0] = Math.min(minMaxArray[0], value)\n minMaxArray[1] = Math.max(minMaxArray[1], value)\n }\n })\n if (technicalIndicatorType === TechnicalIndicatorType.BOLL || technicalIndicatorType === TechnicalIndicatorType.SAR) {\n minMaxArray[0] = Math.min(minMaxArray[0], kLineData.low)\n minMaxArray[1] = Math.max(minMaxArray[1], kLineData.high)\n }\n return minMaxArray\n }\n\n _computeMinMaxValue () {\n let min = this._minValue\n let max = this._maxValue\n if (min === Infinity || max === -Infinity) {\n return { min: 0, max: 0, range: 0 }\n }\n\n let range = Math.abs(max - min)\n if (range === 0) {\n max += 1\n range = Math.abs(max - min)\n }\n // 保证每次图形绘制上下都留间隙\n min = min - (range / 100.0) * 10.0\n max = max + (range / 100.0) * 20.0\n range = Math.abs(max - min)\n return { min, max, range }\n }\n\n _computeOptimalTicks (ticks) {\n const optimalTicks = []\n const tickLength = ticks.length\n if (tickLength > 0) {\n const textHeight = this._chartData.styleOptions().xAxis.tickText.size\n const y = this.convertToPixel(+ticks[0].v)\n let tickCountDif = 1\n if (tickLength > 1) {\n const nextY = this.convertToPixel(+ticks[1].v)\n const yDif = Math.abs(nextY - y)\n if (yDif < textHeight * 2) {\n tickCountDif = Math.ceil(textHeight * 2 / yDif)\n }\n }\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const v = ticks[i].v\n const y = this.convertToPixel(+v)\n if (y > textHeight &&\n y < this._height - textHeight) {\n optimalTicks.push({ v, y })\n }\n }\n }\n return optimalTicks\n }\n\n /**\n * 计算最大最小值\n * @param technicalIndicatorType\n * @param isRealTime\n */\n calcMinMaxValue (technicalIndicatorType, isRealTime) {\n const dataList = this._chartData.dataList()\n const from = this._chartData.from()\n const to = this._chartData.to()\n const isShowAverageLine = this._chartData.styleOptions().realTime.averageLine.display\n const minMaxArray = [Infinity, -Infinity]\n if (isRealTime) {\n for (let i = from; i < to; i++) {\n const kLineData = dataList[i]\n const minCompareArray = [kLineData.close, minMaxArray[0]]\n const maxCompareArray = [kLineData.close, minMaxArray[1]]\n if (isShowAverageLine) {\n minCompareArray.push(kLineData.average)\n maxCompareArray.push(kLineData.average)\n }\n minMaxArray[0] = Math.min.apply(null, minCompareArray)\n minMaxArray[1] = Math.max.apply(null, maxCompareArray)\n }\n } else {\n for (let i = from; i < to; i++) {\n const kLineData = dataList[i]\n this._compareMinMax(kLineData, technicalIndicatorType, minMaxArray)\n if (this.isCandleStickYAxis()) {\n minMaxArray[0] = Math.min(kLineData.low, minMaxArray[0])\n minMaxArray[1] = Math.max(kLineData.high, minMaxArray[1])\n }\n }\n if (technicalIndicatorType === TechnicalIndicatorType.VOL) {\n minMaxArray[0] = 0\n }\n }\n if (minMaxArray[0] !== Infinity && minMaxArray[1] !== -Infinity) {\n this._minValue = minMaxArray[0]\n this._maxValue = minMaxArray[1]\n }\n }\n\n /**\n * 是否是蜡烛图y轴组件\n * @returns {boolean}\n */\n isCandleStickYAxis () {\n return this._yAxisType === YAxisType.CANDLE_STICK\n }\n\n convertFromPixel (pixel) {\n return (1.0 - pixel / this._height) * this._range + this._minValue\n }\n\n convertToPixel (value) {\n return Math.round((1.0 - (value - this._minValue) / this._range) * this._height)\n }\n}\n","import Series from './Series'\nimport TechnicalIndicatorWidget from '../widget/TechnicalIndicatorWidget'\nimport YAxisWidget from '../widget/YAxisWidget'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport YAxis, { YAxisType } from '../component/YAxis'\nimport { InvalidateLevel } from '../data/ChartData'\n\nexport default class TechnicalIndicatorSeries extends Series {\n constructor (props) {\n super(props)\n this._technicalIndicatorType = props.technicalIndicatorType || TechnicalIndicatorType.MACD\n this._calcTechnicalIndicator()\n }\n\n _initBefore (props) {\n this._tag = props.tag\n this._yAxis = this._createYAxis(props)\n }\n\n _createYAxis (props) {\n return new YAxis(props.chartData, YAxisType.TECHNICAL_INDICATOR)\n }\n\n _createMainWidget (container, props) {\n return new TechnicalIndicatorWidget({\n container,\n chartData: props.chartData,\n xAxis: props.xAxis,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _createYAxisWidget (container, props) {\n return new YAxisWidget({\n container,\n chartData: props.chartData,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _computeAxis () {\n this._yAxis.calcMinMaxValue(this._technicalIndicatorType, this._isRealTime())\n this._yAxis.computeAxis()\n }\n\n _isRealTime () {\n return false\n }\n\n /**\n * 计算指标\n * @private\n */\n _calcTechnicalIndicator () {\n if (this._chartData.calcTechnicalIndicator(this._technicalIndicatorType)) {\n this.invalidate(InvalidateLevel.FULL)\n }\n }\n\n /**\n * 获取标识\n * @returns {string}\n */\n tag () {\n return this._tag\n }\n\n /**\n * 设置尺寸\n * @param mainWidgetSize\n * @param yAxisWidgetSize\n */\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._yAxis.setSize(yAxisWidgetSize.width, yAxisWidgetSize.height)\n this._computeAxis()\n super.setSize(mainWidgetSize, yAxisWidgetSize)\n }\n\n yAxis () {\n return this._yAxis\n }\n\n /**\n * 获取技术指标类型\n * @returns {string}\n */\n technicalIndicatorType () {\n return this._technicalIndicatorType\n }\n\n setTechnicalIndicatorType (technicalIndicatorType) {\n if (this._technicalIndicatorType !== technicalIndicatorType) {\n this._technicalIndicatorType = technicalIndicatorType\n this._calcTechnicalIndicator()\n }\n }\n}\n","import TechnicalIndicatorView from './TechnicalIndicatorView'\nimport { LineStyle, CandleStickStyle, ChartType } from '../data/options/styleOptions'\nimport { drawHorizontalLine, drawVerticalLine, getFont, strokeInPixel } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\n\nexport default class CandleStickView extends TechnicalIndicatorView {\n _draw () {\n this._drawGrid()\n if (this._additionalDataProvider.chartType() === ChartType.REAL_TIME) {\n this._drawRealTime()\n } else {\n this._drawCandleStick()\n this._drawTechnicalIndicator()\n this._drawHighestPriceMark()\n this._drawLowestPriceMark()\n }\n this._drawLastPriceLine()\n }\n\n /**\n * 绘制分时图\n * @private\n */\n _drawRealTime () {\n const timeLinePoints = []\n const timeLineAreaPoints = [{ x: 0, y: this._height }]\n const averageLinePoints = []\n\n const from = this._chartData.from()\n const range = this._chartData.range()\n const to = this._chartData.to()\n const onDrawing = (x, i, kLineData) => {\n const average = kLineData.average\n const closeY = this._yAxis.convertToPixel(kLineData.close)\n const averageY = this._yAxis.convertToPixel(average)\n timeLinePoints.push({ x: x, y: closeY })\n if (average || average === 0) {\n averageLinePoints.push({ x: x, y: averageY })\n }\n if (i === from) {\n timeLineAreaPoints.push({ x: 0, y: closeY })\n }\n timeLineAreaPoints.push({ x: x, y: closeY })\n }\n const onDrawEnd = () => {\n const areaPointLength = timeLineAreaPoints.length\n if (areaPointLength > 0) {\n const lastPoint = timeLineAreaPoints[areaPointLength - 1]\n const isFit = !(from - to < range)\n if (isFit) {\n timeLineAreaPoints.push({ x: this._width, y: lastPoint.y })\n timeLineAreaPoints.push({ x: this._width, y: this._height })\n } else {\n timeLineAreaPoints.push({ x: lastPoint.x, y: this._height })\n }\n }\n\n const realTime = this._chartData.styleOptions().realTime\n const timeLine = realTime.timeLine\n if (timeLinePoints.length > 0) {\n // 绘制分时线\n this._ctx.lineWidth = timeLine.size\n this._ctx.strokeStyle = timeLine.color\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(timeLinePoints[0].x, timeLinePoints[0].y)\n for (let i = 1; i < timeLinePoints.length; i++) {\n this._ctx.lineTo(timeLinePoints[i].x, timeLinePoints[i].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n })\n }\n\n if (timeLineAreaPoints.length > 0) {\n // 绘制分时线填充区域\n this._ctx.fillStyle = timeLine.areaFillColor\n this._ctx.beginPath()\n this._ctx.moveTo(timeLineAreaPoints[0].x, timeLineAreaPoints[0].y)\n for (let i = 1; i < timeLineAreaPoints.length; i++) {\n this._ctx.lineTo(timeLineAreaPoints[i].x, timeLineAreaPoints[i].y)\n }\n this._ctx.closePath()\n this._ctx.fill()\n }\n const averageLine = realTime.averageLine\n if (averageLine.display && averageLinePoints.length > 0) {\n // 绘制均线\n this._ctx.lineWidth = averageLine.size\n this._ctx.strokeStyle = averageLine.color\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(averageLinePoints[0].x, averageLinePoints[0].y)\n for (let i = 1; i < averageLinePoints.length; i++) {\n this._ctx.lineTo(averageLinePoints[i].x, averageLinePoints[i].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n })\n }\n }\n this._drawGraphics(onDrawing, onDrawEnd)\n }\n\n /**\n * 绘制蜡烛\n * @private\n */\n _drawCandleStick () {\n this._ctx.lineWidth = 1\n let rect = []\n let markHighestPrice = -Infinity\n let markHighestPriceX = -1\n let markLowestPrice = Infinity\n let markLowestPriceX = -1\n const dataList = this._chartData.dataList()\n const candleStick = this._chartData.styleOptions().candleStick\n const onDrawing = (x, i, kLineData, halfBarSpace, barSpace) => {\n const close = kLineData.close\n const preKLineData = dataList[i - 1] || {}\n const preClose = preKLineData.close || close\n const high = kLineData.high\n const low = kLineData.low\n const open = kLineData.open\n if (markHighestPrice < high) {\n markHighestPrice = high\n markHighestPriceX = x\n }\n\n if (low < markLowestPrice) {\n markLowestPrice = low\n markLowestPriceX = x\n }\n if (close > preClose) {\n this._ctx.strokeStyle = candleStick.bar.upColor\n this._ctx.fillStyle = candleStick.bar.upColor\n } else if (close < preClose) {\n this._ctx.strokeStyle = candleStick.bar.downColor\n this._ctx.fillStyle = candleStick.bar.downColor\n } else {\n this._ctx.strokeStyle = candleStick.bar.noChangeColor\n this._ctx.fillStyle = candleStick.bar.noChangeColor\n }\n\n if (candleStick.bar.style !== CandleStickStyle.OHLC) {\n const openY = this._yAxis.convertToPixel(open)\n const closeY = this._yAxis.convertToPixel(close)\n const highY = this._yAxis.convertToPixel(high)\n const lowY = this._yAxis.convertToPixel(low)\n const highLine = []\n const lowLine = []\n highLine[0] = highY\n lowLine[1] = lowY\n if (openY > closeY) {\n highLine[1] = closeY\n lowLine[0] = openY\n rect = [x - halfBarSpace, closeY, barSpace, openY - closeY]\n } else if (openY < closeY) {\n highLine[1] = openY\n lowLine[0] = closeY\n rect = [x - halfBarSpace, openY, barSpace, closeY - openY]\n } else {\n highLine[1] = openY\n lowLine[0] = closeY\n rect = [x - halfBarSpace, openY, barSpace, 1]\n }\n this._ctx.beginPath()\n this._ctx.moveTo(x, highLine[0])\n this._ctx.lineTo(x, highLine[1])\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x, lowLine[0])\n this._ctx.lineTo(x, lowLine[1])\n this._ctx.stroke()\n this._ctx.closePath()\n\n if (rect[3] < 1) {\n rect[3] = 1\n }\n switch (candleStick.bar.style) {\n case CandleStickStyle.SOLID: {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n break\n }\n case CandleStickStyle.STROKE: {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n break\n }\n case CandleStickStyle.UP_STROKE: {\n if (close > preClose) {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n } else {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n }\n break\n }\n case CandleStickStyle.DOWN_STROKE: {\n if (close > preClose) {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n } else {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n }\n break\n }\n }\n } else {\n this._drawOhlc(\n halfBarSpace, x, kLineData,\n preKLineData, candleStick.bar.upColor,\n candleStick.bar.downColor, candleStick.bar.noChangeColor\n )\n }\n }\n this._drawGraphics(onDrawing)\n this._highestMarkData = { x: markHighestPriceX, price: markHighestPrice }\n this._lowestMarkData = { x: markLowestPriceX, price: markLowestPrice }\n }\n\n /**\n * 渲染最高价标记\n * @param pricePrecision\n */\n _drawHighestPriceMark (pricePrecision) {\n if (!this._highestMarkData) {\n return\n }\n const price = this._highestMarkData.price\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const highestPriceMark = priceMark.high\n if (price === -Infinity || !priceMark.display || !highestPriceMark.display) {\n return\n }\n this._drawLowestHighestPriceMark(\n highestPriceMark, this._highestMarkData.x, price, true, this._chartData.precisionOptions().price\n )\n }\n\n /**\n * 绘制最低价标记\n */\n _drawLowestPriceMark () {\n if (!this._lowestMarkData) {\n return\n }\n const price = this._lowestMarkData.price\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lowestPriceMark = priceMark.low\n if (price === Infinity || !priceMark.display || !lowestPriceMark.display) {\n return\n }\n this._drawLowestHighestPriceMark(\n lowestPriceMark, this._lowestMarkData.x, price, false, this._chartData.precisionOptions().price\n )\n }\n\n /**\n * 渲染最高最低价格标记\n * @param priceMark\n * @param x\n * @param price\n * @param isHigh\n * @param pricePrecision\n */\n _drawLowestHighestPriceMark (priceMark, x, price, isHigh, pricePrecision) {\n const priceY = this._yAxis.convertToPixel(price)\n const startX = x\n const startY = priceY + (isHigh ? -2 : 2)\n this._ctx.textAlign = 'left'\n this._ctx.lineWidth = 1\n this._ctx.strokeStyle = priceMark.color\n this._ctx.fillStyle = priceMark.color\n\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(startX, startY)\n this._ctx.lineTo(startX - 2, startY + (isHigh ? -2 : 2))\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(startX, startY)\n this._ctx.lineTo(startX + 2, startY + (isHigh ? -2 : 2))\n this._ctx.stroke()\n this._ctx.closePath()\n })\n\n // 绘制竖线\n const y = startY + (isHigh ? -5 : 5)\n drawVerticalLine(this._ctx, startX, startY, y)\n drawHorizontalLine(this._ctx, y, startX, startX + 5)\n\n this._ctx.font = getFont(priceMark.textSize)\n const text = formatPrecision(price, pricePrecision)\n this._ctx.textBaseline = 'middle'\n this._ctx.fillText(text, startX + 5 + priceMark.textMargin, y)\n }\n\n /**\n * 绘制最新价线\n * @private\n */\n _drawLastPriceLine () {\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lastPriceMark = priceMark.last\n if (!priceMark.display || !lastPriceMark.display || !lastPriceMark.line.display || dataSize === 0) {\n return\n }\n const lastPrice = dataList[dataSize - 1].close\n const preKLineData = dataList[dataSize - 2] || {}\n const preLastPrice = preKLineData.close || lastPrice\n let priceY = this._yAxis.convertToPixel(lastPrice)\n priceY = +(Math.max(this._height * 0.05, Math.min(priceY, this._height * 0.98))).toFixed(0)\n let color\n if (lastPrice > preLastPrice) {\n color = lastPriceMark.upColor\n } else if (lastPrice < preLastPrice) {\n color = lastPriceMark.downColor\n } else {\n color = lastPriceMark.noChangeColor\n }\n const priceMarkLine = lastPriceMark.line\n this._ctx.strokeStyle = color\n this._ctx.lineWidth = priceMarkLine.size\n if (priceMarkLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(priceMarkLine.dashValue)\n }\n drawHorizontalLine(this._ctx, priceY, 0, this._width)\n this._ctx.setLineDash([])\n }\n}\n","import TechnicalIndicatorFloatLayerView from './TechnicalIndicatorFloatLayerView'\nimport { isFunction } from '../utils/typeChecks'\nimport { formatDate, formatPrecision, formatValue } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { ChartType, FloatLayerPromptCandleStickTextDisplayType } from '../data/options/styleOptions'\n\nexport default class CandleStickFloatLayerView extends TechnicalIndicatorFloatLayerView {\n _drawPrompt (kLineData, x) {\n const floatLayerPromptCandleStick = this._chartData.styleOptions().floatLayer.prompt.candleStick\n const candleStickPromptData = this._getCandleStickPromptData(kLineData, floatLayerPromptCandleStick)\n if (floatLayerPromptCandleStick.showType === FloatLayerPromptCandleStickTextDisplayType.STANDARD) {\n this._drawCandleStickStandardPromptText(floatLayerPromptCandleStick, candleStickPromptData)\n if (this._additionalDataProvider.chartType() === ChartType.CANDLE_STICK) {\n this._drawTechnicalIndicatorPrompt(\n kLineData, x,\n floatLayerPromptCandleStick.text.size + floatLayerPromptCandleStick.text.marginTop\n )\n }\n } else {\n this._drawCandleStickRectPromptText(kLineData, x, floatLayerPromptCandleStick, candleStickPromptData)\n }\n }\n\n _drawCandleStickStandardPromptText (floatLayerPromptCandleStick, candleStickPromptData) {\n const values = candleStickPromptData\n const textMarginLeft = floatLayerPromptCandleStick.text.marginLeft\n const textMarginRight = floatLayerPromptCandleStick.text.marginRight\n const textSize = floatLayerPromptCandleStick.text.size\n const textColor = floatLayerPromptCandleStick.text.color\n const labels = floatLayerPromptCandleStick.labels\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(textSize)\n let labelX = textMarginLeft\n const labelY = floatLayerPromptCandleStick.text.marginTop\n labels.forEach((label, i) => {\n const labelText = label ? `${label}: ` : ''\n const labelWidth = calcTextWidth(this._ctx, labelText)\n this._ctx.fillStyle = textColor\n this._ctx.fillText(labelText, labelX, labelY)\n labelX += labelWidth\n\n const value = values[i] || '--'\n let valueText\n if (typeof value === 'object') {\n valueText = value.value || '--'\n this._ctx.fillStyle = value.color || textColor\n } else {\n this._ctx.fillStyle = textColor\n valueText = value\n }\n const textWidth = calcTextWidth(this._ctx, valueText)\n this._ctx.fillText(valueText, labelX, labelY)\n labelX += (textWidth + textMarginLeft + textMarginRight)\n })\n }\n\n _drawCandleStickRectPromptText (kLineData, x, floatLayerPromptCandleStick, candleStickPromptData) {\n const baseLabels = floatLayerPromptCandleStick.labels\n const baseValues = candleStickPromptData\n const baseTextMarginLeft = floatLayerPromptCandleStick.text.marginLeft\n const baseTextMarginRight = floatLayerPromptCandleStick.text.marginRight\n const baseTextMarginTop = floatLayerPromptCandleStick.text.marginTop\n const baseTextMarginBottom = floatLayerPromptCandleStick.text.marginBottom\n const baseTextSize = floatLayerPromptCandleStick.text.size\n const baseTextColor = floatLayerPromptCandleStick.text.color\n\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(baseTextSize)\n let maxLabelWidth = 0\n baseLabels.forEach((label, i) => {\n const value = baseValues[i] || '--'\n let v = value\n if (typeof value === 'object') {\n v = value.value || '--'\n }\n const text = `${label}: ${v}`\n const labelWidth = calcTextWidth(this._ctx, text) + baseTextMarginLeft + baseTextMarginRight\n maxLabelWidth = Math.max(maxLabelWidth, labelWidth)\n })\n\n const rect = floatLayerPromptCandleStick.rect\n const rectBorderSize = rect.borderSize\n const rectPaddingLeft = rect.paddingLeft\n const rectPaddingRight = rect.paddingRight\n const rectPaddingTop = rect.paddingTop\n const rectPaddingBottom = rect.paddingBottom\n const rectLeft = rect.left\n const rectRight = rect.right\n let rectHeight = rectBorderSize * 2 +\n rectPaddingTop + rectPaddingBottom +\n (baseTextMarginBottom + baseTextMarginTop + baseTextSize) * baseLabels.length\n\n const technicalIndicatorPromptData = this._getTechnicalIndicatorPromptData(kLineData)\n const floatLayerPromptTechnicalIndicator = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator\n\n const indicatorTextMarginLeft = floatLayerPromptTechnicalIndicator.text.marginLeft\n const indicatorTextMarginRight = floatLayerPromptTechnicalIndicator.text.marginRight\n const indicatorTextMarginTop = floatLayerPromptTechnicalIndicator.text.marginTop\n const indicatorTextMarginBottom = floatLayerPromptTechnicalIndicator.text.marginBottom\n const indicatorTextSize = floatLayerPromptTechnicalIndicator.text.size\n\n const isCandleStick = this._additionalDataProvider.chartType() === ChartType.CANDLE_STICK\n const indicatorLabels = technicalIndicatorPromptData.labels || []\n const indicatorValues = technicalIndicatorPromptData.values || []\n if (isCandleStick) {\n this._ctx.font = getFont(indicatorTextSize)\n indicatorLabels.forEach((label, i) => {\n const v = indicatorValues[i] || '--'\n const text = `${label}: ${v}`\n const labelWidth = calcTextWidth(this._ctx, text) + indicatorTextMarginLeft + indicatorTextMarginRight\n maxLabelWidth = Math.max(maxLabelWidth, labelWidth)\n })\n rectHeight += ((indicatorTextMarginTop + indicatorTextMarginBottom + indicatorTextSize) * indicatorLabels.length)\n }\n\n const rectWidth = rectBorderSize * 2 + maxLabelWidth + rectPaddingLeft + rectPaddingRight\n\n const centerX = this._width / 2\n let rectX\n if (x < centerX) {\n rectX = this._width - rectRight - rectWidth\n } else {\n rectX = rectLeft\n }\n const rectY = rect.top\n const radius = rect.borderRadius\n this._ctx.lineWidth = rectBorderSize\n this._ctx.strokeStyle = rect.borderColor\n this._ctx.fillStyle = rect.fillColor\n this._drawRoundRect(rectX, rectY, rectWidth, rectHeight, radius)\n this._ctx.stroke()\n this._drawRoundRect(rectX, rectY, rectWidth, rectHeight, radius)\n this._ctx.fill()\n\n if (isCandleStick) {\n const baseLabelX = rectX + rectBorderSize + rectPaddingLeft + baseTextMarginLeft\n let labelY = rectY + rectBorderSize + rectPaddingTop\n // 开始渲染基础数据文字\n this._ctx.font = getFont(baseTextSize)\n baseLabels.forEach((label, i) => {\n labelY += baseTextMarginTop\n this._ctx.textAlign = 'left'\n this._ctx.fillStyle = baseTextColor\n this._ctx.fillText(`${label}: `, baseLabelX, labelY)\n\n const value = baseValues[i] || '--'\n let text\n this._ctx.fillStyle = value.color || baseTextColor\n if (typeof value === 'object') {\n text = value.value || '--'\n } else {\n text = value\n }\n this._ctx.textAlign = 'right'\n this._ctx.fillText(text, rectX + rectWidth - rectBorderSize - baseTextMarginRight - rectPaddingRight, labelY)\n labelY += (baseTextSize + baseTextMarginBottom)\n })\n // 开始渲染指标数据文字\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n const colors = technicalIndicatorOptions.line.colors\n const indicatorLabelX = rectX + rectBorderSize + rectPaddingLeft + indicatorTextMarginLeft\n const colorSize = colors.length\n this._ctx.font = getFont(indicatorTextSize)\n indicatorLabels.forEach((label, i) => {\n labelY += indicatorTextMarginTop\n this._ctx.textAlign = 'left'\n this._ctx.fillStyle = colors[i % colorSize] || technicalIndicatorOptions.text.color\n this._ctx.fillText(`${label.toUpperCase()}: `, indicatorLabelX, labelY)\n\n this._ctx.textAlign = 'right'\n this._ctx.fillText(\n indicatorValues[i] || '--',\n rectX + rectWidth - rectBorderSize - indicatorTextMarginRight - rectPaddingRight,\n labelY\n )\n labelY += (indicatorTextSize + indicatorTextMarginBottom)\n })\n }\n this._ctx.textAlign = 'left'\n }\n\n /**\n * 渲染圆角矩形\n * @param x\n * @param y\n * @param w\n * @param h\n * @param r\n */\n _drawRoundRect (x, y, w, h, r) {\n this._ctx.beginPath()\n this._ctx.moveTo(x + r, y)\n this._ctx.arcTo(x + w, y, x + w, y + h, r)\n this._ctx.arcTo(x + w, y + h, x, y + h, r)\n this._ctx.arcTo(x, y + h, x, y, r)\n this._ctx.arcTo(x, y, x + w, y, r)\n this._ctx.closePath()\n }\n\n /**\n * 获取蜡烛提示数据\n * @param kLineData\n * @param floatLayerPromptCandleStick\n * @returns {*}\n * @private\n */\n _getCandleStickPromptData (kLineData, floatLayerPromptCandleStick) {\n const baseValues = floatLayerPromptCandleStick.values\n let values = []\n if (baseValues) {\n if (isFunction(baseValues)) {\n values = baseValues(kLineData) || []\n } else {\n values = baseValues\n }\n } else {\n const precisionOptions = this._chartData.precisionOptions()\n values = [\n formatValue(kLineData, 'timestamp'),\n formatValue(kLineData, 'open'),\n formatValue(kLineData, 'close'),\n formatValue(kLineData, 'high'),\n formatValue(kLineData, 'low'),\n formatValue(kLineData, 'volume')\n ]\n values.forEach((value, index) => {\n switch (index) {\n case 0: {\n values[index] = formatDate(value, 'YYYY-MM-DD hh:mm', this._chartData.timezone())\n break\n }\n case values.length - 1: {\n values[index] = formatPrecision(value, precisionOptions.volume)\n break\n }\n default: {\n values[index] = formatPrecision(value, precisionOptions.price)\n break\n }\n }\n })\n }\n return values\n }\n}\n","/**\n * 获取某点在两点决定的一次函数上的y值\n * @param point1\n * @param point2\n * @param targetPoints\n */\nexport function getLinearY (point1, point2, targetPoints) {\n const v = []\n if (point1 && point2 && targetPoints.length > 0) {\n const subX = (point1.x - point2.x)\n if (subX === 0) {\n targetPoints.forEach(point => {\n v.push(point.y)\n })\n } else {\n const k = (point1.y - point2.y) / subX\n const b = point1.y - k * point1.x\n targetPoints.forEach(point => {\n v.push(point.x * k + b)\n })\n }\n }\n return v\n}\n\n/**\n * 点是否在线上\n * @param point1\n * @param point2\n * @param targetPoint\n */\nexport function checkPointOnStraightLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (point1.x === point2.x) {\n return Math.abs(targetPoint.x - point1.x) < 1\n }\n if (point1.y === point2.y) {\n return Math.abs(targetPoint.y - point1.y) < 1\n }\n return Math.abs(targetPoint.y - getLinearY(point1, point2, [targetPoint])[0]) < 1\n}\n\n/**\n * 点是否在线段上\n * @param point1\n * @param point2\n * @param targetPoint\n * @returns {boolean}\n */\nexport function checkPointOnRayLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (checkPointOnStraightLine(point1, point2, targetPoint)) {\n if (point1.x === point2.x) {\n if (point1.y < point2.y) {\n return targetPoint.y > point1.y - 2\n } else {\n return targetPoint.y < point1.y + 2\n }\n }\n if (point1.x < point2.x) {\n return targetPoint.x > point1.x - 2\n } else {\n return targetPoint.x < point1.x + 2\n }\n }\n return false\n}\n\n/**\n * 判断点是否在线段上面\n * @param point1\n * @param point2\n * @param targetPoint\n */\nexport function checkPointOnSegmentLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (checkPointOnStraightLine(point1, point2, targetPoint)) {\n const a = Math.sqrt(Math.pow(targetPoint.x - point1.x, 2) + Math.pow(targetPoint.y - point1.y, 2))\n const b = Math.sqrt(Math.pow(targetPoint.x - point2.x, 2) + Math.pow(targetPoint.y - point2.y, 2))\n const c = Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2))\n return Math.abs(a + b - c) < 2\n }\n return false\n}\n\n/**\n * 点是否在圆上\n * @param circleCenterPoint\n * @param radius\n * @param targetPoint\n * @returns {boolean}\n */\nexport function checkPointOnCircle (circleCenterPoint, radius, targetPoint) {\n if (!targetPoint) {\n return false\n }\n const subX = targetPoint.x - circleCenterPoint.x\n const subY = targetPoint.y - circleCenterPoint.y\n return !(subX * subX + subY * subY > radius * radius)\n}\n\n/**\n * 获取平行线\n * @param points\n * @param size\n * @param isPriceChannelLine\n * @returns {Array}\n */\nexport function getParallelLines (points, size, isPriceChannelLine) {\n const lines = []\n if (points.length > 1) {\n if (points[0].x === points[1].x) {\n const startY = 0\n const endY = size.height\n lines.push([{ x: points[0].x, y: startY }, { x: points[0].x, y: endY }])\n if (points.length > 2) {\n lines.push([{ x: points[2].x, y: startY }, { x: points[2].x, y: endY }])\n if (isPriceChannelLine) {\n const distance = points[0].x - points[2].x\n lines.push([{ x: points[0].x + distance, y: startY }, { x: points[0].x + distance, y: endY }])\n }\n }\n } else {\n const startX = 0\n const endX = size.width\n if (points[0].y === points[1].y) {\n lines.push([{ x: startX, y: points[0].y }, { x: endX, y: points[0].y }])\n if (points.length > 2) {\n lines.push([{ x: startX, y: points[2].y }, { x: endX, y: points[2].y }])\n if (isPriceChannelLine) {\n const distance = points[0].y - points[2].y\n lines.push([{ x: startX, y: points[0].y + distance }, { x: endX, y: points[0].y + distance }])\n }\n }\n } else {\n const k = (points[0].y - points[1].y) / (points[0].x - points[1].x)\n const b = points[0].y - k * points[0].x\n lines.push([{ x: startX, y: startX * k + b }, { x: endX, y: endX * k + b }])\n if (points.length > 2) {\n const b1 = points[2].y - k * points[2].x\n lines.push([{ x: startX, y: startX * k + b1 }, { x: endX, y: endX * k + b1 }])\n if (isPriceChannelLine) {\n const b2 = b + (b - b1)\n lines.push([{ x: startX, y: startX * k + b2 }, { x: endX, y: endX * k + b2 }])\n }\n }\n }\n }\n }\n return lines\n}\n\n/**\n * 获取斐波那契线\n * @param points\n * @param size\n */\nexport function getFibonacciLines (points, size) {\n const lines = []\n if (points.length > 0) {\n const startX = 0\n const endX = size.width\n lines.push([{ x: startX, y: points[0].y }, { x: endX, y: points[0].y }])\n if (points.length > 1) {\n const yDistance = points[0].y - points[1].y\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.786 }, { x: endX, y: points[1].y + yDistance * 0.786 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.618 }, { x: endX, y: points[1].y + yDistance * 0.618 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.5 }, { x: endX, y: points[1].y + yDistance * 0.5 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.382 }, { x: endX, y: points[1].y + yDistance * 0.382 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.236 }, { x: endX, y: points[1].y + yDistance * 0.236 }])\n lines.push([{ x: startX, y: points[1].y }, { x: endX, y: points[1].y }])\n }\n }\n return lines\n}\n","const MouseEventButton = {\n LEFT: 0,\n RIGHT: 2\n}\n\nconst DELAY_RESET_CLICK = 500\nconst DELAY_LONG_TAG = 600\n\nfunction getBoundingClientRect (element) {\n return element.getBoundingClientRect() || { left: 0, top: 0 }\n}\n\nfunction isTouchEvent (event) {\n return Boolean(event.touches)\n}\n\nfunction preventDefault (event) {\n if (event.cancelable) {\n event.preventDefault()\n }\n}\n\nfunction checkTouchEvents () {\n if ('ontouchstart' in window) {\n return true\n }\n\n return Boolean(window.DocumentTouch && document instanceof window.DocumentTouch)\n}\n\nconst touch = !!navigator.maxTouchPoints || !!navigator.msMaxTouchPoints || checkTouchEvents()\nconst mobileTouch = 'onorientationchange' in window && touch\n\nfunction getDistance (p1, p2) {\n const xDiff = p1.clientX - p2.clientX\n const yDiff = p1.clientY - p2.clientY\n return Math.sqrt(xDiff * xDiff + yDiff * yDiff)\n}\n\nexport const EventType = {\n MOUSE: 'mouse',\n TOUCH: 'touch'\n}\n\nexport default class EventBase {\n constructor (target, eventHandler, options) {\n this._target = target\n this._handler = eventHandler\n this._options = options\n\n this._clickCount = 0\n this._clickTimeoutId = null\n this._longTapTimeoutId = null\n this._longTapActive = false\n this._mouseMoveStartPosition = null\n this._moveExceededManhattanDistance = false\n this._cancelClick = false\n this._unsubscribeOutsideEvents = null\n this._unsubscribeMousemove = null\n this._unsubscribeRoot = null\n\n this._startPinchMiddlePoint = null\n this._startPinchDistance = 0\n this._pinchPrevented = false\n this._preventDragProcess = false\n\n this._mousePressed = false\n\n this._init()\n }\n\n destroy () {\n if (this._unsubscribeOutsideEvents !== null) {\n this._unsubscribeOutsideEvents()\n this._unsubscribeOutsideEvents = null\n }\n\n if (this._unsubscribeMousemove !== null) {\n this._unsubscribeMousemove()\n this._unsubscribeMousemove = null\n }\n\n if (this._unsubscribeRoot !== null) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n this._clearLongTapTimeout()\n this._resetClickTimeout()\n }\n\n _mouseEnterHandler (enterEvent) {\n if (this._unsubscribeMousemove) {\n this._unsubscribeMousemove()\n }\n\n {\n const boundMouseMoveHandler = this._mouseMoveHandler.bind(this)\n const boundMouseWheelHandler = this._mouseWheelHandler.bind(this)\n this._unsubscribeMousemove = () => {\n this._target.removeEventListener('mousemove', boundMouseMoveHandler)\n this._target.removeEventListener('wheel', boundMouseWheelHandler)\n }\n this._target.addEventListener('mousemove', boundMouseMoveHandler)\n this._target.addEventListener('wheel', boundMouseWheelHandler, { passive: false })\n }\n\n if (isTouchEvent(enterEvent)) {\n this._mouseMoveHandler(enterEvent)\n }\n\n const compatEvent = this._makeCompatEvent(enterEvent)\n this._processEvent(compatEvent, this._handler.mouseEnterEvent)\n }\n\n _resetClickTimeout () {\n if (this._clickTimeoutId !== null) {\n clearTimeout(this._clickTimeoutId)\n }\n\n this._clickCount = 0\n this._clickTimeoutId = null\n }\n\n _mouseMoveHandler (moveEvent) {\n if (this._mousePressed && !isTouchEvent(moveEvent)) {\n return\n }\n\n const compatEvent = this._makeCompatEvent(moveEvent)\n this._processEvent(compatEvent, this._handler.mouseMoveEvent)\n }\n\n _mouseWheelHandler (wheelEvent) {\n const compatEvent = this._makeCompatEvent(wheelEvent)\n wheelEvent.localX = compatEvent.localX\n wheelEvent.localY = compatEvent.localY\n this._processEvent(wheelEvent, this._handler.mouseWheelEvent)\n }\n\n _mouseMoveWithDownHandler (moveEvent) {\n if ('button' in moveEvent && moveEvent.button !== MouseEventButton.LEFT) {\n return\n }\n\n if (this._startPinchMiddlePoint !== null) {\n return\n }\n\n const isTouch = isTouchEvent(moveEvent)\n if (this._preventDragProcess && isTouch) {\n return\n }\n\n this._pinchPrevented = true\n\n const compatEvent = this._makeCompatEvent(moveEvent)\n\n const startMouseMovePos = this._mouseMoveStartPosition\n const xOffset = Math.abs(startMouseMovePos.x - compatEvent.pageX)\n const yOffset = Math.abs(startMouseMovePos.y - compatEvent.pageY)\n\n const moveExceededManhattanDistance = xOffset + yOffset > 5\n\n if (!moveExceededManhattanDistance && isTouch) {\n return\n }\n\n if (moveExceededManhattanDistance && !this._moveExceededManhattanDistance && isTouch) {\n // vertical drag is more important than horizontal drag\n // because we scroll the page vertically often than horizontally\n const correctedXOffset = xOffset * 0.5\n\n // a drag can be only if touch page scroll isn't allowed\n const isVertDrag = yOffset >= correctedXOffset && !this._options.treatVertTouchDragAsPageScroll\n const isHorzDrag = correctedXOffset > yOffset && !this._options.treatHorzTouchDragAsPageScroll\n\n // if drag event happened then we should revert preventDefault state to original one\n // and try to process the drag event\n // else we shouldn't prevent default of the event and ignore processing the drag event\n if (!isVertDrag && !isHorzDrag) {\n this._preventDragProcess = true\n }\n }\n\n if (moveExceededManhattanDistance) {\n this._moveExceededManhattanDistance = true\n\n // if manhattan distance is more that 5 - we should cancel click event\n this._cancelClick = true\n\n if (isTouch) {\n this._clearLongTapTimeout()\n }\n }\n\n if (!this._preventDragProcess) {\n this._processEvent(compatEvent, this._handler.pressedMouseMoveEvent)\n\n // we should prevent default in case of touch only\n // to prevent scroll of the page\n if (isTouch) {\n preventDefault(moveEvent)\n }\n }\n }\n\n _mouseUpHandler (mouseUpEvent) {\n if ('button' in mouseUpEvent && mouseUpEvent.button !== MouseEventButton.LEFT) {\n return\n }\n const compatEvent = this._makeCompatEvent(mouseUpEvent)\n\n this._clearLongTapTimeout()\n\n this._mouseMoveStartPosition = null\n\n this._mousePressed = false\n\n if (this._unsubscribeRoot) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n if (isTouchEvent(mouseUpEvent)) {\n this._mouseLeaveHandler(mouseUpEvent)\n }\n\n this._processEvent(compatEvent, this._handler.mouseUpEvent)\n ++this._clickCount\n if (this._clickTimeoutId && this._clickCount > 1) {\n this._processEvent(compatEvent, this._handler.mouseDoubleClickEvent)\n this._resetClickTimeout()\n } else {\n if (!this._cancelClick) {\n this._processEvent(compatEvent, this._handler.mouseClickEvent)\n }\n }\n\n // prevent safari's dblclick-to-zoom\n // we handle mouseDoubleClickEvent here ourself\n if (isTouchEvent(mouseUpEvent)) {\n preventDefault(mouseUpEvent)\n\n this._mouseLeaveHandler(mouseUpEvent)\n\n if (mouseUpEvent.touches.length === 0) {\n this._longTapActive = false\n }\n }\n }\n\n _clearLongTapTimeout () {\n if (this._longTapTimeoutId === null) {\n return\n }\n\n clearTimeout(this._longTapTimeoutId)\n this._longTapTimeoutId = null\n }\n\n _mouseDownHandler (downEvent) {\n if ('button' in downEvent && downEvent.button !== MouseEventButton.LEFT && downEvent.button !== MouseEventButton.RIGHT) {\n return\n }\n const compatEvent = this._makeCompatEvent(downEvent)\n if ('button' in downEvent && downEvent.button === MouseEventButton.RIGHT) {\n this._processEvent(compatEvent, this._handler.mouseRightDownEvent)\n return\n }\n this._cancelClick = false\n this._moveExceededManhattanDistance = false\n this._preventDragProcess = false\n\n if (isTouchEvent(downEvent)) {\n this._mouseEnterHandler(downEvent)\n }\n\n this._mouseMoveStartPosition = {\n x: compatEvent.pageX,\n y: compatEvent.pageY\n }\n\n if (this._unsubscribeRoot) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n {\n const boundMouseMoveWithDownHandler = this._mouseMoveWithDownHandler.bind(this)\n const boundMouseUpHandler = this._mouseUpHandler.bind(this)\n const rootElement = this._target.ownerDocument.documentElement\n\n this._unsubscribeRoot = () => {\n rootElement.removeEventListener('touchmove', boundMouseMoveWithDownHandler)\n rootElement.removeEventListener('touchend', boundMouseUpHandler)\n\n rootElement.removeEventListener('mousemove', boundMouseMoveWithDownHandler)\n rootElement.removeEventListener('mouseup', boundMouseUpHandler)\n }\n\n rootElement.addEventListener('touchmove', boundMouseMoveWithDownHandler, { passive: false })\n rootElement.addEventListener('touchend', boundMouseUpHandler, { passive: false })\n\n this._clearLongTapTimeout()\n\n if (isTouchEvent(downEvent) && downEvent.touches.length === 1) {\n this._longTapTimeoutId = setTimeout(this._longTapHandler.bind(this, downEvent), DELAY_LONG_TAG)\n } else {\n rootElement.addEventListener('mousemove', boundMouseMoveWithDownHandler)\n rootElement.addEventListener('mouseup', boundMouseUpHandler)\n }\n }\n\n this._mousePressed = true\n this._processEvent(compatEvent, this._handler.mouseDownEvent)\n\n if (!this._clickTimeoutId) {\n this._clickCount = 0\n this._clickTimeoutId = setTimeout(this._resetClickTimeout.bind(this), DELAY_RESET_CLICK)\n }\n }\n\n _init () {\n this._target.addEventListener('mouseenter', this._mouseEnterHandler.bind(this))\n\n this._target.addEventListener('touchcancel', this._clearLongTapTimeout.bind(this))\n\n {\n const doc = this._target.ownerDocument\n\n const outsideHandler = (event) => {\n if (!this._handler.mouseDownOutsideEvent) {\n return\n }\n if (event.target && this._target.contains(event.target)) {\n return\n }\n this._handler.mouseDownOutsideEvent()\n }\n\n this._unsubscribeOutsideEvents = () => {\n doc.removeEventListener('mousedown', outsideHandler)\n doc.removeEventListener('touchstart', outsideHandler)\n }\n\n doc.addEventListener('mousedown', outsideHandler)\n doc.addEventListener('touchstart', outsideHandler, { passive: true })\n }\n\n this._target.addEventListener('mouseleave', this._mouseLeaveHandler.bind(this))\n\n this._target.addEventListener('touchstart', this._mouseDownHandler.bind(this), { passive: true })\n if (!mobileTouch) {\n this._target.addEventListener('mousedown', this._mouseDownHandler.bind(this))\n }\n\n this._initPinch()\n\n // Hey mobile Safari, what's up?\n // If mobile Safari doesn't have any touchmove handler with passive=false\n // it treats a touchstart and the following touchmove events as cancelable=false,\n // so we can't prevent them (as soon we subscribe on touchmove inside handler of touchstart).\n // And we'll get scroll of the page along with chart's one instead of only chart's scroll.\n this._target.addEventListener('touchmove', () => {}, { passive: false })\n }\n\n _initPinch () {\n if (this._handler.pinchStartEvent === undefined &&\n this._handler.pinchEvent === undefined &&\n this._handler.pinchEndEvent === undefined\n ) {\n return\n }\n\n this._target.addEventListener(\n 'touchstart',\n (event) => this._checkPinchState(event.touches),\n { passive: true }\n )\n\n this._target.addEventListener(\n 'touchmove',\n (event) => {\n if (event.touches.length !== 2 || this._startPinchMiddlePoint === null) {\n return\n }\n\n if (this._handler.pinchEvent !== undefined) {\n const currentDistance = getDistance(event.touches[0], event.touches[1])\n const scale = currentDistance / this._startPinchDistance\n this._handler.pinchEvent(this._startPinchMiddlePoint, scale)\n preventDefault(event)\n }\n },\n { passive: false }\n )\n\n this._target.addEventListener('touchend', (event) => {\n this._checkPinchState(event.touches)\n })\n }\n\n _checkPinchState (touches) {\n if (touches.length === 1) {\n this._pinchPrevented = false\n }\n\n if (touches.length !== 2 || this._pinchPrevented || this._longTapActive) {\n this._stopPinch()\n } else {\n this._startPinch(touches)\n }\n }\n\n _startPinch (touches) {\n const box = getBoundingClientRect(this._target)\n this._startPinchMiddlePoint = {\n x: ((touches[0].clientX - box.left) + (touches[1].clientX - box.left)) / 2,\n y: ((touches[0].clientY - box.top) + (touches[1].clientY - box.top)) / 2\n }\n\n this._startPinchDistance = getDistance(touches[0], touches[1])\n\n if (this._handler.pinchStartEvent !== undefined) {\n this._handler.pinchStartEvent()\n }\n\n this._clearLongTapTimeout()\n }\n\n _stopPinch () {\n if (this._startPinchMiddlePoint === null) {\n return\n }\n\n this._startPinchMiddlePoint = null\n\n if (this._handler.pinchEndEvent !== undefined) {\n this._handler.pinchEndEvent()\n }\n }\n\n _mouseLeaveHandler (event) {\n if (this._unsubscribeMousemove) {\n this._unsubscribeMousemove()\n }\n const compatEvent = this._makeCompatEvent(event)\n this._processEvent(compatEvent, this._handler.mouseLeaveEvent)\n }\n\n _longTapHandler (event) {\n const compatEvent = this._makeCompatEvent(event)\n this._processEvent(compatEvent, this._handler.longTapEvent)\n this._cancelClick = true\n\n // long tap is active untill touchend event with 0 touches occured\n this._longTapActive = true\n }\n\n _processEvent (event, callback) {\n if (!callback) {\n return\n }\n callback.call(this._handler, event)\n }\n\n _makeCompatEvent (event) {\n // TouchEvent has no clientX/Y coordinates:\n // We have to use the last Touch instead\n let eventLike\n if ('touches' in event && event.touches.length) {\n eventLike = event.touches[0]\n } else if ('changedTouches' in event && event.changedTouches.length) {\n eventLike = event.changedTouches[0]\n } else {\n eventLike = event\n }\n\n const box = getBoundingClientRect(this._target)\n\n return {\n clientX: eventLike.clientX,\n clientY: eventLike.clientY,\n pageX: eventLike.pageX,\n pageY: eventLike.pageY,\n screenX: eventLike.screenX,\n screenY: eventLike.screenY,\n localX: eventLike.clientX - box.left,\n localY: eventLike.clientY - box.top,\n\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n\n type: event.type.startsWith('mouse') ? EventType.MOUSE : EventType.TOUCH,\n\n target: eventLike.target,\n view: event.view\n }\n }\n}\n","import { EventType } from './EventBase'\n\nexport function isTouch (event) {\n return event.type === EventType.TOUCH\n}\n\nexport function isMouse (event) {\n return event.type === EventType.MOUSE\n}\n\nexport default class EventHandler {\n constructor (chartData) {\n this._chartData = chartData\n this._seriesSize = {}\n }\n\n _checkEventPointX (x) {\n return x > this._seriesSize.contentLeft && x < this._seriesSize.contentRight\n }\n\n setSeriesSize (seriesSize) {\n this._seriesSize = seriesSize\n }\n}\n","import {\n checkPointOnCircle, checkPointOnStraightLine,\n checkPointOnRayLine, checkPointOnSegmentLine,\n getParallelLines, getFibonacciLines\n} from '../utils/graphic'\nimport { isFunction } from '../utils/typeChecks'\nimport { CANDLE_STICK_SERIES_TAG } from '../series/ChartSeries'\nimport { GraphicMarkType } from '../data/ChartData'\nimport EventHandler from './EventHandler'\n\n/**\n * 标记图形绘制步骤\n * @type {{STEP_3: *, STEP_DONE: *, STEP_1: *, STEP_2: *}}\n */\nexport const GraphicMarkDrawStep = {\n STEP_1: 'step_1',\n STEP_2: 'step_2',\n STEP_3: 'step_3',\n STEP_DONE: 'step_done'\n}\n\nexport default class GraphicMarkEventHandler extends EventHandler {\n constructor (chartData, xAxis, yAxis) {\n super(chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n // 标记当没有画线时鼠标是否按下\n this._noneGraphicMarkMouseDownFlag = false\n\n // 用来记录当没有绘制标记图形时,鼠标操作后落点线上的数据\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: null,\n dataIndex: -1,\n onLine: false,\n onCircle: false,\n pointIndex: -1\n }\n }\n\n /**\n * 鼠标抬起事件\n * @param event\n */\n mouseUpEvent (event) {\n this._chartData.setDragGraphicMarkFlag(false)\n this._noneGraphicMarkMouseDownFlag = false\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: null,\n dataIndex: -1,\n onLine: false,\n onCircle: false,\n pointIndex: -1\n }\n }\n\n /**\n * 鼠标按下事件\n * @param event\n */\n mouseDownEvent (event) {\n if (!this._checkEventPointX(event.localX) || !this._checkEventPointY(event.localY)) {\n return\n }\n const point = { x: event.localX, y: event.localY }\n this._chartData.setGraphicMarkPoint(point)\n const graphicMarkType = this._chartData.graphicMarkType()\n switch (graphicMarkType) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.PRICE_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n this._twoStepGraphicMarkMouseDown(event, graphicMarkType)\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n this._threeStepGraphicMarkMouseDown(event, graphicMarkType)\n break\n }\n case GraphicMarkType.NONE: {\n this._noneGraphicMarkMouseLeftDown(event)\n break\n }\n }\n }\n\n mouseRightDownEvent (event) {\n const graphicMarkType = this._chartData.graphicMarkType()\n if (graphicMarkType === GraphicMarkType.NONE) {\n this._findNoneGraphicMarkMouseDownActiveData(event)\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n graphicMarkData.splice(dataIndex, 1)\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n this.mouseUpEvent(event)\n }\n }\n }\n\n /**\n * 两步形成的标记图形鼠标按下处理\n * @param event\n * @param markKey\n */\n _twoStepGraphicMarkMouseDown (event, markKey) {\n this._graphicMarkMouseDown(event, markKey, (lastLineData) => {\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_2\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_DONE\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n break\n }\n }\n })\n }\n\n /**\n * 两个点形成的标记图形鼠标按下事件\n * @param event\n * @param markKey\n */\n _threeStepGraphicMarkMouseDown (event, markKey) {\n this._graphicMarkMouseDown(event, markKey, (lastLineData) => {\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_2\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_3\n break\n }\n case GraphicMarkDrawStep.STEP_3: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_DONE\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n break\n }\n }\n })\n }\n\n /**\n * 绘制标记图形时鼠标按下事件\n * @param event\n * @param markKey\n * @param performDifPoint\n */\n _graphicMarkMouseDown (event, markKey, performDifPoint) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n if (event.button === 2) {\n graphicMarkData.splice(graphicMarkData.length - 1, 1)\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n } else {\n const lastLineData = graphicMarkData[graphicMarkData.length - 1]\n performDifPoint(lastLineData)\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n }\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n // this.graphicMarkChart.flush()\n }\n\n /**\n * 没有绘制时鼠标按下事件\n */\n _noneGraphicMarkMouseLeftDown (event) {\n this._findNoneGraphicMarkMouseDownActiveData(event)\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n if (this._noneGraphicMarkMouseDownActiveData.onCircle) {\n this._noneGraphicMarkMouseDownFlag = true\n this._chartData.setDragGraphicMarkFlag(true)\n }\n }\n }\n\n /**\n * 查找没有绘制时鼠标按下时在哪条数据上\n * @param event\n */\n _findNoneGraphicMarkMouseDownActiveData (event) {\n const point = { x: event.localX, y: event.localY }\n const keys = Object.keys(this._chartData.graphicMarkData())\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n switch (key) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(\n xyPoints[0], { x: this._seriesSize.contentRight, y: xyPoints[0].y }, point\n )\n })) {\n return\n }\n break\n }\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(\n xyPoints[0], { x: xyPoints[0].x, y: this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentBottom }, point\n )\n })) {\n return\n }\n break\n }\n case GraphicMarkType.STRAIGHT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.RAY_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnRayLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE:\n case GraphicMarkType.SEGMENT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnSegmentLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n let linePoints = []\n const size = {\n width: this._seriesSize.contentRight - this._seriesSize.contentLeft,\n height: this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentBottom - this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentTop\n }\n switch (key) {\n case GraphicMarkType.PRICE_CHANNEL_LINE: {\n linePoints = getParallelLines(xyPoints, size, true)\n break\n }\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n linePoints = getParallelLines(xyPoints, size)\n break\n }\n case GraphicMarkType.FIBONACCI_LINE: {\n linePoints = getFibonacciLines(xyPoints, size)\n break\n }\n }\n let isOnGraphicMark = false\n for (let i = 0; i < linePoints.length; i++) {\n const points = linePoints[i]\n isOnGraphicMark = checkPointOnStraightLine(points[0], points[1], point)\n if (isOnGraphicMark) {\n return isOnGraphicMark\n }\n }\n return isOnGraphicMark\n })) {\n return\n }\n break\n }\n }\n }\n }\n\n /**\n * 查找没有绘制图时鼠标按下时落点在哪条数据上\n * @param markKey\n * @param point\n * @param checkPointOnLine\n * @returns {boolean}\n */\n _realFindNoneGraphicMarkMouseDownActiveData (markKey, point, checkPointOnLine) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const graphicMark = this._chartData.styleOptions().graphicMark\n graphicMarkData.forEach((data, index) => {\n const points = data.points\n const xyPoints = []\n let isOnCircle = false\n let pointIndex = -1\n points.forEach((p, i) => {\n const x = this._xAxis.convertToPixel(p.xPos)\n const y = this._yAxis.convertToPixel(p.price)\n xyPoints.push({ x, y })\n const isOn = checkPointOnCircle({ x, y }, graphicMark.point.radius, point)\n if (isOn) {\n pointIndex = i\n }\n if (!isOnCircle) {\n isOnCircle = isOn\n }\n })\n const isOnLine = checkPointOnLine(xyPoints, point)\n if (isOnLine || isOnCircle) {\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: markKey,\n dataIndex: index,\n onLine: isOnLine,\n onCircle: isOnCircle,\n pointIndex\n }\n return true\n }\n })\n return false\n }\n\n /**\n * 鼠标移动事件\n */\n mouseMoveEvent (event) {\n if (!this._checkEventPointX(event.localX) || !this._checkEventPointY(event.localY)) {\n return\n }\n const point = { x: event.localX, y: event.localY }\n this._chartData.setGraphicMarkPoint(point)\n if (!this._waitingForMouseMoveAnimationFrame) {\n this._waitingForMouseMoveAnimationFrame = true\n const graphicMarkType = this._chartData.graphicMarkType()\n switch (graphicMarkType) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE: {\n this._onePointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType, (lastLineData, { price }) => {\n lastLineData.points[0].price = price\n })\n break\n }\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType, (lastLineData, { xPos }) => {\n lastLineData.points[0].xPos = xPos\n })\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n this._threePointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.NONE: {\n this._chartData.setGraphicMarkData(this._chartData.graphicMarkData())\n break\n }\n }\n this._waitingForMouseMoveAnimationFrame = false\n }\n }\n\n pressedMouseMoveEvent (event) {\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const point = { x: event.localX, y: event.localY }\n switch (markKey) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE:\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n graphicMarkData[dataIndex].points[pointIndex].xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[pointIndex].price = this._yAxis.convertFromPixel(point.y)\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n const price = this._yAxis.convertFromPixel(point.y)\n graphicMarkData[dataIndex].points[pointIndex].xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[0].price = price\n graphicMarkData[dataIndex].points[1].price = price\n }\n break\n }\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n const xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[0].xPos = xPos\n graphicMarkData[dataIndex].points[1].xPos = xPos\n graphicMarkData[dataIndex].points[pointIndex].price = this._yAxis.convertFromPixel(point.y)\n }\n break\n }\n }\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkPoint({ x: event.localX, y: event.localY })\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n }\n }\n\n /**\n * 一个点形成的图形鼠标移动事件\n * @param point\n * @param markKey\n */\n _onePointGraphicMarkMouseMove (point, markKey) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1:\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.points[0].xPos = xPos\n lastLineData.points[0].price = price\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 两个点形成的线鼠标移动事件\n * @param point\n * @param markKey\n * @param stepTwo\n */\n _twoPointGraphicMarkMouseMove (point, markKey, stepTwo) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }, { xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.points[0] = { xPos, price }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.points[1] = { xPos, price }\n if (isFunction(stepTwo)) {\n stepTwo(lastLineData, { xPos, price })\n }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 三步形成的标记图形鼠标移动事件\n * @param point\n * @param markKey\n * @param stepTwo\n */\n _threePointGraphicMarkMouseMove (point, markKey, stepTwo) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }, { xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.points[0] = { xPos, price }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n if (isFunction(stepTwo)) {\n stepTwo(lastLineData, { xPos, price })\n }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_3: {\n lastLineData.points[2] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 绘制标记图形时鼠标移动事件\n * @param point\n * @param markKey\n * @param performDifPoint\n */\n _graphicMarkMouseMove (point, markKey, performDifPoint) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const lastLineData = graphicMarkData[graphicMarkData.length - 1] || { drawStep: GraphicMarkDrawStep.STEP_DONE }\n performDifPoint(graphicMarkData, lastLineData)\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n // this.graphicMarkChart.flush()\n }\n\n _checkEventPointY (y) {\n const size = this._seriesSize.tags[CANDLE_STICK_SERIES_TAG]\n return y > size.contentTop && y < size.contentBottom\n }\n}\n","import View from './View'\nimport {\n checkPointOnCircle,\n checkPointOnRayLine,\n checkPointOnSegmentLine,\n checkPointOnStraightLine, getFibonacciLines,\n getLinearY,\n getParallelLines\n} from '../utils/graphic'\n\nimport { GraphicMarkType } from '../data/ChartData'\nimport { GraphicMarkDrawStep } from '../event/GraphicMarkEventHandler'\nimport { formatPrecision } from '../utils/format'\nimport { drawHorizontalLine, drawVerticalLine, getFont, strokeInPixel } from '../utils/canvas'\n\nconst LineType = {\n COMMON: 0,\n HORIZONTAL: 1,\n VERTICAL: 2\n}\n\nexport default class GraphicMarkView extends View {\n constructor (container, chartData, xAxis, yAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n }\n\n _draw () {\n const graphicMark = this._chartData.styleOptions().graphicMark\n const pricePrecision = this._chartData.precisionOptions().price\n // 画线\n this._drawHorizontalStraightLine(graphicMark)\n this._drawVerticalStraightLine(graphicMark)\n this._drawStraightLine(graphicMark)\n this._drawHorizontalRayLine(graphicMark)\n this._drawVerticalRayLine(graphicMark)\n this._drawRayLine(graphicMark)\n this._drawSegmentLine(graphicMark)\n this._drawPriceLine(graphicMark, pricePrecision)\n this._drawPriceChannelLine(graphicMark)\n this._drawParallelStraightLine(graphicMark)\n this._drawFibonacciLine(graphicMark, pricePrecision)\n }\n\n /**\n * 渲染水平直线\n * @param graphicMark\n */\n _drawHorizontalStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return [[\n {\n x: 0,\n y: points[0].y\n }, {\n x: this._width,\n y: points[0].y\n }\n ]]\n }\n )\n }\n\n /**\n * 渲染垂直直线\n * @param graphicMark\n */\n _drawVerticalStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return [[\n {\n x: points[0].x,\n y: 0\n }, {\n x: points[0].x,\n y: this._height\n }\n ]]\n }\n )\n }\n\n /**\n * 渲染直线\n * @param graphicMark\n */\n _drawStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n if (points[0].x === points[1].x) {\n return [[\n {\n x: points[0].x,\n y: 0\n }, {\n x: points[0].x,\n y: this._height\n }\n ]]\n }\n const y = getLinearY(\n points[0], points[1],\n [\n {\n x: 0,\n y: points[0].y\n }, {\n x: this._width,\n y: points[0].y\n }\n ]\n )\n return [[\n {\n x: 0,\n y: y[0]\n }, {\n x: this._width,\n y: y[1]\n }\n ]]\n }\n )\n }\n\n /**\n * 绘制水平射线\n * @param graphicMark\n */\n _drawHorizontalRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n const point = { x: 0, y: points[0].y }\n if (points[0].x < points[1].x) {\n point.x = this._width\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 绘制垂直射线\n * @param graphicMark\n */\n _drawVerticalRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n const point = { x: points[0].x, y: 0 }\n if (points[0].y < points[1].y) {\n point.y = this._height\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 渲染射线\n * @param graphicMark\n */\n _drawRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n let point\n if (points[0].x === points[1].x && points[0].y !== points[1].y) {\n if (points[0].y < points[1].y) {\n point = {\n x: points[0].x,\n y: this._height\n }\n } else {\n point = {\n x: points[0].x,\n y: 0\n }\n }\n } else if (points[0].x > points[1].x) {\n point = {\n x: 0,\n y: getLinearY(points[0], points[1], [{ x: 0, y: points[0].y }])[0]\n }\n } else {\n point = {\n x: this._width,\n y: getLinearY(points[0], points[1], [{ x: this._width, y: points[0].y }])[0]\n }\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 绘制线段,水平线段,垂直线段,普通线段一起绘制\n * @param graphicMark\n */\n _drawSegmentLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n this._drawPointGraphicMark(\n GraphicMarkType.SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n }\n\n /**\n * 绘制价格线\n * @param graphicMark\n * @param pricePrecision\n */\n _drawPriceLine (graphicMark, pricePrecision) {\n this._drawPointGraphicMark(\n GraphicMarkType.PRICE_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n return [[points[0], { x: this._width, y: points[0].y }]]\n },\n true, pricePrecision\n )\n }\n\n /**\n * 渲染价格通道线\n * @param graphicMark\n */\n _drawPriceChannelLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.PRICE_CHANNEL_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getParallelLines(points, { width: this._width, height: this._height }, true)\n }\n )\n }\n\n /**\n * 渲染平行直线\n * @param graphicMark\n */\n _drawParallelStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.PARALLEL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getParallelLines(points, { width: this._width, height: this._height })\n }\n )\n }\n\n /**\n * 渲染斐波那契线\n * @param graphicMark\n * @param pricePrecision\n */\n _drawFibonacciLine (graphicMark, pricePrecision) {\n this._drawPointGraphicMark(\n GraphicMarkType.FIBONACCI_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getFibonacciLines(points, { width: this._width, height: this._height })\n }, true, pricePrecision, ['(100.0%)', '(78.6%)', '(61.8%)', '(50.0%)', '(38.2%)', '(23.6%)', '(0.0%)']\n )\n }\n\n /**\n * 渲染点形成的图形\n * @param markKey\n * @param graphicMark\n * @param checkPointOnLine\n * @param generatedLinePoints\n * @param isDrawPrice\n * @param pricePrecision\n * @param priceExtendsText\n */\n _drawPointGraphicMark (markKey, graphicMark, checkPointOnLine, generatedLinePoints, isDrawPrice, pricePrecision, priceExtendsText) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n graphicMarkData.forEach(({ points, drawStep }) => {\n const circlePoints = []\n points.forEach(({ xPos, price }) => {\n const x = this._xAxis.convertToPixel(xPos)\n const y = this._yAxis.convertToPixel(price)\n circlePoints.push({ x, y })\n })\n const linePoints = generatedLinePoints ? generatedLinePoints(circlePoints) : [circlePoints]\n this._drawGraphicMark(\n graphicMark, linePoints, circlePoints, drawStep,\n checkPointOnLine,\n isDrawPrice, pricePrecision, priceExtendsText\n )\n })\n }\n\n /**\n * 绘制标记图形\n * @param graphicMark\n * @param linePoints\n * @param circlePoints\n * @param drawStep\n * @param checkPointOnLine\n * @param isDrawPrice\n * @param pricePrecision\n * @param priceExtendsText\n */\n _drawGraphicMark (\n graphicMark, linePoints, circlePoints, drawStep, checkPointOnLine,\n isDrawPrice, pricePrecision, priceExtendsText = []\n ) {\n const graphicMarkPoint = this._chartData.graphicMarkPoint()\n let isOnLine = false\n linePoints.forEach((points, i) => {\n if (points.length > 1) {\n const isOn = checkPointOnLine(points[0], points[1], graphicMarkPoint)\n if (!isOnLine) {\n isOnLine = isOn\n }\n if (drawStep !== GraphicMarkDrawStep.STEP_1) {\n this._ctx.strokeStyle = graphicMark.line.color\n this._ctx.lineWidth = graphicMark.line.size\n const lineType = this._getLineType(points[0], points[1])\n switch (lineType) {\n case LineType.COMMON: {\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(points[0].x, points[0].y)\n this._ctx.lineTo(points[1].x, points[1].y)\n this._ctx.stroke()\n this._ctx.closePath()\n })\n break\n }\n case LineType.HORIZONTAL: {\n drawHorizontalLine(this._ctx, points[0].y, points[0].x, points[1].x)\n break\n }\n case LineType.VERTICAL: {\n drawVerticalLine(this._ctx, points[0].x, points[0].y, points[1].y)\n break\n }\n default: { break }\n }\n // 渲染价格\n if (isDrawPrice) {\n const price = this._yAxis.convertFromPixel(points[0].y)\n const priceText = formatPrecision(price, pricePrecision)\n const textSize = graphicMark.text.size\n this._ctx.font = getFont(textSize)\n this._ctx.fillStyle = graphicMark.text.color\n this._ctx.fillText(`${priceText} ${priceExtendsText[i] || ''}`, points[0].x + graphicMark.text.marginLeft, points[0].y - graphicMark.text.marginBottom)\n }\n }\n }\n })\n const radius = graphicMark.point.radius\n let isCircleActive = false\n for (let i = 0; i < circlePoints.length; i++) {\n isCircleActive = checkPointOnCircle(circlePoints[i], radius, graphicMarkPoint)\n if (isCircleActive) {\n break\n }\n }\n circlePoints.forEach(circlePoint => {\n const isOnCircle = checkPointOnCircle(circlePoint, radius, graphicMarkPoint)\n if (isCircleActive || isOnLine) {\n let circleRadius = radius\n let circleColor = graphicMark.point.backgroundColor\n let circleBorderColor = graphicMark.point.borderColor\n let circleBorderSize = graphicMark.point.borderSize\n if (isOnCircle) {\n circleRadius = graphicMark.point.activeRadius\n circleColor = graphicMark.point.activeBackgroundColor\n circleBorderColor = graphicMark.point.activeBorderColor\n circleBorderSize = graphicMark.point.activeBorderSize\n }\n this._ctx.fillStyle = circleColor\n this._ctx.beginPath()\n this._ctx.arc(circlePoint.x, circlePoint.y, circleRadius, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.fill()\n this._ctx.lineWidth = circleBorderSize\n this._ctx.strokeStyle = circleBorderColor\n this._ctx.beginPath()\n this._ctx.arc(circlePoint.x, circlePoint.y, circleRadius, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.stroke()\n }\n })\n }\n\n /**\n * 获取绘制线类型\n * @param point1\n * @param point2\n * @private\n */\n _getLineType (point1, point2) {\n if (point1.x === point2.x) {\n return LineType.VERTICAL\n }\n if (point1.y === point2.y) {\n return LineType.HORIZONTAL\n }\n return LineType.COMMON\n }\n}\n","import CandleStickView from '../view/CandleStickView'\nimport CandleStickFloatLayerView from '../view/CandleStickFloatLayerView'\nimport TechnicalIndicatorWidget from './TechnicalIndicatorWidget'\nimport { InvalidateLevel } from '../data/ChartData'\nimport GraphicMarkView from '../view/GraphicMarkView'\n\nexport default class CandleStickWidget extends TechnicalIndicatorWidget {\n _createMainView (container, props) {\n return new CandleStickView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n _createExpandView (container, props) {\n return new GraphicMarkView(container, props.chartData, props.xAxis, props.yAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new CandleStickFloatLayerView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n invalidate (level) {\n if (level === InvalidateLevel.GRAPHIC_MARK) {\n this._expandView.flush()\n } else {\n super.invalidate(level)\n }\n }\n\n setSize (width, height) {\n super.setSize(width, height)\n this._expandView.setSize(width, height)\n }\n}\n","import TechnicalIndicatorSeries from './TechnicalIndicatorSeries'\nimport CandleStickWidget from '../widget/CandleStickWidget'\nimport { ChartType } from '../data/options/styleOptions'\nimport YAxis, { YAxisType } from '../component/YAxis'\nimport { InvalidateLevel } from '../data/ChartData'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\n\nexport default class CandleStickSeries extends TechnicalIndicatorSeries {\n constructor (props) {\n super(props)\n this._chartType = ChartType.CANDLE_STICK\n }\n\n _createYAxis (props) {\n return new YAxis(props.chartData, YAxisType.CANDLE_STICK)\n }\n\n _createMainWidget (container, props) {\n return new CandleStickWidget({\n container,\n chartData: props.chartData,\n xAxis: props.xAxis,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n chartType: this.chartType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _isRealTime () {\n return this._chartType === ChartType.REAL_TIME\n }\n\n chartType () {\n return this._chartType\n }\n\n setChartType (chartType) {\n if (this._chartType !== chartType) {\n this._chartType = chartType\n if (this._chartData.styleOptions().realTime.averageLine.display && this._isRealTime()) {\n this._chartData.calcTechnicalIndicator(TechnicalIndicatorType.AVERAGE)\n }\n this.invalidate(InvalidateLevel.FULL)\n }\n }\n}\n","import View from './View'\nimport { drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\n\nexport default class XAxisView extends View {\n constructor (container, chartData, xAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n }\n\n _draw () {\n const xAxisOptions = this._chartData.styleOptions().xAxis\n if (xAxisOptions.display) {\n this._drawAxisLine(xAxisOptions)\n this._drawTickLines(xAxisOptions)\n this._drawTickLabels(xAxisOptions)\n }\n }\n\n _drawAxisLine (xAxisOptions) {\n const xAxisLine = xAxisOptions.axisLine\n if (!xAxisLine.display) {\n return\n }\n this._ctx.strokeStyle = xAxisLine.color\n this._ctx.lineWidth = xAxisLine.size\n drawHorizontalLine(this._ctx, 0, 0, this._width)\n }\n\n _drawTickLines (xAxisOptions) {\n const tickLine = xAxisOptions.tickLine\n if (!tickLine.display) {\n return\n }\n this._ctx.lineWidth = tickLine.size\n this._ctx.strokeStyle = tickLine.color\n\n const startY = xAxisOptions.axisLine.display ? xAxisOptions.axisLine.size : 0\n\n const endY = startY + tickLine.length\n this._xAxis.ticks().forEach(tick => {\n drawVerticalLine(this._ctx, tick.x, startY, endY)\n })\n }\n\n _drawTickLabels (xAxisOptions) {\n const tickText = xAxisOptions.tickText\n if (!tickText.display) {\n return\n }\n const tickLine = xAxisOptions.tickLine\n\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(tickText.size)\n this._ctx.textAlign = 'center'\n this._ctx.fillStyle = tickText.color\n\n let labelY = tickText.margin\n if (xAxisOptions.axisLine.display) {\n labelY += (xAxisOptions.axisLine.size)\n }\n if (tickLine.display) {\n labelY += (tickLine.length)\n }\n const ticks = this._xAxis.ticks()\n const tickLength = ticks.length\n for (let i = 0; i < tickLength; i++) {\n this._ctx.fillText(ticks[i].v, ticks[i].x, labelY)\n }\n }\n}\n","import AxisFloatLayerView from './AxisFloatLayerView'\nimport { formatDate } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\n\nexport default class XAxisFloatLayerView extends AxisFloatLayerView {\n _drawCrossHairLabel () {\n if (!this._chartData.crossHairSeriesTag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairVertical = crossHair.vertical\n const crossHairVerticalText = crossHairVertical.text\n if (!crossHair.display || !crossHairVertical.display || !crossHairVerticalText.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n let dataPos\n if (crossHairPoint) {\n dataPos = this._axis.convertFromPixel(crossHairPoint.x)\n } else {\n dataPos = this._chartData.dataList().length - 1\n }\n const kLineData = this._chartData.dataList()[dataPos]\n if (!kLineData) {\n return\n }\n const x = this._axis.convertToPixel(dataPos)\n const timestamp = kLineData.timestamp\n const text = formatDate(timestamp, 'YYYY-MM-DD hh:mm', this._chartData.timezone())\n\n const textSize = crossHairVerticalText.size\n this._ctx.font = getFont(textSize)\n const labelWidth = calcTextWidth(this._ctx, text)\n let xAxisLabelX = x - labelWidth / 2\n\n const paddingLeft = crossHairVerticalText.paddingLeft\n const paddingRight = crossHairVerticalText.paddingRight\n const paddingTop = crossHairVerticalText.paddingTop\n const paddingBottom = crossHairVerticalText.paddingBottom\n const borderSize = crossHairVerticalText.borderSize\n\n // 保证整个x轴上的提示文字总是完全显示\n if (xAxisLabelX < paddingLeft + borderSize) {\n xAxisLabelX = paddingLeft + borderSize\n } else if (xAxisLabelX > this._width - labelWidth - borderSize - paddingRight) {\n xAxisLabelX = this._width - labelWidth - borderSize - paddingRight\n }\n\n const rectLeft = xAxisLabelX - borderSize - paddingLeft\n const rectTop = 0\n const rectRight = xAxisLabelX + labelWidth + borderSize + paddingRight\n const rectBottom = rectTop + textSize + borderSize * 2 + paddingTop + paddingBottom\n this._ctx.fillStyle = crossHairVerticalText.backgroundColor\n this._ctx.fillRect(rectLeft, rectTop, rectRight - rectLeft, rectBottom - rectTop)\n\n this._ctx.lineWidth = borderSize\n this._ctx.strokeStyle = crossHairVerticalText.borderColor\n this._ctx.strokeRect(rectLeft, rectTop, rectRight - rectLeft, rectBottom - rectTop)\n\n // 绘制轴上的提示文字\n this._ctx.textBaseline = 'top'\n\n this._ctx.fillStyle = crossHairVerticalText.color\n this._ctx.fillText(\n text, xAxisLabelX, borderSize + paddingTop\n )\n }\n}\n","import Widget from './Widget'\nimport XAxisView from '../view/XAxisView'\nimport XAxisFloatLayerView from '../view/XAxisFloatLayerView'\n\nexport default class XAxisWidget extends Widget {\n _createMainView (container, props) {\n return new XAxisView(container, props.chartData, props.xAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new XAxisFloatLayerView(container, props.chartData, props.xAxis)\n }\n}\n","import Axis from './Axis'\nimport { calcTextWidth, getFont, getPixelRatio } from '../utils/canvas'\nimport { formatDate, formatValue } from '../utils/format'\n\nexport default class XAxis extends Axis {\n constructor (chartData) {\n super(chartData)\n this._initMeasureCanvas()\n }\n\n _initMeasureCanvas () {\n const measureCanvas = document.createElement('canvas')\n this._measureCtx = measureCanvas.getContext('2d')\n const pixelRatio = getPixelRatio(this._measureCtx)\n this._measureCtx.scale(pixelRatio, pixelRatio)\n }\n\n _computeMinMaxValue () {\n const min = this._chartData.from()\n const max = this._chartData.to() - 1\n const range = max - min\n return { min, max, range }\n }\n\n _computeOptimalTicks (ticks) {\n const optimalTicks = []\n const tickLength = ticks.length\n const dataList = this._chartData.dataList()\n if (tickLength > 0) {\n const timezone = this._chartData.timezone()\n const fontSize = this._chartData.styleOptions().xAxis.tickText.size\n this._measureCtx.font = getFont(fontSize)\n const defaultLabelWidth = calcTextWidth(this._measureCtx, '00-00 00:00')\n const pos = parseInt(ticks[0].v)\n const timestamp = formatValue(dataList[pos], 'timestamp', 0)\n const x = this.convertToPixel(pos)\n let tickCountDif = 1\n let tickLabelFormatType = 'MM:DD hh:mm'\n if (tickLength > 1) {\n const nextPos = parseInt(ticks[1].v)\n const nextTimestamp = formatValue(dataList[nextPos], 'timestamp', 0)\n const nextX = this.convertToPixel(nextPos)\n const xDif = Math.abs(nextX - x)\n if (xDif < defaultLabelWidth) {\n tickCountDif = Math.ceil(defaultLabelWidth / xDif)\n }\n const timeDif = nextTimestamp - timestamp\n const minuteDif = timeDif / 1000 / 60\n if (minuteDif < 12 * 60) {\n tickLabelFormatType = 'hh:mm'\n } else if (minuteDif < 15 * 24 * 60) {\n tickLabelFormatType = 'MM-DD'\n } else if (minuteDif < 180 * 24 * 60) {\n tickLabelFormatType = 'YYYY-MM'\n } else {\n tickLabelFormatType = 'YYYY'\n }\n }\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const pos = parseInt(ticks[i].v)\n const kLineData = dataList[pos]\n const timestamp = kLineData.timestamp\n let label = formatDate(timestamp, tickLabelFormatType, timezone)\n if (i <= tickLength - 1 - tickCountDif) {\n const nextPos = parseInt(ticks[i + tickCountDif].v)\n const nextKLineData = dataList[nextPos]\n const nextTimestamp = nextKLineData.timestamp\n const year = formatDate(timestamp, 'YYYY', timezone)\n const month = formatDate(timestamp, 'YYYY-MM', timezone)\n const day = formatDate(timestamp, 'MM-DD', timezone)\n if (year !== formatDate(nextTimestamp, 'YYYY', timezone)) {\n label = year\n } else if (month !== formatDate(nextTimestamp, 'YYYY-MM', timezone)) {\n label = month\n } else if (day !== formatDate(nextTimestamp, 'MM-DD', timezone)) {\n label = day\n }\n }\n\n const x = this.convertToPixel(pos)\n if (x > defaultLabelWidth / 2 &&\n x < this._width - defaultLabelWidth / 2) {\n optimalTicks.push({ v: label, x })\n }\n }\n if (optimalTicks.length === 0) {\n const pos = parseInt(ticks[ticks.length - 1].v)\n const timestamp = dataList[pos].timestamp\n const x = this.convertToPixel(pos)\n optimalTicks.push({ v: formatDate(timestamp, 'MM-DD', timezone), x })\n }\n }\n return optimalTicks\n }\n\n convertFromPixel (pixel) {\n const dataSpace = this._chartData.dataSpace()\n const range = Math.ceil(pixel / dataSpace)\n let dataPos = this._chartData.from() + range - 1\n const to = this._chartData.to()\n if (dataPos > to - 1) {\n dataPos = to - 1\n }\n return dataPos\n }\n\n convertToPixel (value) {\n const dataSpace = this._chartData.dataSpace()\n return Math.round((value - this._chartData.from()) * dataSpace + this._chartData.barSpace() / 2)\n }\n}\n","import Series from './Series'\nimport XAxisWidget from '../widget/XAxisWidget'\nimport XAxis from '../component/XAxis'\n\nexport default class XAxisSeries extends Series {\n _initBefore () {\n this._xAxis = new XAxis(this._chartData)\n }\n\n _createMainWidget (container, props) {\n return new XAxisWidget({ container, chartData: props.chartData, xAxis: this._xAxis })\n }\n\n _computeAxis () {\n this._xAxis.computeAxis()\n }\n\n xAxis () {\n return this._xAxis\n }\n\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._xAxis.setSize(mainWidgetSize.width, mainWidgetSize.height)\n this._computeAxis()\n super.setSize(mainWidgetSize, yAxisWidgetSize)\n }\n}\n","import EventBase from '../event/EventBase'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class SeparatorSeries {\n constructor (container, chartData, seriesIndex, dragEventHandler) {\n this._chartData = chartData\n this._seriesIndex = seriesIndex\n this._width = 0\n this._offsetLeft = 0\n this._dragEventHandler = dragEventHandler\n this._initElement(container)\n }\n\n _initElement (container) {\n this._container = container\n this._wrapper = document.createElement('div')\n this._wrapper.style.margin = '0'\n this._wrapper.style.padding = '0'\n this._wrapper.style.position = 'relative'\n this._wrapper.style.overflow = 'hidden'\n this._wrapper.style.zIndex = '10'\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.cursor = 'ns-resize'\n this._element.style.height = '6px'\n this._wrapper.appendChild(this._element)\n const lastElement = container.lastChild\n if (lastElement) {\n container.insertBefore(this._wrapper, lastElement)\n } else {\n container.appendChild(this._wrapper)\n }\n this._dragEvent = new EventBase(this._element, {\n mouseDownEvent: this._mouseDownEvent.bind(this),\n pressedMouseMoveEvent: this._pressedMouseMoveEvent.bind(this)\n }, {\n treatVertTouchDragAsPageScroll: false,\n treatHorzTouchDragAsPageScroll: true\n })\n }\n\n _mouseDownEvent (event) {\n this._startY = event.pageY\n this._dragEventHandler.startDrag(this._seriesIndex)\n }\n\n _pressedMouseMoveEvent (event) {\n const dragDistance = event.pageY - this._startY\n this._dragEventHandler.drag(dragDistance, this._seriesIndex)\n }\n\n /**\n * 获取高度\n * @returns {number}\n */\n height () {\n return this._wrapper.offsetHeight\n }\n\n /**\n * 设置尺寸\n * 用于fill属性\n * @param offsetLeft\n * @param width\n */\n setSize (offsetLeft, width) {\n this._offsetLeft = offsetLeft\n this._width = width\n this.invalidate()\n }\n\n /**\n * 更新上下两个图表的索引\n * @param seriesIndex\n */\n updateSeriesIndex (seriesIndex) {\n this._seriesIndex = seriesIndex\n }\n\n /**\n * 刷新\n */\n invalidate () {\n const separator = this._chartData.styleOptions().separator\n this._wrapper.style.backgroundColor = separator.color\n this._wrapper.style.height = `${separator.size}px`\n this._wrapper.style.marginLeft = `${separator.fill ? 0 : this._offsetLeft}px`\n this._wrapper.style.width = separator.fill ? '100%' : `${this._width}px`\n }\n\n /**\n * 将图形转换成图片\n * @returns {HTMLCanvasElement}\n */\n getImage () {\n const separator = this._chartData.styleOptions().separator\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._wrapper.offsetWidth\n const height = separator.size\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n ctx.fillStyle = separator.color\n ctx.fillRect(this._offsetLeft, 0, width, height)\n return canvas\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._dragEvent.destroy()\n this._container.removeChild(this._wrapper)\n delete this\n }\n}\n","import EventHandler, { isMouse, isTouch } from './EventHandler'\n\nexport default class ZoomDragEventHandler extends EventHandler {\n constructor (chartData) {\n super(chartData)\n // 开始拖动时坐标点\n this._startDragPoint = {}\n // 开始触摸时坐标\n this._touchPoint = {}\n // 是否是取消了十字光标\n this._touchCancelCrossHair = false\n // 是否缩放过\n this._touchZoomed = false\n // 用来记录捏合缩放的尺寸\n this._pinchScale = 1\n }\n\n pinchStartEvent () {\n this._pinchScale = 1\n this._touchZoomed = true\n }\n\n pinchEvent (middlePoint, scale) {\n const zoomScale = (scale - this._pinchScale) * 5\n this._pinchScale = scale\n this._chartData.zoom(zoomScale)\n }\n\n mouseLeaveEvent (event) {\n if (isMouse(event)) {\n this._chartData.setCrossHairSeriesTag(null)\n }\n }\n\n mouseMoveEvent (event) {\n if (!isMouse(event)) {\n return\n }\n if (!this._checkEventPointX(event.localX)) {\n this._chartData.setCrossHairSeriesTag(null)\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n this._chartData.setCrossHairSeriesTag(null)\n return\n }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n\n mouseWheelEvent (event) {\n if (!this._checkEventPointX(event.localX)) {\n return\n }\n let deltaY = -(event.deltaY / 100)\n if (deltaY === 0) {\n return\n }\n if (event.cancelable) {\n event.preventDefault()\n }\n\n switch (event.deltaMode) {\n case event.DOM_DELTA_PAGE:\n deltaY *= 120\n break\n\n case event.DOM_DELTA_LINE:\n deltaY *= 32\n break\n }\n\n if (deltaY !== 0) {\n const zoomScale = Math.sign(deltaY) * Math.min(1, Math.abs(deltaY))\n this._chartData.zoom(zoomScale)\n }\n }\n\n mouseClickEvent (event) {\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n if (!this._touchPoint && !this._touchCancelCrossHair && !this._touchZoomed) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n }\n\n mouseDownEvent (event) {\n this._startDragPoint = { x: event.localX, y: event.localY }\n this._chartData.startDrag()\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n const crossHairPoint = { x: event.localX, y: real.y }\n this._touchZoomed = false\n if (this._touchPoint) {\n const xDif = event.localX - this._touchPoint.x\n const yDif = event.localY - this._touchPoint.y\n const radius = Math.sqrt(xDif * xDif + yDif * yDif)\n if (radius < 10) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(real.tag)\n } else {\n this._touchCancelCrossHair = true\n this._touchPoint = null\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(null)\n }\n } else {\n this._touchCancelCrossHair = false\n }\n }\n\n pressedMouseMoveEvent (event) {\n if (!this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n const crossHairPoint = { x: event.localX, y: real.y }\n if (isTouch(event)) {\n if (this._touchPoint) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(real.tag)\n return\n }\n }\n const distance = event.localX - this._startDragPoint.x\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.drag(distance)\n }\n\n longTapEvent (event) {\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n\n /**\n * 将事件的y点转换成十字光标点的y\n * @param y\n * @returns {{}|null}\n * @private\n */\n _translateCrossHairRealY (y) {\n const tags = this._seriesSize.tags || {}\n for (const tag in tags) {\n const size = tags[tag]\n if (y > size.contentTop && y < size.contentBottom) {\n return { tag, y: y - size.contentTop }\n }\n }\n return null\n }\n}\n","import EventHandler from './EventHandler'\n\nexport default class KeyBoardEventHandler extends EventHandler {\n /**\n * 键盘事件\n * @param event\n */\n keyBoardDownEvent (event) {\n if (event.shiftKey) {\n switch (event.code) {\n case 'ArrowUp': {\n this._chartData.zoom(-0.05)\n break\n }\n case 'ArrowDown': {\n this._chartData.zoom(0.05)\n break\n }\n case 'ArrowLeft': {\n this._chartData.startDrag()\n this._chartData.drag(-this._chartData.dataSpace())\n break\n }\n case 'ArrowRight': {\n this._chartData.startDrag()\n this._chartData.drag(this._chartData.dataSpace())\n break\n }\n default: {\n break\n }\n }\n }\n }\n}\n","import EventBase from './EventBase'\nimport ZoomDragEventHandler from './ZoomDragEventHandler'\nimport GraphicMarkEventHandler from './GraphicMarkEventHandler'\nimport { GraphicMarkType } from '../data/ChartData'\nimport KeyBoardEventHandler from './KeyBoardEventHandler'\n\nexport default class ChartEvent {\n constructor (target, chartData, xAxis, yAxis) {\n this._target = target\n this._chartData = chartData\n this._seriesSize = {}\n this._event = new EventBase(this._target, {\n pinchStartEvent: this._pinchStartEvent.bind(this),\n pinchEvent: this._pinchEvent.bind(this),\n mouseUpEvent: this._mouseUpEvent.bind(this),\n mouseClickEvent: this._mouseClickEvent.bind(this),\n mouseDownEvent: this._mouseDownEvent.bind(this),\n mouseRightDownEvent: this._mouseRightDownEvent.bind(this),\n mouseLeaveEvent: this._mouseLeaveEvent.bind(this),\n mouseMoveEvent: this._mouseMoveEvent.bind(this),\n mouseWheelEvent: this._mouseWheelEvent.bind(this),\n pressedMouseMoveEvent: this._pressedMouseMoveEvent.bind(this),\n longTapEvent: this._longTapEvent.bind(this)\n }, {\n treatVertTouchDragAsPageScroll: false,\n treatHorzTouchDragAsPageScroll: false\n })\n this._boundKeyBoardDownEvent = this._keyBoardDownEvent.bind(this)\n this._target.addEventListener('keydown', this._boundKeyBoardDownEvent)\n this._boundContextMenuEvent = (e) => { e.preventDefault() }\n this._target.addEventListener('contextmenu', this._boundContextMenuEvent, false)\n this._zoomDragEventHandler = new ZoomDragEventHandler(chartData)\n this._graphicMarkEventHandler = new GraphicMarkEventHandler(chartData, xAxis, yAxis)\n this._keyBoardEventHandler = new KeyBoardEventHandler(chartData)\n }\n\n _keyBoardDownEvent (event) {\n this._keyBoardEventHandler.keyBoardDownEvent(event)\n }\n\n _pinchStartEvent () {\n this._zoomDragEventHandler.pinchStartEvent()\n }\n\n _pinchEvent (middlePoint, scale) {\n this._zoomDragEventHandler.pinchEvent(middlePoint, scale)\n }\n\n _mouseUpEvent (event) {\n this._graphicMarkEventHandler.mouseUpEvent(event)\n }\n\n _mouseLeaveEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseLeaveEvent(event)\n }\n }\n\n _mouseMoveEvent (event) {\n this._graphicMarkEventHandler.mouseMoveEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseMoveEvent(event)\n }\n }\n\n _mouseWheelEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseWheelEvent(event)\n }\n }\n\n _mouseClickEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseClickEvent(event)\n }\n }\n\n _mouseDownEvent (event) {\n this._graphicMarkEventHandler.mouseDownEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseDownEvent(event)\n }\n }\n\n _mouseRightDownEvent (event) {\n this._graphicMarkEventHandler.mouseRightDownEvent(event)\n }\n\n _pressedMouseMoveEvent (event) {\n if (this._chartData.dragGraphicMarkFlag()) {\n this._graphicMarkEventHandler.pressedMouseMoveEvent(event)\n // 这里判断一下,如果是在拖拽图形标记,让十字光标不显示\n if (this._chartData.crossHairSeriesTag() !== null) {\n this._chartData.setCrossHairSeriesTag(null)\n }\n }\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.pressedMouseMoveEvent(event)\n }\n }\n\n _longTapEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.longTapEvent(event)\n }\n }\n\n _checkZoomDrag () {\n return !this._chartData.dragGraphicMarkFlag() && this._chartData.graphicMarkType() === GraphicMarkType.NONE\n }\n\n setSeriesSize (seriesSize) {\n this._zoomDragEventHandler.setSeriesSize(seriesSize)\n this._graphicMarkEventHandler.setSeriesSize(seriesSize)\n }\n\n destroy () {\n this._event.destroy()\n this._target.removeEventListener('keydown', this._boundKeyBoardDownEvent)\n this._target.removeEventListener('contextmenu', this._boundContextMenuEvent)\n }\n}\n","import ChartData, { InvalidateLevel } from '../data/ChartData'\nimport CandleStickSeries from './CandleStickSeries'\nimport XAxisSeries from './XAxisSeries'\n\nimport { ChartType, YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\nimport { isArray, isObject } from '../utils/typeChecks'\nimport { formatValue } from '../utils/format'\nimport TechnicalIndicatorSeries from './TechnicalIndicatorSeries'\nimport SeparatorSeries from './SeparatorSeries'\n\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport ChartEvent from '../event/ChartEvent'\nimport { getPixelRatio } from '../utils/canvas'\n\nconst DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT = 100\n\nconst TECHNICAL_INDICATOR_NAME_PREFIX = 'technical_indicator_'\n\nexport const CANDLE_STICK_SERIES_TAG = 'candle_stick_series_tag'\n\nexport default class ChartSeries {\n constructor (container, styleOptions) {\n this._initChartContainer(container)\n this._technicalIndicatorBaseId = 0\n this._technicalIndicatorSeries = []\n this._separatorSeries = []\n this._separatorDragStartTechnicalIndicatorHeight = 0\n this._chartData = new ChartData(styleOptions, this._updateSeries.bind(this))\n this._xAxisSeries = new XAxisSeries({ container: this._chartContainer, chartData: this._chartData })\n this._candleStickSeries = new CandleStickSeries({\n container: this._chartContainer,\n chartData: this._chartData,\n xAxis: this._xAxisSeries.xAxis(),\n technicalIndicatorType: TechnicalIndicatorType.MA,\n tag: CANDLE_STICK_SERIES_TAG\n })\n this._chartEvent = new ChartEvent(\n this._chartContainer, this._chartData,\n this._xAxisSeries.xAxis(),\n this._candleStickSeries.yAxis()\n )\n this.measureSeriesSize()\n }\n\n _initChartContainer (container) {\n this._container = container\n this._chartContainer = document.createElement('div')\n this._chartContainer.style.position = 'relative'\n this._chartContainer.style.outline = 'none'\n this._chartContainer.style.borderStyle = 'none'\n this._chartContainer.style.width = '100%'\n this._chartContainer.style.height = '100%'\n this._chartContainer.tabIndex = 1\n container.appendChild(this._chartContainer)\n }\n\n /**\n * 分割线拖拽开始\n * @param seriesIndex\n * @private\n */\n _separatorStartDrag (seriesIndex) {\n this._separatorDragStartTechnicalIndicatorHeight = this._technicalIndicatorSeries[seriesIndex].height()\n }\n\n /**\n * 分割线拖拽\n * @param dragDistance\n * @param seriesIndex\n * @private\n */\n _separatorDrag (dragDistance, seriesIndex) {\n this._technicalIndicatorSeries[seriesIndex].setTempHeight(this._separatorDragStartTechnicalIndicatorHeight - dragDistance)\n this.measureSeriesSize()\n }\n\n /**\n * 计算x轴的高度\n * @returns {number}\n * @private\n */\n _measureXAxisHeight () {\n const xAxis = this._chartData.styleOptions().xAxis\n const axisLine = xAxis.axisLine\n const tickText = xAxis.tickText\n const tickLine = xAxis.tickLine\n let height = 0\n if (xAxis.display) {\n if (axisLine.display) {\n height += axisLine.size\n }\n if (tickLine.display) {\n height += tickLine.length\n }\n if (tickText.display) {\n height += (tickText.size + tickText.margin)\n }\n }\n if (height > 0) {\n height = Math.ceil(Math.max(xAxis.minHeight, Math.min(height, xAxis.maxHeight)))\n }\n return height\n }\n\n /**\n * 计算y轴宽度\n * @returns {number}\n * @private\n */\n _measureYAxisWidth () {\n const yAxis = this._chartData.styleOptions().yAxis\n const axisLine = yAxis.axisLine\n const tickText = yAxis.tickText\n const tickLine = yAxis.tickLine\n let width = 0\n if (yAxis.display) {\n if (yAxis.axisLine.display) {\n width += axisLine.size\n }\n if (yAxis.tickLine.display) {\n width += tickLine.length\n }\n if (yAxis.tickText.display) {\n width += (tickText.margin + (tickText.size - 2) * 6)\n }\n }\n if (width > 0) {\n width = Math.ceil(Math.max(yAxis.minWidth, Math.min(width, yAxis.maxWidth)))\n }\n return width\n }\n\n /**\n * 测量图表间分割线的高度\n * @returns {number}\n * @private\n */\n _measureSeparatorHeight () {\n const separator = this._chartData.styleOptions().separator\n return separator.size * this._separatorSeries.length\n }\n\n /**\n * 更新所有series\n * @private\n */\n _updateSeries (invalidateLevel = InvalidateLevel.FULL) {\n if (invalidateLevel !== InvalidateLevel.GRAPHIC_MARK) {\n this._xAxisSeries.invalidate(invalidateLevel)\n this._candleStickSeries.invalidate(invalidateLevel)\n for (const series of this._technicalIndicatorSeries) {\n series.invalidate(invalidateLevel)\n }\n }\n this._candleStickSeries.invalidate(invalidateLevel)\n }\n\n /**\n * 计算所有series的指标\n * @private\n */\n _calcAllSeriesTechnicalIndicator () {\n const technicalIndicatorTypeArray = []\n if (this._candleStickSeries.chartType() === ChartType.CANDLE_STICK) {\n technicalIndicatorTypeArray.push(this._candleStickSeries.technicalIndicatorType())\n } else {\n this._chartData.calcTechnicalIndicator(TechnicalIndicatorType.AVERAGE)\n }\n for (const series of this._technicalIndicatorSeries) {\n const technicalIndicatorSeriesTechnicalIndicatorType = series.technicalIndicatorType()\n if (technicalIndicatorTypeArray.indexOf(technicalIndicatorSeriesTechnicalIndicatorType) < 0) {\n technicalIndicatorTypeArray.push(technicalIndicatorSeriesTechnicalIndicatorType)\n }\n }\n for (const technicalIndicatorType of technicalIndicatorTypeArray) {\n this._chartData.calcTechnicalIndicator(technicalIndicatorType)\n }\n this._updateSeries()\n }\n\n /**\n * 获取图表上的数据\n * @returns {ChartData}\n */\n chartData () {\n return this._chartData\n }\n\n /**\n * 测量尺寸\n * @private\n */\n measureSeriesSize () {\n const yAxis = this._chartData.styleOptions().yAxis\n const isYAxisLeft = yAxis.position === YAxisPosition.LEFT\n const isYAxisTextOutsize = yAxis.tickText.position === YAxisTextPosition.OUTSIDE\n const seriesWidth = this._chartContainer.offsetWidth\n const seriesHeight = this._chartContainer.offsetHeight\n const separatorHeight = this._measureSeparatorHeight()\n const xAxisHeight = this._measureXAxisHeight()\n const yAxisWidth = this._measureYAxisWidth()\n const seriesExcludeXAxisSeparatorHeight = seriesHeight - xAxisHeight - separatorHeight\n const mainWidthWidth = seriesWidth - (isYAxisTextOutsize ? yAxisWidth : 0)\n let yAxisOffsetLeft = seriesWidth - yAxisWidth\n let mainOffsetLeft = 0\n if (isYAxisLeft) {\n yAxisOffsetLeft = 0\n if (isYAxisTextOutsize) {\n mainOffsetLeft = yAxisWidth\n }\n }\n let technicalIndicatorSeriesTotalHeight = 0\n for (const series of this._technicalIndicatorSeries) {\n technicalIndicatorSeriesTotalHeight += series.height()\n }\n\n const candleStickSeriesHeight = seriesExcludeXAxisSeparatorHeight - technicalIndicatorSeriesTotalHeight\n\n this._chartData.setTotalDataSpace(mainWidthWidth)\n const seriesSize = {}\n seriesSize.contentLeft = mainOffsetLeft\n seriesSize.contentRight = mainOffsetLeft + mainWidthWidth\n const tags = {}\n tags[CANDLE_STICK_SERIES_TAG] = { contentTop: 0, contentBottom: candleStickSeriesHeight }\n let contentTop = candleStickSeriesHeight\n let contentBottom = candleStickSeriesHeight\n this._candleStickSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: candleStickSeriesHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: candleStickSeriesHeight }\n )\n\n for (let i = 0; i < this._technicalIndicatorSeries.length; i++) {\n const technicalIndicatorSeries = this._technicalIndicatorSeries[i]\n const separatorSeries = this._separatorSeries[i]\n const technicalIndicatorSeriesHeight = technicalIndicatorSeries.height()\n technicalIndicatorSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: technicalIndicatorSeriesHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: technicalIndicatorSeriesHeight }\n )\n separatorSeries.setSize(mainOffsetLeft, mainWidthWidth)\n contentBottom += technicalIndicatorSeriesHeight\n tags[technicalIndicatorSeries.tag()] = { contentTop, contentBottom }\n contentTop = contentBottom\n }\n seriesSize.tags = tags\n this._xAxisSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: xAxisHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: xAxisHeight }\n )\n this._chartEvent.setSeriesSize(seriesSize)\n }\n\n /**\n * 加载样式配置\n * @param styleOptions\n */\n applyStyleOptions (styleOptions) {\n this._chartData.applyStyleOptions(styleOptions)\n this.measureSeriesSize()\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n applyTechnicalIndicatorParams (technicalIndicatorType, params) {\n this._chartData.applyTechnicalIndicatorParams(technicalIndicatorType, params)\n if (this._chartData.calcTechnicalIndicator(technicalIndicatorType)) {\n const candleStickSeriesTechnicalIndicatorType = this._candleStickSeries.technicalIndicatorType()\n if (candleStickSeriesTechnicalIndicatorType === technicalIndicatorType) {\n this._candleStickSeries.invalidate(InvalidateLevel.FULL)\n }\n for (const series of this._technicalIndicatorSeries) {\n const seriesTechnicalIndicatorType = series.technicalIndicatorType()\n if (seriesTechnicalIndicatorType === technicalIndicatorType) {\n series.invalidate(InvalidateLevel.FULL)\n }\n }\n }\n }\n\n /**\n * 添加新数据\n * @param dataList\n * @param more\n */\n applyNewData (dataList, more) {\n if (isArray(dataList)) {\n this._chartData.clearDataList()\n this._chartData.addData(dataList, 0, more)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 添加更多数据\n * @param dataList\n * @param more\n */\n applyMoreData (dataList, more) {\n if (isArray(dataList)) {\n this._chartData.addData(dataList, 0, more)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 更新数据\n * @param data\n */\n updateData (data) {\n if (isObject(data) && !isArray(data)) {\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n // 这里判断单个数据应该添加到哪个位置\n const timestamp = +formatValue(data, 'timestamp', 0)\n const lastDataTimestamp = +formatValue(dataList[dataSize - 1], 'timestamp', 0)\n let pos = dataSize\n if (timestamp === lastDataTimestamp) {\n pos = dataSize - 1\n }\n this._chartData.addData(data, pos)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 设置蜡烛图图表类型\n * @param type\n */\n setCandleStickSeriesType (type) {\n this._candleStickSeries.setChartType(type)\n }\n\n /**\n * 创建一个指标\n * @param technicalIndicatorType\n * @param height\n * @returns {string}\n */\n createTechnicalIndicator (technicalIndicatorType, height = DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT) {\n const technicalIndicatorSeriesCount = this._technicalIndicatorSeries.length\n this._separatorSeries.push(\n new SeparatorSeries(\n this._chartContainer, this._chartData,\n technicalIndicatorSeriesCount, {\n startDrag: this._separatorStartDrag.bind(this),\n drag: this._separatorDrag.bind(this)\n }\n )\n )\n this._technicalIndicatorBaseId++\n const tag = `${TECHNICAL_INDICATOR_NAME_PREFIX}${this._technicalIndicatorBaseId}`\n const technicalIndicatorSeries = new TechnicalIndicatorSeries({\n container: this._chartContainer,\n chartData: this._chartData,\n xAxis: this._xAxisSeries.xAxis(),\n technicalIndicatorType,\n tag\n })\n technicalIndicatorSeries.setTempHeight(height)\n this._technicalIndicatorSeries.push(technicalIndicatorSeries)\n this.measureSeriesSize()\n return tag\n }\n\n /**\n * 移除一个指标\n * @param tag\n */\n removeTechnicalIndicator (tag) {\n let seriesPos = -1\n for (let i = 0; i < this._technicalIndicatorSeries.length; i++) {\n const series = this._technicalIndicatorSeries[i]\n if (series.tag() === tag) {\n seriesPos = i\n break\n }\n }\n if (seriesPos !== -1) {\n this._technicalIndicatorSeries[seriesPos].destroy()\n this._separatorSeries[seriesPos].destroy()\n delete this._technicalIndicatorSeries[seriesPos]\n delete this._separatorSeries[seriesPos]\n for (let i = 0; i < this._separatorSeries.length; i++) {\n this._separatorSeries[i].updateSeriesIndex(i)\n }\n this.measureSeriesSize()\n }\n }\n\n /**\n * 设置指标类型\n * @param tag\n * @param technicalIndicatorType\n */\n setTechnicalIndicatorType (tag, technicalIndicatorType) {\n if (tag === CANDLE_STICK_SERIES_TAG) {\n this._candleStickSeries.setTechnicalIndicatorType(technicalIndicatorType)\n } else {\n let s\n for (const series of this._technicalIndicatorSeries) {\n if (series.tag() === tag) {\n s = series\n break\n }\n }\n if (s) {\n if (technicalIndicatorType === TechnicalIndicatorType.NO) {\n this.removeTechnicalIndicator(tag)\n } else {\n s.setTechnicalIndicatorType(technicalIndicatorType)\n }\n }\n }\n }\n\n /**\n * 获取图表转换为图片后url\n * @param includeFloatLayer,\n * @param includeGraphicMark\n * @param type\n */\n getConvertPictureUrl (includeFloatLayer, includeGraphicMark, type = 'jpeg') {\n if (type !== 'png' && type !== 'jpeg' && type !== 'bmp') {\n throw new Error('Picture format only supports jpeg, png and bmp!!!')\n }\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._chartContainer.offsetWidth\n const height = this._chartContainer.offsetHeight\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n let offsetTop = 0\n const candleStickSeriesHeight = this._candleStickSeries.height()\n ctx.drawImage(\n this._candleStickSeries.getImage(includeFloatLayer, includeGraphicMark),\n 0, offsetTop, width, candleStickSeriesHeight\n )\n ctx.drawImage(\n this._candleStickSeries.getImage(includeFloatLayer, includeGraphicMark),\n 0, offsetTop, width, candleStickSeriesHeight\n )\n offsetTop += candleStickSeriesHeight\n for (let i = 0; i < this._separatorSeries.length; i++) {\n const separatorSeries = this._separatorSeries[i]\n const separatorSeriesHeight = separatorSeries.height()\n const technicalIndicatorSeries = this._technicalIndicatorSeries[i]\n const technicalIndicatorSeriesHeight = technicalIndicatorSeries.height()\n ctx.drawImage(\n separatorSeries.getImage(),\n 0, offsetTop, width, separatorSeriesHeight\n )\n offsetTop += separatorSeriesHeight\n ctx.drawImage(\n technicalIndicatorSeries.getImage(includeFloatLayer),\n 0, offsetTop, width, technicalIndicatorSeriesHeight\n )\n offsetTop += technicalIndicatorSeriesHeight\n }\n\n ctx.drawImage(\n this._xAxisSeries.getImage(includeFloatLayer),\n 0, offsetTop, width, this._xAxisSeries.height()\n )\n return canvas.toDataURL(`image/${type}`)\n }\n\n destroy () {\n this._candleStickSeries.destroy()\n this._technicalIndicatorSeries.forEach(series => {\n series.destroy()\n })\n this._separatorSeries.forEach(series => {\n series.destroy()\n })\n this._xAxisSeries.destroy()\n this._container.removeChild(this._chartContainer)\n this._chartEvent.destroy()\n delete this\n }\n}\n","import ChartSeries, { CANDLE_STICK_SERIES_TAG } from './series/ChartSeries'\nimport { isArray } from './utils/typeChecks'\nimport { GraphicMarkType } from './data/ChartData'\n\nexport default class Chart {\n constructor (container, styleOptions) {\n this._chartSeries = new ChartSeries(container, styleOptions)\n }\n\n /**\n * 设置样式配置\n * @param options\n */\n setStyleOptions (options) {\n this._chartSeries.applyStyleOptions(options)\n }\n\n /**\n * 获取样式配置\n * @returns {[]|*[]}\n */\n getStyleOptions () {\n return this._chartSeries.chartData().styleOptions()\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n setTechnicalIndicatorParams (technicalIndicatorType, params) {\n this._chartSeries.applyTechnicalIndicatorParams(technicalIndicatorType, params)\n }\n\n /**\n * 获取技术指标参数配置\n */\n getTechnicalIndicatorParamOptions () {\n this._chartSeries.chartData().technicalIndicatorParamOptions()\n }\n\n /**\n * 加载精度\n * @param pricePrecision\n * @param volumePrecision\n */\n setPrecision (pricePrecision, volumePrecision) {\n this._chartSeries.chartData().applyPrecision(pricePrecision, volumePrecision)\n }\n\n /**\n * 设置时区\n * @param timezone\n */\n setTimezone (timezone) {\n this._chartSeries.chartData().setTimezone(timezone)\n }\n\n /**\n * 重置尺寸,总是会填充父容器\n */\n resize () {\n this._chartSeries.chartData().adjustFromTo()\n this._chartSeries.measureSeriesSize()\n }\n\n /**\n * 设置右边间距\n * @param space\n */\n setOffsetRightSpace (space) {\n this._chartSeries.chartData().setOffsetRightSpace(space)\n }\n\n /**\n * 设置一条数据的空间\n * @param space\n */\n setDataSpace (space) {\n this._chartSeries.chartData().setDataSpace(space)\n }\n\n /**\n * 清空数据\n */\n clearData () {\n this._chartSeries.chartData().clearDataList()\n }\n\n /**\n * 获取数据源\n */\n getDataList () {\n return this._chartSeries.chartData().dataList()\n }\n\n /**\n * 添加新数据\n * @param dataList\n * @param more\n */\n applyNewData (dataList, more) {\n this._chartSeries.applyNewData(dataList, more)\n }\n\n /**\n * 添加历史更多数据\n * @param dataList\n * @param more\n */\n applyMoreData (dataList, more) {\n this._chartSeries.applyMoreData(dataList, more)\n }\n\n /**\n * 更新数据\n * @param data\n */\n updateData (data) {\n this._chartSeries.updateData(data)\n }\n\n /**\n * 设置加载更多回调\n * @param cb\n */\n loadMore (cb) {\n this._chartSeries.chartData().loadMore(cb)\n }\n\n /**\n * 设置蜡烛图表类型\n * @param type\n */\n setCandleStickChartType (type) {\n this._chartSeries.setCandleStickSeriesType(type)\n }\n\n /**\n * 设置蜡烛图技术指标类型\n * @param technicalIndicatorType\n */\n setCandleStickTechnicalIndicatorType (technicalIndicatorType) {\n this._chartSeries.setTechnicalIndicatorType(CANDLE_STICK_SERIES_TAG, technicalIndicatorType)\n }\n\n /**\n * 设置技术指标类型\n * @param tag\n * @param technicalIndicatorType\n */\n setTechnicalIndicatorType (tag, technicalIndicatorType) {\n this._chartSeries.setTechnicalIndicatorType(tag, technicalIndicatorType)\n }\n\n /**\n * 添加一个技术指标\n * @param technicalIndicatorType\n * @param height\n * @returns {string}\n */\n addTechnicalIndicator (technicalIndicatorType, height) {\n return this._chartSeries.createTechnicalIndicator(technicalIndicatorType, height)\n }\n\n /**\n * 移除一个技术指标\n * @param tag\n */\n removeTechnicalIndicator (tag) {\n this._chartSeries.removeTechnicalIndicator(tag)\n }\n\n /**\n * 添加图形标记\n * @param type\n */\n addGraphicMark (type) {\n const graphicMarkType = this._chartSeries.chartData().graphicMarkType()\n if (graphicMarkType !== type) {\n const graphicMarkDatas = this._chartSeries.chartData().graphicMarkData()\n const graphicMarkData = graphicMarkDatas[graphicMarkType]\n if (graphicMarkData && isArray(graphicMarkData)) {\n graphicMarkData.splice(graphicMarkData.length - 1, 1)\n graphicMarkDatas[graphicMarkType] = graphicMarkData\n }\n if (!graphicMarkDatas.hasOwnProperty(type)) {\n type = GraphicMarkType.NONE\n }\n this._chartSeries.chartData().setGraphicMarkType(type)\n this._chartSeries.chartData().setGraphicMarkData(graphicMarkDatas)\n }\n }\n\n /**\n * 移除所有标记图形\n */\n removeAllGraphicMark () {\n const graphicMarkDatas = this._chartSeries.chartData().graphicMarkData()\n const newGraphicMarkDatas = {}\n Object.keys(graphicMarkDatas).forEach(key => {\n newGraphicMarkDatas[key] = []\n })\n this._chartSeries.chartData().setGraphicMarkType(GraphicMarkType.NONE)\n this._chartSeries.chartData().setGraphicMarkData(newGraphicMarkDatas)\n }\n\n /**\n * 获取将图表装换成图片后的url\n * @param includeFloatLayer\n * @param includeGraphicMark\n * @param type\n */\n getConvertPictureUrl (includeFloatLayer, includeGraphicMark, type) {\n return this._chartSeries.getConvertPictureUrl(includeFloatLayer, includeGraphicMark, type)\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._chartSeries.destroy()\n delete this\n }\n}\n","import Chart from './Chart'\nimport { DEV } from './utils/env'\n\nconst instances = {}\nlet idBase = 1\n\nconst errorMessage = 'Chart version is K_LINE_VERSION. Root dom is null, can not initialize the chart!!!'\n\n/**\n * 获取版本号\n * @returns {string}\n */\nfunction version () {\n return 'K_LINE_VERSION'\n}\n\n/**\n * 初始化\n * @param ds\n * @param style\n * @returns {Chart}\n */\nfunction init (ds, style = {}) {\n let container = ds\n if (!container) {\n throw new Error(errorMessage)\n }\n if (typeof container === 'string') {\n container = document.getElementById(ds) || document.getElementsByClassName(ds)\n }\n if (!container) {\n throw new Error(errorMessage)\n }\n const instance = instances[container.chart_id || '']\n if (instance) {\n if (DEV) {\n console.warn('The chart has been initialized on the dom!!!')\n }\n return instance\n }\n const id = `k_line_chart_${idBase++}`\n const chart = new Chart(container, style)\n chart.id = id\n container.chart_id = id\n instances[id] = chart\n return chart\n}\n\n/**\n * 销毁\n * @param dcs\n */\nfunction dispose (dcs) {\n if (dcs) {\n let id\n if (typeof dcs === 'string') {\n dcs = document.getElementById(dcs) || document.getElementsByClassName(dcs)\n id = dcs.chart_id\n }\n if (!id) {\n id = dcs.chart_id\n }\n if (!id && dcs instanceof Chart) {\n id = dcs.id\n }\n if (id) {\n instances[id].destroy()\n delete instances[id]\n }\n }\n}\n\nexport { version, init, dispose }\n"],"names":["merge","target","source","isObject","key","hasOwnProperty","targetProp","sourceProp","isArray","clone","copy","p","v","value","Object","prototype","toString","call","isFunction","type","isNumber","isNaN","isBoolean","LineStyle","DASH","SOLID","YAxisPosition","LEFT","RIGHT","YAxisTextPosition","INSIDE","OUTSIDE","ChartType","REAL_TIME","CANDLE_STICK","CandleStickStyle","STROKE","UP_STROKE","DOWN_STROKE","OHLC","FloatLayerPromptDisplayRule","ALWAYS","FOLLOW_CROSS","NONE","FloatLayerPromptCandleStickTextDisplayType","RECT","STANDARD","defaultGrid","display","horizontal","size","color","style","dashValue","vertical","defaultCandleStick","bar","upColor","downColor","noChangeColor","priceMark","high","textMargin","textSize","low","last","line","text","paddingLeft","paddingTop","paddingRight","paddingBottom","defaultRealTime","timeLine","areaFillColor","averageLine","defaultTechnicalIndicator","colors","defaultXAxis","maxHeight","minHeight","axisLine","tickText","margin","tickLine","length","defaultYAxis","maxWidth","minWidth","position","defaultFloatLayer","crossHair","borderSize","borderColor","backgroundColor","prompt","displayRule","candleStick","showType","labels","values","rect","left","top","right","borderRadius","fillColor","marginLeft","marginTop","marginRight","marginBottom","technicalIndicator","defaultGraphicMark","point","radius","activeBackgroundColor","activeBorderColor","activeBorderSize","activeRadius","defaultSeparator","fill","defaultStyleOptions","grid","realTime","xAxis","yAxis","separator","floatLayer","graphicMark","TechnicalIndicatorType","NO","AVERAGE","MA","VOL","MACD","BOLL","KDJ","RSI","BIAS","BRAR","CCI","DMI","CR","PSY","DMA","TRIX","OBV","VR","WR","MTM","EMV","SAR","defaultTechnicalIndicatorParamOptions","defaultPrecisionOptions","price","volume","calcIndicator","dataList","totalTurnover","totalVolume","calc","i","turnover","average","params","checkParams","closeSums","paramsLength","ma","close","j","volumeSums","num","vol","checkParamsWithSize","emaShort","emaLong","oldEmaShort","oldEmaLong","diff","dea","oldDea","macd","closePrice","closeSum","md","up","dn","getBollMd","slice","boll","mid","k","d","ln","hn","cn","getLow","getHigh","rsv","kdj","sumCloseA1","sumCloseB1","sumCloseA2","sumCloseB2","sumCloseA3","sumCloseB3","a1","b1","a2","b2","a3","b3","rsi","tmp","absTmp","Math","abs","agoTmp","mean1","mean2","mean3","closes1","closes2","closes3","bias","br","ar","hcy","cyl","ho","ol","open","refClose","agoHigh","agoLow","agoOpen","agoRefClose","brar","closes","closeMa","closeMaList","maCloseSum","cci","tp","push","agoClosePrice","pdi","mdi","adx","adxr","trList","trSum","dmpList","dmpSum","dmmList","dmmSum","dxList","dxSum","highPrice","lowPrice","hl","lcy","hhy","lyl","tr","max","h","l","dx","agoAdx","dmi","cr","ma1","ma2","ma3","ma4","p1","p2","ma1Sum","ma1Mean","ma1List","ma2Sum","ma2Mean","ma2List","ma3Sum","ma3Mean","ma3List","ma4Sum","ma4Mean","ma4List","preHighestPrice","preLowestPrice","preClosePrice","preOpenPrice","preMidPrice","highestPrice","lowestPrice","highSubPreMid","preMidSubLow","firstHighestPrice","firstLowestPrice","firstClosePrice","firstOpenPrice","firstMidPrice","secondHighestPrice","secondLowestPrice","secondHighSubFirstMid","firstMidSubSecondLow","YM","HYM","LYM","psy","upDay","dif","difMa","difSum","dma","trix","maTrix","sumTrix","emaClose1","oldEmaClose1","emaClose2","oldEmaClose2","emaClose3","oldEmaClose3","emaClose3List","refEmaClose3","obv","sumObv","maObv","sumVa","refClosePrice","va","avs","bvs","cvs","vr","maVr","sumVr","openPrice","agoOpenPrice","agoVolume","wr1","wr2","wr3","h1","Number","MIN_SAFE_INTEGER","l1","MAX_SAFE_INTEGER","h2","l2","h3","l3","hl1","hl2","hl3","min","highLowPriceArray","getHighLow","wr","mtm","mtmSum","mtmMa","emv","maEmv","sumEmv","em","emList","highSubLow","halfHighAddLow","preHalfHighAddLow","startAf","step","maxAf","af","ep","isIncreasing","sar","preSar","lowestPriceMin","highestPriceMax","dataSize","list","sum","b","sqrt","paramsSize","formatValue","data","defaultValue","locales","formatDate","timestamp","format","timezone","date","Date","dateTimeString","Intl","DateTimeFormat","hour12","timeZone","year","month","day","hour","minute","e","dateString","match","dateStringArray","split","timeString","replace","formatPrecision","precision","toFixed","formatBigNumber","InvalidateLevel","FLOAT_LAYER","GRAPHIC_MARK","FULL","GraphicMarkType","HORIZONTAL_STRAIGHT_LINE","VERTICAL_STRAIGHT_LINE","STRAIGHT_LINE","HORIZONTAL_RAY_LINE","VERTICAL_RAY_LINE","RAY_LINE","HORIZONTAL_SEGMENT_LINE","VERTICAL_SEGMENT_LINE","SEGMENT_LINE","PRICE_LINE","PRICE_CHANNEL_LINE","PARALLEL_STRAIGHT_LINE","FIBONACCI_LINE","BAR_MARGIN_SPACE_RATE","MAX_DATA_SPACE","MIN_DATA_SPACE","ChartData","styleOptions","invalidateHandler","_invalidateHandler","_styleOptions","_technicalIndicatorParamOptions","_precisionOptions","_timezone","_dataList","_loading","_loadMoreCallback","_more","_totalDataSpace","_offsetRightSpace","_from","_to","_range","_dataSpace","_barSpace","_calcBarSpace","_crossHairPoint","_crossHairSeriesTag","_preFrom","_graphicMarkType","_graphicMarkPoint","_dragGraphicMarkFlag","_graphicMarkDatas","horizontalStraightLine","verticalStraightLine","straightLine","horizontalRayLine","verticalRayLine","rayLine","horizontalSegmentLine","verticalSegmentLine","segmentLine","priceLine","parallelStraightLine","priceChannelLine","fibonacciLine","floor","adjustFromTo","offsetRightRange","dataSpace","_calcRange","options","technicalIndicatorType","pricePrecision","volumePrecision","calcFun","pos","more","concat","rangeDif","_calcRangDif","oldDataSize","_innerSetDataSpace","totalSpace","space","tag","distance","distanceRange","ceil","_loadMoreHandler","zoomScale","graphicMarkType","flag","datas","callback","getPixelRatio","ctx","backingStore","backingStorePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","window","devicePixelRatio","calcTextWidth","measureText","width","getFont","fontSize","drawHorizontalLine","y","beginPath","correction","lineWidth","moveTo","lineTo","stroke","closePath","drawVerticalLine","x","bottom","strokeInPixel","drawFuc","save","translate","restore","Series","props","_container","container","_chartData","chartData","_width","_height","_initBefore","_initElement","_mainWidget","_createMainWidget","_mainWidgetCell","_yAxisWidget","_createYAxisWidget","_yAxisWidgetCell","_element","document","createElement","padding","overflow","_createCell","appendChild","lastElement","lastChild","insertBefore","cell","zIndex","height","offsetWidth","mainWidgetSize","yAxisWidgetSize","_setCellSize","setSize","level","_computeAxis","invalidate","includeFloatLayer","includeGraphicMark","canvas","getContext","pixelRatio","offsetHeight","scale","mainWidgetWidth","mainWidgetHeight","mainWidgetOffsetLeft","parseInt","yAxisWidgetWidth","yAxisWidgetHeight","yAxisWidgetOffsetLeft","drawImage","getImage","removeChild","Widget","_mainView","_createMainView","_expandView","_createExpandView","_floatLayerView","_createFloatLayerView","flush","requestAnimationFrame","fn","setTimeout","cancelAnimationFrame","id","clearTimeout","View","_initCanvas","_canvas","_ctx","extendFun","clearRect","_draw","_redraw","requestAnimationId","TechnicalIndicatorView","additionalDataProvider","_xAxis","_yAxis","_additionalDataProvider","_drawGrid","_drawTechnicalIndicator","horizontalGrid","strokeStyle","setLineDash","ticks","forEach","tick","verticalGrid","onDrawing","technicalIndicatorParams","technicalIndicatorParamOptions","linePoints","technicalIndicatorOptions","dataKeys","kLineData","halfBarSpace","_ohlcTechnicalIndicatorDrawing","isCandleStickYAxis","_prepareLinePoints","preKLineData","macdValue","preMacdValue","Infinity","fillStyle","isFill","_drawBars","lineValues","preClose","dataY","convertToPixel","arc","PI","_drawGraphics","_drawLines","isCandleStick","prepare","technicalIndicatorData","toLowerCase","_drawOhlc","valueY","pointCount","colorSize","points","barData","zeroY","yDif","barHeight","fillRect","strokeRect","openY","closeY","highY","lowY","onDrawEnd","startX","barSpace","to","from","endX","TechnicalIndicatorFloatLayerView","crossHairPoint","dataPos","convertFromPixel","_drawCrossHairHorizontalLine","_drawCrossHairVerticalLine","crossHairSeriesTag","_drawPrompt","_drawTechnicalIndicatorPrompt","crossHairHorizontal","crossHairHorizontalLine","crossHairVertical","crossHairVerticalLine","offsetTop","_getTechnicalIndicatorPromptData","_drawTechnicalIndicatorPromptText","_drawTechnicalIndicatorPromptPoint","floatLayerPromptTechnicalIndicatorText","nameText","name","textMarginLeft","textMarginRight","labelX","labelY","textColor","textBaseline","font","nameTextWidth","fillText","toUpperCase","textWidth","valueSize","join","indicatorData","label","decimal","precisionOptions","index","TechnicalIndicatorWidget","YAxisView","yAxisOptions","_drawAxisLine","_drawTickLines","_drawTickLabels","_drawLastPriceLabel","_isDrawFromStart","tickLineLength","tickLineDisplay","tickTextMargin","textAlign","lastPriceMark","lastPrice","preLastPrice","priceY","priceMarkText","rectWidth","rectHeight","rectStartX","AxisFloatLayerView","axis","_axis","_drawCrossHairLabel","YAxisFloatLayerView","crossHairHorizontalText","yAxisDataLabel","yAxisDataLabelWidth","rectY","YAxisWidget","Axis","_minValue","_maxValue","_ticks","_computeMinMaxValue","range","_computeOptimalTicks","_computeTicks","interval","_nice","_getIntervalPrecision","first","_round","n","f","exponent","log","exp10","pow","nf","str","eIndex","indexOf","dotIndex","YAxisType","TECHNICAL_INDICATOR","YAxis","yAxisType","_yAxisType","minMaxArray","keys","optimalTicks","tickLength","textHeight","tickCountDif","nextY","isRealTime","isShowAverageLine","minCompareArray","maxCompareArray","apply","_compareMinMax","pixel","round","TechnicalIndicatorSeries","_technicalIndicatorType","_calcTechnicalIndicator","_tag","_createYAxis","bind","calcMinMaxValue","_isRealTime","computeAxis","calcTechnicalIndicator","CandleStickView","chartType","_drawRealTime","_drawCandleStick","_drawHighestPriceMark","_drawLowestPriceMark","_drawLastPriceLine","timeLinePoints","timeLineAreaPoints","averageLinePoints","averageY","areaPointLength","lastPoint","isFit","markHighestPrice","markHighestPriceX","markLowestPrice","markLowestPriceX","highLine","lowLine","_highestMarkData","_lowestMarkData","highestPriceMark","_drawLowestHighestPriceMark","lowestPriceMark","isHigh","startY","priceMarkLine","CandleStickFloatLayerView","floatLayerPromptCandleStick","candleStickPromptData","_getCandleStickPromptData","_drawCandleStickStandardPromptText","_drawCandleStickRectPromptText","labelText","labelWidth","valueText","baseLabels","baseValues","baseTextMarginLeft","baseTextMarginRight","baseTextMarginTop","baseTextMarginBottom","baseTextSize","baseTextColor","maxLabelWidth","rectBorderSize","rectPaddingLeft","rectPaddingRight","rectPaddingTop","rectPaddingBottom","rectLeft","rectRight","technicalIndicatorPromptData","floatLayerPromptTechnicalIndicator","indicatorTextMarginLeft","indicatorTextMarginRight","indicatorTextMarginTop","indicatorTextMarginBottom","indicatorTextSize","indicatorLabels","indicatorValues","centerX","rectX","_drawRoundRect","baseLabelX","indicatorLabelX","w","r","arcTo","getLinearY","point1","point2","targetPoints","subX","checkPointOnStraightLine","targetPoint","checkPointOnRayLine","checkPointOnSegmentLine","a","c","checkPointOnCircle","circleCenterPoint","subY","getParallelLines","isPriceChannelLine","lines","endY","getFibonacciLines","yDistance","MouseEventButton","DELAY_RESET_CLICK","DELAY_LONG_TAG","getBoundingClientRect","element","isTouchEvent","event","Boolean","touches","preventDefault","cancelable","checkTouchEvents","DocumentTouch","touch","navigator","maxTouchPoints","msMaxTouchPoints","mobileTouch","getDistance","xDiff","clientX","yDiff","clientY","EventType","MOUSE","TOUCH","EventBase","eventHandler","_target","_handler","_options","_clickCount","_clickTimeoutId","_longTapTimeoutId","_longTapActive","_mouseMoveStartPosition","_moveExceededManhattanDistance","_cancelClick","_unsubscribeOutsideEvents","_unsubscribeMousemove","_unsubscribeRoot","_startPinchMiddlePoint","_startPinchDistance","_pinchPrevented","_preventDragProcess","_mousePressed","_init","_clearLongTapTimeout","_resetClickTimeout","enterEvent","boundMouseMoveHandler","_mouseMoveHandler","boundMouseWheelHandler","_mouseWheelHandler","removeEventListener","addEventListener","passive","compatEvent","_makeCompatEvent","_processEvent","mouseEnterEvent","moveEvent","mouseMoveEvent","wheelEvent","localX","localY","mouseWheelEvent","button","isTouch","startMouseMovePos","xOffset","pageX","yOffset","pageY","moveExceededManhattanDistance","correctedXOffset","isVertDrag","treatVertTouchDragAsPageScroll","isHorzDrag","treatHorzTouchDragAsPageScroll","pressedMouseMoveEvent","mouseUpEvent","_mouseLeaveHandler","mouseDoubleClickEvent","mouseClickEvent","downEvent","mouseRightDownEvent","_mouseEnterHandler","boundMouseMoveWithDownHandler","_mouseMoveWithDownHandler","boundMouseUpHandler","_mouseUpHandler","rootElement","ownerDocument","documentElement","_longTapHandler","mouseDownEvent","doc","outsideHandler","mouseDownOutsideEvent","contains","_mouseDownHandler","_initPinch","pinchStartEvent","undefined","pinchEvent","pinchEndEvent","_checkPinchState","currentDistance","_stopPinch","_startPinch","box","mouseLeaveEvent","longTapEvent","eventLike","changedTouches","screenX","screenY","ctrlKey","altKey","shiftKey","metaKey","startsWith","view","isMouse","EventHandler","_seriesSize","contentLeft","contentRight","seriesSize","GraphicMarkDrawStep","STEP_1","STEP_2","STEP_3","STEP_DONE","GraphicMarkEventHandler","_noneGraphicMarkMouseDownFlag","_noneGraphicMarkMouseDownActiveData","markKey","dataIndex","onLine","onCircle","pointIndex","setDragGraphicMarkFlag","_checkEventPointX","_checkEventPointY","setGraphicMarkPoint","_twoStepGraphicMarkMouseDown","_threeStepGraphicMarkMouseDown","_noneGraphicMarkMouseLeftDown","_findNoneGraphicMarkMouseDownActiveData","graphicMarkDatas","graphicMarkData","splice","setGraphicMarkData","_graphicMarkMouseDown","lastLineData","drawStep","setGraphicMarkType","performDifPoint","_realFindNoneGraphicMarkMouseDownActiveData","xyPoints","tags","CANDLE_STICK_SERIES_TAG","contentBottom","contentTop","isOnGraphicMark","checkPointOnLine","isOnCircle","xPos","isOn","isOnLine","_waitingForMouseMoveAnimationFrame","_onePointGraphicMarkMouseMove","_twoPointGraphicMarkMouseMove","_threePointGraphicMarkMouseMove","_graphicMarkMouseMove","stepTwo","LineType","COMMON","HORIZONTAL","VERTICAL","GraphicMarkView","_drawHorizontalStraightLine","_drawVerticalStraightLine","_drawStraightLine","_drawHorizontalRayLine","_drawVerticalRayLine","_drawRayLine","_drawSegmentLine","_drawPriceLine","_drawPriceChannelLine","_drawParallelStraightLine","_drawFibonacciLine","_drawPointGraphicMark","generatedLinePoints","isDrawPrice","priceExtendsText","circlePoints","_drawGraphicMark","graphicMarkPoint","lineType","_getLineType","priceText","isCircleActive","circlePoint","circleRadius","circleColor","circleBorderColor","circleBorderSize","CandleStickWidget","CandleStickSeries","_chartType","XAxisView","xAxisOptions","xAxisLine","XAxisFloatLayerView","crossHairVerticalText","xAxisLabelX","rectTop","rectBottom","XAxisWidget","XAxis","_initMeasureCanvas","measureCanvas","_measureCtx","defaultLabelWidth","tickLabelFormatType","nextPos","nextTimestamp","nextX","xDif","timeDif","minuteDif","nextKLineData","XAxisSeries","SeparatorSeries","seriesIndex","dragEventHandler","_seriesIndex","_offsetLeft","_dragEventHandler","_wrapper","cursor","_dragEvent","_mouseDownEvent","_pressedMouseMoveEvent","_startY","startDrag","dragDistance","drag","offsetLeft","destroy","ZoomDragEventHandler","_startDragPoint","_touchPoint","_touchCancelCrossHair","_touchZoomed","_pinchScale","middlePoint","zoom","setCrossHairSeriesTag","real","_translateCrossHairRealY","setCrossHairPoint","deltaY","deltaMode","DOM_DELTA_PAGE","DOM_DELTA_LINE","sign","KeyBoardEventHandler","code","ChartEvent","_event","_pinchStartEvent","_pinchEvent","_mouseUpEvent","_mouseClickEvent","_mouseRightDownEvent","_mouseLeaveEvent","_mouseMoveEvent","_mouseWheelEvent","_longTapEvent","_boundKeyBoardDownEvent","_keyBoardDownEvent","_boundContextMenuEvent","_zoomDragEventHandler","_graphicMarkEventHandler","_keyBoardEventHandler","keyBoardDownEvent","_checkZoomDrag","dragGraphicMarkFlag","setSeriesSize","DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT","TECHNICAL_INDICATOR_NAME_PREFIX","ChartSeries","_initChartContainer","_technicalIndicatorBaseId","_technicalIndicatorSeries","_separatorSeries","_separatorDragStartTechnicalIndicatorHeight","_updateSeries","_xAxisSeries","_chartContainer","_candleStickSeries","_chartEvent","measureSeriesSize","outline","borderStyle","tabIndex","setTempHeight","invalidateLevel","series","technicalIndicatorTypeArray","technicalIndicatorSeriesTechnicalIndicatorType","isYAxisLeft","isYAxisTextOutsize","seriesWidth","seriesHeight","separatorHeight","_measureSeparatorHeight","xAxisHeight","_measureXAxisHeight","yAxisWidth","_measureYAxisWidth","seriesExcludeXAxisSeparatorHeight","mainWidthWidth","yAxisOffsetLeft","mainOffsetLeft","technicalIndicatorSeriesTotalHeight","candleStickSeriesHeight","setTotalDataSpace","technicalIndicatorSeries","separatorSeries","technicalIndicatorSeriesHeight","applyStyleOptions","applyTechnicalIndicatorParams","candleStickSeriesTechnicalIndicatorType","seriesTechnicalIndicatorType","clearDataList","addData","_calcAllSeriesTechnicalIndicator","lastDataTimestamp","setChartType","technicalIndicatorSeriesCount","_separatorStartDrag","_separatorDrag","seriesPos","updateSeriesIndex","setTechnicalIndicatorType","s","removeTechnicalIndicator","Error","separatorSeriesHeight","toDataURL","Chart","_chartSeries","applyPrecision","setTimezone","setOffsetRightSpace","setDataSpace","applyNewData","applyMoreData","updateData","cb","loadMore","setCandleStickSeriesType","createTechnicalIndicator","newGraphicMarkDatas","getConvertPictureUrl","instances","idBase","errorMessage","version","init","ds","getElementById","getElementsByClassName","instance","chart_id","console","warn","chart","dispose","dcs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,KAAT,CAAgBC,MAAhB,EAAwBC,MAAxB,EAAgC;MACjC,CAACC,QAAQ,CAACF,MAAD,CAAT,IAAqB,CAACE,QAAQ,CAACD,MAAD,CAAlC,EAA4C;;;;OAGvC,IAAME,GAAX,IAAkBF,MAAlB,EAA0B;QACpBD,MAAM,CAACI,cAAP,CAAsBD,GAAtB,CAAJ,EAAgC;UACxBE,UAAU,GAAGL,MAAM,CAACG,GAAD,CAAzB;UACMG,UAAU,GAAGL,MAAM,CAACE,GAAD,CAAzB;;UACID,QAAQ,CAACI,UAAD,CAAR,IACFJ,QAAQ,CAACG,UAAD,CADN,IAEF,CAACE,OAAO,CAACD,UAAD,CAFN,IAGF,CAACC,OAAO,CAACF,UAAD,CAHV,EAIE;QACAN,KAAK,CAACM,UAAD,EAAaC,UAAb,CAAL;OALF,MAMO;YACDL,MAAM,CAACE,GAAD,CAAN,IAAeF,MAAM,CAACE,GAAD,CAAN,KAAgB,CAA/B,IAAoCF,MAAM,CAACE,GAAD,CAAN,KAAgB,KAAxD,EAA+D;UAC7DH,MAAM,CAACG,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;;;QAEEA,EAAJ,EAAQ;MACNkpB,SAAS,CAAClpB,EAAD,CAAT,CAAc4hB,OAAd;aACOsH,SAAS,CAAClpB,EAAD,CAAhB;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"klinecharts.development.js","sources":["../src/utils/typeChecks.js","../src/data/options/styleOptions.js","../src/data/options/technicalIndicatorParamOptions.js","../src/data/options/precisionOptions.js","../src/data/calcIndicator.js","../src/utils/format.js","../src/data/ChartData.js","../src/utils/canvas.js","../src/series/Series.js","../src/widget/Widget.js","../src/utils/compatible.js","../src/view/View.js","../src/view/TechnicalIndicatorView.js","../src/view/TechnicalIndicatorFloatLayerView.js","../src/widget/TechnicalIndicatorWidget.js","../src/view/YAxisView.js","../src/view/AxisFloatLayerView.js","../src/view/YAxisFloatLayerView.js","../src/widget/YAxisWidget.js","../src/component/Axis.js","../src/component/YAxis.js","../src/series/TechnicalIndicatorSeries.js","../src/view/CandleStickView.js","../src/view/CandleStickFloatLayerView.js","../src/utils/graphic.js","../src/event/EventBase.js","../src/event/EventHandler.js","../src/event/GraphicMarkEventHandler.js","../src/view/GraphicMarkView.js","../src/widget/CandleStickWidget.js","../src/series/CandleStickSeries.js","../src/view/XAxisView.js","../src/view/XAxisFloatLayerView.js","../src/widget/XAxisWidget.js","../src/component/XAxis.js","../src/series/XAxisSeries.js","../src/series/SeparatorSeries.js","../src/event/ZoomDragEventHandler.js","../src/event/KeyBoardEventHandler.js","../src/event/ChartEvent.js","../src/series/ChartSeries.js","../src/Chart.js","../src/index.js"],"sourcesContent":["export function merge (target, source) {\n if (!isObject(target) || !isObject(source)) {\n return\n }\n for (const key in source) {\n if (target.hasOwnProperty(key)) {\n const targetProp = target[key]\n const sourceProp = source[key]\n if (isObject(sourceProp) &&\n isObject(targetProp) &&\n !isArray(sourceProp) &&\n !isArray(targetProp)\n ) {\n merge(targetProp, sourceProp)\n } else {\n if (source[key] || source[key] === 0 || source[key] === false) {\n target[key] = source[key]\n }\n }\n }\n }\n}\n\nexport function clone (target) {\n if (!target || !isObject(target)) {\n return target\n }\n\n let copy\n if (isArray(target)) {\n copy = []\n } else {\n copy = {}\n }\n let p\n let v\n for (p in target) {\n if (target.hasOwnProperty(p)) {\n v = target[p]\n if (v && isObject(v)) {\n copy[p] = clone(v)\n } else {\n copy[p] = v\n }\n }\n }\n\n return copy\n}\n\nexport function isArray (value) {\n return Object.prototype.toString.call(value) === '[object Array]'\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nexport function isFunction (value) {\n return typeof value === 'function'\n}\n\n/**\n * @param {*} value\n * @return {boolean}\n */\nexport function isObject (value) {\n const type = typeof value\n return type === 'function' || (!!value && type === 'object')\n}\n\n/**\n * 判断是否是数字\n * @param value\n * @returns {boolean}\n */\nexport function isNumber (value) {\n return typeof value === 'number' && !isNaN(value)\n}\n\n/**\n * 判断是否是boolean\n * @param value\n * @returns {boolean}\n */\nexport function isBoolean (value) {\n return typeof value === 'boolean'\n}\n","/**\n * 线的样式\n * @type {{DASH: string, SOLID: string}}\n */\nexport const LineStyle = {\n DASH: 'dash',\n SOLID: 'solid'\n}\n\n/**\n * y轴位置\n * @type {{LEFT: string, RIGHT: string}}\n */\nexport const YAxisPosition = {\n LEFT: 'left',\n RIGHT: 'right'\n}\n\n/**\n * y轴文字位置\n * @type {{OUTSIDE: string, INSIDE: string}}\n */\nexport const YAxisTextPosition = {\n INSIDE: 'inside',\n OUTSIDE: 'outside'\n}\n\n/**\n * 主图类型\n * @type {{TIME_LINE: string, CANDLE: string}}\n */\nexport const ChartType = {\n REAL_TIME: 'real_time',\n CANDLE_STICK: 'candle_stick'\n}\n\n/**\n * 蜡烛图样式\n * @type {{STROKE: string, DECREASING_STROKE: string, OHLC: string, INCREASING_STROKE: string, SOLID: string}}\n */\nexport const CandleStickStyle = {\n SOLID: 'solid',\n STROKE: 'stroke',\n UP_STROKE: 'up_stroke',\n DOWN_STROKE: 'down_stroke',\n OHLC: 'ohlc'\n}\n\n/**\n * 提示文字显示规则\n * @type {{FOLLOW_CROSS: string, NONE: string, ALWAYS: string}}\n */\nexport const FloatLayerPromptDisplayRule = {\n ALWAYS: 'always',\n FOLLOW_CROSS: 'follow_cross',\n NONE: 'none'\n}\n\n/**\n * 主图数据提示显示类型\n * @type {{FLOAT: string, FIXED: string}}\n */\nexport const FloatLayerPromptCandleStickTextDisplayType = {\n RECT: 'rect',\n STANDARD: 'standard'\n}\n\n/**\n * 默认网格配置\n * @type {{horizontal: {size: number, color: string, dashValue: number[], display: boolean, style: string}, display: boolean, vertical: {size: number, color: string, dashValue: number[], display: boolean, style: string}}}\n */\nconst defaultGrid = {\n display: true,\n horizontal: {\n display: true,\n size: 1,\n color: '#393939',\n style: LineStyle.DASH,\n dashValue: [2, 2]\n },\n vertical: {\n display: false,\n size: 1,\n color: '#393939',\n style: LineStyle.DASH,\n dashValue: [2, 2]\n }\n}\n\n/**\n * 默认蜡烛柱图配置\n * @type {{bar: {upColor: string, style: string, downColor: string}}}\n */\nconst defaultCandleStick = {\n bar: {\n /**\n * 蜡烛样式\n */\n style: CandleStickStyle.SOLID,\n /**\n * 上涨颜色\n */\n upColor: '#26A69A',\n /**\n * 下跌颜色\n */\n downColor: '#EF5350',\n /**\n * 无变化时颜色\n */\n noChangeColor: '#666666'\n },\n priceMark: {\n display: true,\n high: {\n display: true,\n color: '#D9D9D9',\n textMargin: 5,\n textSize: 10\n },\n low: {\n display: true,\n color: '#D9D9D9',\n textMargin: 5,\n textSize: 10\n },\n last: {\n display: true,\n upColor: '#26A69A',\n downColor: '#EF5350',\n noChangeColor: '#666666',\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 4],\n size: 1\n },\n text: {\n display: true,\n size: 12,\n paddingLeft: 2,\n paddingTop: 2,\n paddingRight: 2,\n paddingBottom: 2,\n color: '#FFFFFF'\n }\n }\n }\n}\n\n/**\n * 默认的分时图配置\n * @type {{timeLine: {areaFillColor: string, color: string, size: number}, averageLine: {color: string, size: number, display: boolean}}}\n */\nconst defaultRealTime = {\n timeLine: {\n color: '#1e88e5',\n size: 1,\n areaFillColor: 'rgba(30, 136, 229, 0.08)'\n },\n /**\n * 均线\n */\n averageLine: {\n display: true,\n color: '#F5A623',\n size: 1\n }\n}\n\n/**\n * 默认的技术指标图配置\n * @type {{decreasingColor: string, lineColors: [string, string, string, string, string], increasingColor: string, lineSize: number}}\n */\nconst defaultTechnicalIndicator = {\n bar: {\n upColor: '#26A69A',\n downColor: '#EF5350',\n noChangeColor: '#666666'\n },\n line: {\n size: 1,\n colors: ['#D9D9D9', '#F5A623', '#F601FF', '#1587DD', '#1e88e5']\n }\n}\n\nconst defaultXAxis = {\n /**\n * 是否显示整个轴\n */\n display: true,\n /**\n * x轴最大高度\n */\n maxHeight: 50,\n /**\n * x轴最小高度\n */\n minHeight: 30,\n /**\n * 轴线配置\n */\n axisLine: {\n display: true,\n color: '#888888',\n size: 1\n },\n\n /**\n * tick文字\n */\n tickText: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n margin: 3\n },\n // tick线\n tickLine: {\n display: true,\n size: 1,\n length: 3,\n color: '#888888'\n }\n}\n\nconst defaultYAxis = {\n /**\n * 是否显示整个轴\n */\n display: true,\n /**\n * x轴最大宽度\n */\n maxWidth: 100,\n /**\n * x轴最小宽度\n */\n minWidth: 60,\n /**\n * 轴位置\n */\n position: YAxisPosition.RIGHT,\n /**\n * 轴线配置\n */\n axisLine: {\n display: true,\n color: '#888888',\n size: 1\n },\n\n /**\n * tick文字\n */\n tickText: {\n position: YAxisTextPosition.OUTSIDE,\n display: true,\n color: '#D9D9D9',\n size: 12,\n margin: 3\n },\n // tick线\n tickLine: {\n display: true,\n size: 1,\n length: 3,\n color: '#888888'\n }\n}\n\n/**\n * 默认浮层配置\n * @type {{display: boolean}}\n */\nconst defaultFloatLayer = {\n crossHair: {\n display: true,\n horizontal: {\n display: true,\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 2],\n size: 1,\n color: '#888888'\n },\n text: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n paddingLeft: 2,\n paddingRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n borderSize: 1,\n borderColor: '#505050',\n backgroundColor: '#505050'\n }\n },\n vertical: {\n display: true,\n line: {\n display: true,\n style: LineStyle.DASH,\n dashValue: [4, 2],\n size: 1,\n color: '#888888'\n },\n text: {\n display: true,\n color: '#D9D9D9',\n size: 12,\n paddingLeft: 2,\n paddingRight: 2,\n paddingTop: 2,\n paddingBottom: 2,\n borderSize: 1,\n borderColor: '#505050',\n backgroundColor: '#505050'\n }\n }\n },\n prompt: {\n displayRule: FloatLayerPromptDisplayRule.ALWAYS,\n candleStick: {\n showType: FloatLayerPromptCandleStickTextDisplayType.STANDARD,\n labels: ['时间', '开', '收', '高', '低', '成交量'],\n values: null,\n rect: {\n paddingLeft: 0,\n paddingRight: 0,\n paddingTop: 0,\n paddingBottom: 6,\n left: 8,\n top: 8,\n right: 8,\n borderRadius: 4,\n borderSize: 1,\n borderColor: '#3f4254',\n fillColor: 'rgba(17, 17, 17, .3)'\n },\n text: {\n size: 12,\n color: '#D9D9D9',\n marginLeft: 8,\n marginTop: 6,\n marginRight: 8,\n marginBottom: 0\n }\n },\n technicalIndicator: {\n text: {\n size: 12,\n color: '#D9D9D9',\n marginTop: 6,\n marginRight: 8,\n marginBottom: 0,\n marginLeft: 8\n }\n }\n }\n}\n\n/**\n * 默认图形标记配置\n * @type {{line: {color: string, size: number}, text: {marginRight: number, color: string, size: number, valueFormatter: null, marginBottom: number, marginTop: number, marginLeft: number}, point: {backgroundColor: string, borderColor: string, activeBorderSize: number, activeRadius: number, activeBorderColor: string, activeBackgroundColor: string, borderSize: number, radius: number}}}\n */\nconst defaultGraphicMark = {\n line: {\n color: '#1e88e5',\n size: 1\n },\n point: {\n backgroundColor: '#1e88e5',\n borderColor: '#1e88e5',\n borderSize: 1,\n radius: 4,\n activeBackgroundColor: '#1e88e5',\n activeBorderColor: '#1e88e5',\n activeBorderSize: 1,\n activeRadius: 6\n },\n text: {\n color: '#1e88e5',\n size: 12,\n marginLeft: 2,\n marginRight: 2,\n marginTop: 2,\n marginBottom: 6\n }\n}\n\n/**\n * 图表之间默认分割配置\n * @type {{size: number, color: string}}\n */\nconst defaultSeparator = {\n size: 1,\n color: '#888888',\n fill: true\n}\n\nexport const defaultStyleOptions = {\n grid: defaultGrid,\n candleStick: defaultCandleStick,\n realTime: defaultRealTime,\n technicalIndicator: defaultTechnicalIndicator,\n xAxis: defaultXAxis,\n yAxis: defaultYAxis,\n separator: defaultSeparator,\n floatLayer: defaultFloatLayer,\n graphicMark: defaultGraphicMark\n}\n","export const TechnicalIndicatorType = {\n NO: 'NO',\n AVERAGE: 'AVERAGE',\n MA: 'MA',\n VOL: 'VOL',\n MACD: 'MACD',\n BOLL: 'BOLL',\n KDJ: 'KDJ',\n RSI: 'RSI',\n BIAS: 'BIAS',\n BRAR: 'BRAR',\n CCI: 'CCI',\n DMI: 'DMI',\n CR: 'CR',\n PSY: 'PSY',\n DMA: 'DMA',\n TRIX: 'TRIX',\n OBV: 'OBV',\n VR: 'VR',\n WR: 'WR',\n MTM: 'MTM',\n EMV: 'EMV',\n SAR: 'SAR'\n}\n\nexport const defaultTechnicalIndicatorParamOptions = {\n [TechnicalIndicatorType.MA]: [5, 10, 30, 60],\n [TechnicalIndicatorType.VOL]: [5, 10, 20],\n [TechnicalIndicatorType.MACD]: [12, 26, 9],\n [TechnicalIndicatorType.BOLL]: [20],\n [TechnicalIndicatorType.KDJ]: [9, 3, 3],\n [TechnicalIndicatorType.RSI]: [6, 12, 24],\n [TechnicalIndicatorType.BIAS]: [6, 12, 24],\n [TechnicalIndicatorType.BRAR]: [26],\n [TechnicalIndicatorType.CCI]: [13],\n [TechnicalIndicatorType.DMI]: [14, 6],\n [TechnicalIndicatorType.CR]: [26, 10, 20, 40, 60],\n [TechnicalIndicatorType.PSY]: [12],\n [TechnicalIndicatorType.DMA]: [10, 50, 10],\n [TechnicalIndicatorType.TRIX]: [12, 20],\n [TechnicalIndicatorType.OBV]: [30],\n [TechnicalIndicatorType.VR]: [24, 30],\n [TechnicalIndicatorType.WR]: [13, 34, 89],\n [TechnicalIndicatorType.MTM]: [6, 10],\n [TechnicalIndicatorType.EMV]: [14, 9],\n [TechnicalIndicatorType.SAR]: [2, 2, 20]\n}\n","import { TechnicalIndicatorType } from '../options/technicalIndicatorParamOptions'\n\nexport const defaultPrecisionOptions = {\n price: 2,\n volume: 0,\n [TechnicalIndicatorType.NO]: 2,\n [TechnicalIndicatorType.MA]: 2,\n [TechnicalIndicatorType.VOL]: 0,\n [TechnicalIndicatorType.MACD]: 2,\n [TechnicalIndicatorType.BOLL]: 2,\n [TechnicalIndicatorType.KDJ]: 2,\n [TechnicalIndicatorType.RSI]: 2,\n [TechnicalIndicatorType.BIAS]: 2,\n [TechnicalIndicatorType.BRAR]: 4,\n [TechnicalIndicatorType.CCI]: 4,\n [TechnicalIndicatorType.DMI]: 4,\n [TechnicalIndicatorType.CR]: 2,\n [TechnicalIndicatorType.PSY]: 2,\n [TechnicalIndicatorType.DMA]: 4,\n [TechnicalIndicatorType.TRIX]: 4,\n [TechnicalIndicatorType.OBV]: 4,\n [TechnicalIndicatorType.VR]: 4,\n [TechnicalIndicatorType.WR]: 4,\n [TechnicalIndicatorType.MTM]: 4,\n [TechnicalIndicatorType.EMV]: 4,\n [TechnicalIndicatorType.SAR]: 2\n}\n","import { TechnicalIndicatorType } from './options/technicalIndicatorParamOptions'\nimport { isArray } from '../utils/typeChecks'\n\nconst calcIndicator = {}\n\nexport default calcIndicator\n\n/**\n * 计算均价\n * @param dataList\n * @returns {*}\n */\ncalcIndicator[TechnicalIndicatorType.AVERAGE] = function (dataList) {\n let totalTurnover = 0\n let totalVolume = 0\n return calc(dataList, (i) => {\n const turnover = dataList[i].turnover || 0\n totalVolume += dataList[i].volume || 0\n totalTurnover += turnover\n if (totalVolume !== 0) {\n dataList[i].average = totalTurnover / totalVolume\n } else {\n dataList[i].average = 0\n }\n })\n}\n\n/**\n * 计算均线数据\n * 默认参数5,10,20,60\n * @param dataList\n * @param params\n * @returns {*}\n */\ncalcIndicator[TechnicalIndicatorType.MA] = function (dataList, params) {\n if (!checkParams(params)) {\n return dataList\n }\n const closeSums = []\n const paramsLength = params.length\n return calc(dataList, (i) => {\n const ma = {}\n const close = dataList[i].close\n for (let j = 0; j < paramsLength; j++) {\n closeSums[j] = (closeSums[j] || 0) + close\n const p = params[j]\n if (i < p) {\n ma[`ma${p}`] = closeSums[j] / (i + 1)\n } else {\n closeSums[j] -= dataList[i - p].close\n ma[`ma${p}`] = closeSums[j] / p\n }\n }\n dataList[i].ma = ma\n })\n}\n\n/**\n * 计算成交量包含ma5、ma10、ma20\n * 默认参数5,10,20\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.VOL] = function (dataList, params) {\n if (!checkParams(params)) {\n return dataList\n }\n const volumeSums = []\n const paramsLength = params.length\n return calc(dataList, (i) => {\n const num = dataList[i].volume\n const vol = {}\n for (let j = 0; j < paramsLength; j++) {\n volumeSums[j] = (volumeSums[j] || 0) + num\n const p = params[j]\n if (i < p) {\n vol[`ma${p}`] = volumeSums[j] / (i + 1)\n } else {\n volumeSums[j] -= dataList[i - p].volume\n vol[`ma${p}`] = volumeSums[j] / p\n }\n }\n vol.num = num\n dataList[i].vol = vol\n })\n}\n\n/**\n * 计算MACD指标\n *\n * MACD:参数快线移动平均、慢线移动平均、移动平均,\n * 默认参数值12、26、9。\n * 公式:⒈首先分别计算出收盘价12日指数平滑移动平均线与26日指数平滑移动平均线,分别记为EMA(12)与EMA(26)。\n * ⒉求这两条指数平滑移动平均线的差,即:DIFF=EMA(SHORT)-EMA(LONG)。\n * ⒊再计算DIFF的M日的平均的指数平滑移动平均线,记为DEA。\n * ⒋最后用DIFF减DEA,得MACD。MACD通常绘制成围绕零轴线波动的柱形图。MACD柱状大于0涨颜色,小于0跌颜色。\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.MACD] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let emaShort\n let emaLong\n let oldEmaShort = 0\n let oldEmaLong = 0\n let diff = 0\n let dea = 0\n let oldDea = 0\n let macd = 0\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n if (i === 0) {\n emaShort = closePrice\n emaLong = closePrice\n } else {\n emaShort = (2 * closePrice + (params[0] - 1) * oldEmaShort) / (params[0] + 1)\n emaLong = (2 * closePrice + (params[1] - 1) * oldEmaLong) / (params[1] + 1)\n }\n\n diff = emaShort - emaLong\n dea = (diff * 2 + oldDea * (params[2] - 1)) / (params[2] + 1)\n macd = (diff - dea) * 2\n oldEmaShort = emaShort\n oldEmaLong = emaLong\n oldDea = dea\n\n dataList[i].macd = { diff, dea, macd }\n })\n}\n\n/**\n * 计算BOLL指标\n * 默认参数20\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BOLL] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let closeSum = 0\n let ma// 中轨线\n let md// 标准差\n let up// 上轨线\n let dn// 下轨线\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n closeSum += closePrice\n if (i < params[0]) {\n ma = closeSum / (i + 1)\n md = getBollMd(dataList.slice(0, i + 1), ma)\n } else {\n closeSum -= dataList[i - params[0]].close\n ma = closeSum / params[0]\n md = getBollMd(dataList.slice(i - (params[0] - 1), i + 1), ma)\n }\n up = ma + 2 * md\n dn = ma - 2 * md\n dataList[i].boll = { up, mid: ma, dn }\n })\n}\n\n/**\n * 计算KDJ\n * 默认参数9,3,3\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.KDJ] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let k\n let d\n let j\n\n // n日内最低价\n let ln\n // n日内最高价\n let hn\n\n return calc(dataList, (i) => {\n // n日收盘价\n const cn = dataList[i].close\n\n if (i < (params[0] - 1)) {\n ln = getLow(dataList.slice(0, i + 1))\n hn = getHigh(dataList.slice(0, i + 1))\n } else {\n ln = getLow(dataList.slice(i - (params[0] - 1), i + 1))\n hn = getHigh(dataList.slice(i - (params[0] - 1), i + 1))\n }\n const rsv = (cn - ln) / (hn - ln === 0 ? 1 : hn - ln) * 100\n // 当日K值=2/3×前一日K值+1/3×当日RSV\n // 当日D值=2/3×前一日D值+1/3×当日K值\n // 若无前一日K 值与D值,则可分别用50来代替。\n // J值=3*当日K值-2*当日D值\n k = (params[1] - 1) / params[1] * (i < (params[0] - 1) ? 50.0 : dataList[i - 1].kdj.k) + 1.0 / params[1] * rsv\n d = (params[2] - 1) / params[2] * (i < (params[0] - 1) ? 50.0 : dataList[i - 1].kdj.d) + 1.0 / params[2] * k\n j = 3.0 * k - 2.0 * d\n dataList[i].kdj = { k, d, j }\n })\n}\n\n/**\n * 计算RSI\n * 默认参数6,12,24\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.RSI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n // N日RSI =\n // N日内收盘涨幅的平均值/(N日内收盘涨幅均值+N日内收盘跌幅均值) ×100%\n let sumCloseA1 = 0\n let sumCloseB1 = 0\n\n let sumCloseA2 = 0\n let sumCloseB2 = 0\n\n let sumCloseA3 = 0\n let sumCloseB3 = 0\n\n let a1\n let b1\n\n let a2\n let b2\n\n let a3\n let b3\n\n return calc(dataList, (i) => {\n const rsi = { [`rsi${params[0]}`]: 0, [`rsi${params[1]}`]: 0, [`rsi${params[2]}`]: 0 }\n if (i > 0) {\n const tmp = dataList[i].close - dataList[i - 1].close\n if (tmp > 0) {\n sumCloseA1 += tmp\n sumCloseA2 += tmp\n sumCloseA3 += tmp\n } else {\n const absTmp = Math.abs(tmp)\n sumCloseB1 += absTmp\n sumCloseB2 += absTmp\n sumCloseB3 += absTmp\n }\n\n if (i < params[0]) {\n a1 = sumCloseA1 / (i + 1)\n b1 = (sumCloseA1 + sumCloseB1) / (i + 1)\n } else {\n if (i > params[0]) {\n const agoTmp = dataList[i - params[0]].close - dataList[i - params[0] - 1].close\n if (agoTmp > 0) {\n sumCloseA1 -= agoTmp\n } else {\n sumCloseB1 -= Math.abs(agoTmp)\n }\n }\n a1 = sumCloseA1 / params[0]\n b1 = (sumCloseA1 + sumCloseB1) / params[0]\n }\n rsi[`rsi${params[0]}`] = b1 !== 0.0 ? a1 / b1 * 100 : 0.0\n\n if (i < params[1]) {\n a2 = sumCloseA2 / (i + 1)\n b2 = (sumCloseA2 + sumCloseB2) / (i + 1)\n } else {\n if (i > params[1]) {\n const agoTmp = dataList[i - params[1]].close - dataList[i - params[1] - 1].close\n if (agoTmp > 0) {\n sumCloseA2 -= agoTmp\n } else {\n sumCloseB2 -= Math.abs(agoTmp)\n }\n }\n a2 = sumCloseA2 / params[1]\n b2 = (sumCloseA2 + sumCloseB2) / params[1]\n }\n rsi[`rsi${params[1]}`] = b2 !== 0.0 ? a2 / b2 * 100 : 0.0\n\n if (i < params[2]) {\n a3 = sumCloseA3 / (i + 1)\n b3 = (sumCloseA3 + sumCloseB3) / (i + 1)\n } else {\n if (i > params[2]) {\n const agoTmp = dataList[i - params[2]].close - dataList[i - params[2] - 1].close\n if (agoTmp > 0) {\n sumCloseA3 -= agoTmp\n } else {\n sumCloseB3 -= Math.abs(agoTmp)\n }\n }\n a3 = sumCloseA3 / params[2]\n b3 = (sumCloseA3 + sumCloseB3) / params[2]\n }\n rsi[`rsi${params[2]}`] = b3 !== 0.0 ? a3 / b3 * 100 : 0.0\n }\n dataList[i].rsi = rsi\n })\n}\n\n/**\n * 计算BIAS指标\n * 乖离率=[(当日收盘价-N日平均价)/N日平均价]*100%\n * 默认参数:6,12、24\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BIAS] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let mean1\n let mean2\n let mean3\n let closes1 = 0\n let closes2 = 0\n let closes3 = 0\n\n return calc(dataList, (i) => {\n const bias = {}\n const closePrice = dataList[i].close\n closes1 += closePrice\n closes2 += closePrice\n closes3 += closePrice\n\n if (i < params[0]) {\n mean1 = closes1 / (i + 1)\n } else {\n closes1 -= dataList[i - params[0]].close\n mean1 = closes1 / params[0]\n }\n bias[`bias${params[0]}`] = ((closePrice - mean1) / mean1) * 100\n\n if (i < params[1]) {\n mean2 = closes2 / (i + 1)\n } else {\n closes2 -= dataList[i - params[1]].close\n mean2 = closes2 / params[1]\n }\n bias[`bias${params[1]}`] = ((closePrice - mean2) / mean2) * 100\n\n if (i < params[2]) {\n mean3 = closes3 / (i + 1)\n } else {\n closes3 -= dataList[i - params[2]].close\n mean3 = closes3 / params[2]\n }\n bias[`bias${params[2]}`] = ((closePrice - mean3) / mean3) * 100\n\n dataList[i].bias = bias\n })\n}\n\n/**\n * 计算BRAR指标\n * 默认参数是26。\n * 公式N日BR=N日内(H-CY)之和除以N日内(CY-L)之和*100,\n * 其中,H为当日最高价,L为当日最低价,CY为前一交易日的收盘价,N为设定的时间参数。\n * N日AR=(N日内(H-O)之和除以N日内(O-L)之和)*100,\n * 其中,H为当日最高价,L为当日最低价,O为当日开盘价,N为设定的时间参数\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.BRAR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let br = 0\n let ar = 0\n let hcy = 0\n let cyl = 0\n let ho = 0\n let ol = 0\n\n return calc(dataList, (i) => {\n const high = dataList[i].high\n const low = dataList[i].low\n const open = dataList[i].open\n ho += (high - open)\n ol += (open - low)\n if (i > 0) {\n const refClose = dataList[i - 1].close\n hcy += (high - refClose)\n cyl += (refClose - low)\n if (i > params[0] - 1) {\n const agoHigh = dataList[i - params[0]].high\n const agoLow = dataList[i - params[0]].low\n const agoOpen = dataList[i - params[0]].open\n if (i > params[0]) {\n const agoRefClose = dataList[i - params[0] - 1].close\n hcy -= (agoHigh - agoRefClose)\n cyl -= (agoRefClose - agoLow)\n }\n ho -= (agoHigh - agoOpen)\n ol -= (agoOpen - agoLow)\n }\n if (ol !== 0) {\n ar = ho / ol * 100\n } else {\n ar = 0\n }\n if (cyl !== 0) {\n br = hcy / cyl * 100\n } else {\n br = 0\n }\n }\n dataList[i].brar = { br, ar }\n })\n}\n\n/**\n * 计算CCI指标\n * CCI(N日)=(TP-MA)÷MD÷0.015\n * 其中,TP=(最高价+最低价+收盘价)÷3\n * MA=近N日收盘价的累计之和÷N\n * MD=近N日(MA-收盘价)的累计之和÷N\n * 默认参数13\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.CCI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let closes = 0.0\n let closeMa\n const closeMaList = []\n let md\n let maCloseSum = 0.0\n let cci\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n closes += closePrice\n\n const tp = (dataList[i].high + dataList[i].low + closePrice) / 3\n if (i < params[0]) {\n closeMa = closes / (i + 1)\n maCloseSum += Math.abs(closeMa - closePrice)\n closeMaList.push(closeMa)\n md = maCloseSum / (i + 1)\n } else {\n const agoClosePrice = dataList[i - params[0]].close\n closes -= agoClosePrice\n closeMa = closes / params[0]\n closeMaList.push(closeMa)\n maCloseSum += Math.abs(closeMa - closePrice)\n maCloseSum -= Math.abs(closeMaList[i - params[0]] - agoClosePrice)\n md = maCloseSum / params[0]\n }\n cci = md !== 0.0 ? (tp - closeMa) / md / 0.015 : 0.0\n dataList[i].cci = { cci }\n })\n}\n\n/**\n * 计算DMI\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.DMI] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n // 默认参数 14,6\n // MTR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),N)\n // HD :=HIGH-REF(HIGH,1);\n // LD :=REF(LOW,1)-LOW;\n // DMP:=EXPMEMA(IF(HD>0&&HD>LD,HD,0),N);\n // DMM:=EXPMEMA(IF(LD>0&&LD>HD,LD,0),N);\n //\n // PDI: DMP*100/MTR;\n // MDI: DMM*100/MTR;\n // ADX: EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,MM);\n // ADXR:EXPMEMA(ADX,MM);\n // 公式含义:\n // MTR赋值:最高价-最低价和最高价-昨收的绝对值的较大值和昨收-最低价的绝对值的较大值的N日指数平滑移动平均\n // HD赋值:最高价-昨日最高价\n // LD赋值:昨日最低价-最低价\n // DMP赋值:如果HD>0并且HD>LD,返回HD,否则返回0的N日指数平滑移动平均\n // DMM赋值:如果LD>0并且LD>HD,返回LD,否则返回0的N日指数平滑移动平均\n // 输出PDI:DMP*100/MTR\n // 输出MDI:DMM*100/MTR\n // 输出ADX:MDI-PDI的绝对值/(MDI+PDI)*100的MM日指数平滑移动平均\n // 输出ADXR:ADX的MM日指数平滑移动平均\n let pdi = 0.0\n let mdi = 0.0\n let adx = 0.0\n let adxr = 0.0\n\n const trList = [0.0]\n let trSum = 0.0\n const dmpList = [0.0]\n let dmpSum = 0.0\n const dmmList = [0.0]\n let dmmSum = 0.0\n const dxList = [0.0]\n let dxSum = 0.0\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const refClose = dataList[i - 1].close\n const highPrice = dataList[i].high\n const lowPrice = dataList[i].low\n const hl = highPrice - lowPrice\n const hcy = Math.abs(highPrice - refClose)\n const lcy = Math.abs(lowPrice - refClose)\n const hhy = highPrice - dataList[i - 1].high\n const lyl = dataList[i - 1].low - lowPrice\n const tr = Math.max(Math.max(hl, hcy), lcy)\n trSum += tr\n trList.push(tr)\n\n const h = (hhy > 0.0 && hhy > lyl) ? hhy : 0.0\n dmpSum += h\n dmpList.push(h)\n\n const l = (lyl > 0 && lyl > hhy) ? lyl : 0.0\n dmmSum += l\n dmmList.push(l)\n\n if (i > params[0] - 1) {\n trSum -= trList[i - params[0]]\n dmpSum -= dmpList[i - params[0]]\n dmmSum -= dmmList[i - params[0]]\n }\n\n if (trSum === 0) {\n pdi = 0\n mdi = 0\n } else {\n pdi = dmpSum * 100 / trSum\n mdi = dmmSum * 100 / trSum\n }\n\n const dx = Math.abs((mdi - pdi)) / (mdi + pdi) * 100\n dxSum += dx\n dxList.push(dx)\n if (i < params[1]) {\n adx = dxSum / (i + 1)\n adxr = adx\n } else {\n const agoAdx = dxList[i - params[1]]\n dxSum -= agoAdx\n adx = dxSum / params[1]\n adxr = (adx + agoAdx) / 2\n }\n }\n dataList[i].dmi = { pdi, mdi, adx, adxr }\n })\n}\n\n/**\n * 计算CR\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.CR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 5)) {\n return dataList\n }\n // 默认参数26、10、20、40、60\n // MID:=REF(HIGH+LOW,1)/2;\n // CR:SUM(MAX(0,HIGH-MID),N)/SUM(MAX(0,MID-LOW),N)*100;\n // MA1:REF(MA(CR,M1),M1/2.5+1);\n // MA2:REF(MA(CR,M2),M2/2.5+1);\n // MA3:REF(MA(CR,M3),M3/2.5+1);\n // MA4:REF(MA(CR,M4),M4/2.5+1);\n // MID赋值:(昨日最高价+昨日最低价)/2\n // 输出带状能量线:0和最高价-MID的较大值的N日累和/0和MID-最低价的较大值的N日累和*100\n // 输出MA1:M1(5)/2.5+1日前的CR的M1(5)日简单移动平均\n // 输出MA2:M2(10)/2.5+1日前的CR的M2(10)日简单移动平均\n // 输出MA3:M3(20)/2.5+1日前的CR的M3(20)日简单移动平均\n // 输出MA4:M4/2.5+1日前的CR的M4日简单移动平均\n let cr = 0\n let ma1\n let ma2\n let ma3\n let ma4\n let p1 = 0\n let p2 = 0\n let ma1Sum = 0\n let ma1Mean\n const ma1List = []\n let ma2Sum = 0\n let ma2Mean\n const ma2List = []\n let ma3Sum = 0\n let ma3Mean\n const ma3List = []\n let ma4Sum = 0\n let ma4Mean\n const ma4List = []\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const preHighestPrice = dataList[i - 1].high\n const preLowestPrice = dataList[i - 1].low\n const preClosePrice = dataList[i - 1].close\n const preOpenPrice = dataList[i - 1].open\n const preMidPrice = (preHighestPrice + preClosePrice + preLowestPrice + preOpenPrice) / 4\n\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n\n let highSubPreMid = highestPrice - preMidPrice\n if (highSubPreMid < 0) {\n highSubPreMid = 0\n }\n p1 += highSubPreMid\n\n let preMidSubLow = preMidPrice - lowestPrice\n if (preMidSubLow < 0) {\n preMidSubLow = 0\n }\n p2 += preMidSubLow\n\n if (i > params[0]) {\n const firstHighestPrice = dataList[i - params[0] - 1].high\n const firstLowestPrice = dataList[i - params[0] - 1].low\n const firstClosePrice = dataList[i - params[0] - 1].close\n const firstOpenPrice = dataList[i - params[0] - 1].open\n const firstMidPrice = (firstHighestPrice + firstLowestPrice + firstClosePrice + firstOpenPrice) / 4\n\n const secondHighestPrice = dataList[i - params[0]].high\n const secondLowestPrice = dataList[i - params[0]].low\n\n let secondHighSubFirstMid = secondHighestPrice - firstMidPrice\n if (secondHighSubFirstMid < 0) {\n secondHighSubFirstMid = 0\n }\n\n let firstMidSubSecondLow = firstMidPrice - secondLowestPrice\n if (firstMidSubSecondLow < 0) {\n firstMidSubSecondLow = 0\n }\n p1 -= secondHighSubFirstMid\n p2 -= firstMidSubSecondLow\n }\n\n if (p2 !== 0) {\n cr = p1 / p2 * 100\n }\n\n const YM = (dataList[i - 1].high + dataList[i - 1].low + dataList[i - 1].close) / 3\n const HYM = dataList[i].high - YM\n p1 += (HYM <= 0 ? 0 : HYM)\n const LYM = YM - dataList[i].low\n p2 += (LYM <= 0 ? 0 : LYM)\n }\n ma1Sum += cr\n ma2Sum += cr\n ma3Sum += cr\n ma4Sum += cr\n\n if (i < params[1]) {\n ma1Mean = ma1Sum / (i + 1)\n } else {\n ma1Sum -= dataList[i - params[1]].cr.cr\n ma1Mean = ma1Sum / params[1]\n }\n ma1List.push(ma1Mean)\n\n if (i < params[2]) {\n ma2Mean = ma2Sum / (i + 1)\n } else {\n ma2Sum -= dataList[i - params[2]].cr.cr\n ma2Mean = ma2Sum / params[2]\n }\n ma2List.push(ma2Mean)\n\n if (i < params[3]) {\n ma3Mean = ma3Sum / (i + 1)\n } else {\n ma3Sum -= dataList[i - params[3]].cr.cr\n ma3Mean = ma3Sum / params[3]\n }\n ma3List.push(ma3Mean)\n\n if (i < params[4]) {\n ma4Mean = ma4Sum / (i + 1)\n } else {\n ma4Sum -= dataList[i - params[4]].cr.cr\n ma4Mean = ma4Sum / params[4]\n }\n ma4List.push(ma4Mean)\n\n if (i < 5) {\n ma1 = ma1List[0]\n } else {\n ma1 = ma1List[i - 5]\n }\n\n if (i < 9) {\n ma2 = ma2List[0]\n } else {\n ma2 = ma2List[i - 9]\n }\n\n if (i < 17) {\n ma3 = ma3List[0]\n } else {\n ma3 = ma3List[i - 17]\n }\n\n if (i < 25) {\n ma4 = ma4List[0]\n } else {\n ma4 = ma4List[i - 25]\n }\n dataList[i].cr = { cr, ma1, ma2, ma3, ma4 }\n })\n}\n\n/**\n * 计算PSY\n * 默认参数是12。公式:PSY=N日内的上涨天数/N×100%。\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.PSY] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let psy = 0\n let upDay = 0\n\n return calc(dataList, (i) => {\n if (i > 0) {\n upDay += (dataList[i].close - dataList[i - 1].close > 0 ? 1 : 0)\n if (i < params[0]) {\n psy = upDay / (i + 1) * 100\n } else {\n if (i > params[0]) {\n upDay -= ((dataList[i - params[0] + 1].close - dataList[i - params[0]].close > 0) ? 1.0 : 0.0)\n }\n psy = upDay / params[0] * 100\n }\n }\n dataList[i].psy = { psy }\n })\n}\n\n/**\n * 计算DMA\n * 默认参数是10、50、10。\n * 公式:DIF:MA(CLOSE,N1)-MA(CLOSE,N2);DIFMA:MA(DIF,M)\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.DMA] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let dif\n let difMa\n let ma1Sum = 0\n let ma1\n let ma2Sum = 0\n let ma2\n let difSum = 0\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n\n ma1Sum += closePrice\n ma2Sum += closePrice\n\n if (i < params[0]) {\n ma1 = ma1Sum / (i + 1)\n } else {\n ma1Sum -= dataList[i - params[0]].close\n ma1 = ma1Sum / params[0]\n }\n\n if (i < params[1]) {\n ma2 = ma2Sum / (i + 1)\n } else {\n ma2Sum -= dataList[i - params[1]].close\n ma2 = ma2Sum / params[1]\n }\n dif = ma1 - ma2\n difSum += dif\n\n if (i < params[2]) {\n difMa = difSum / (i + 1)\n } else {\n difSum -= dataList[i - params[2]].dma.dif\n difMa = difSum / params[2]\n }\n\n dataList[i].dma = { dif, difMa }\n })\n}\n\n/**\n * 计算TRIX\n *\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.TRIX] = function (dataList, params) {\n // TR=收盘价的N日指数移动平均的N日指数移动平均的N日指数移动平均;\n // TRIX=(TR-昨日TR)/昨日TR*100;\n // MATRIX=TRIX的M日简单移动平均;\n // 默认参数N设为12,默认参数M设为20;\n // 默认参数12、20\n // 公式:MTR:=EMA(EMA(EMA(CLOSE,N),N),N)\n // TRIX:(MTR-REF(MTR,1))/REF(MTR,1)*100;\n // TRMA:MA(TRIX,M)\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let trix = 0\n let maTrix\n let sumTrix = 0\n\n let emaClose1\n let oldEmaClose1 = 0.0\n\n let emaClose2\n let oldEmaClose2 = 0.0\n\n let emaClose3\n let oldEmaClose3 = 0.0\n const emaClose3List = []\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n if (i === 0) {\n emaClose1 = closePrice\n emaClose2 = emaClose1\n emaClose3 = emaClose2\n } else {\n emaClose1 = (2 * closePrice + (params[0] - 1) * oldEmaClose1) / (params[0] + 1)\n emaClose2 = (2 * emaClose1 + (params[0] - 1) * oldEmaClose2) / (params[0] + 1)\n emaClose3 = (2 * emaClose2 + (params[0] - 1) * oldEmaClose3) / (params[0] + 1)\n const refEmaClose3 = emaClose3List[i - 1]\n trix = refEmaClose3 === 0.0 ? 0.0 : (emaClose3 - refEmaClose3) / refEmaClose3 * 100\n }\n oldEmaClose1 = emaClose1\n oldEmaClose2 = emaClose2\n oldEmaClose3 = emaClose3\n emaClose3List.push(emaClose3)\n sumTrix += trix\n if (i < params[1]) {\n maTrix = sumTrix / (i + 1)\n } else {\n sumTrix -= dataList[i - params[1]].trix.trix\n maTrix = sumTrix / params[1]\n }\n dataList[i].trix = { trix, maTrix }\n })\n}\n\n/**\n * 计算obv指标\n * VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);\n * OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);\n * MAOBV:MA(OBV,M);\n * VA赋值:如果收盘价>昨收,返回成交量(手),否则返回-成交量(手)\n * 输出OBV:如果收盘价=昨收,返回0,否则返回VA的历史累和\n * 输出MAOBV:OBV的M日简单移动平均\n * 默认参数30\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.OBV] = function (dataList, params) {\n if (!checkParamsWithSize(params, 1)) {\n return dataList\n }\n let obv\n let sumObv = 0.0\n let maObv\n let sumVa = 0.0\n\n return calc(dataList, (i) => {\n const volume = dataList[i].volume\n if (i === 0) {\n obv = volume\n sumVa += volume\n } else {\n const refClosePrice = dataList[i - 1].close\n const closePrice = dataList[i].close\n const va = closePrice > refClosePrice ? volume : -volume\n\n sumVa += va\n obv = closePrice === refClosePrice ? 0.0 : sumVa\n }\n sumObv += obv\n if (i < params[0]) {\n maObv = sumObv / (i + 1)\n } else {\n sumObv -= dataList[i - params[0]].obv.obv\n maObv = sumObv / params[0]\n }\n dataList[i].obv = { obv, maObv }\n })\n}\n\n/**\n * 计算vr指标\n * 默认参数24 , 30\n * VR=(AVS+1/2CVS)/(BVS+1/2CVS)\n * 24天以来凡是股价上涨那一天的成交量都称为AV,将24天内的AV总和相加后称为AVS\n * 24天以来凡是股价下跌那一天的成交量都称为BV,将24天内的BV总和相加后称为BVS\n * 24天以来凡是股价不涨不跌,则那一天的成交量都称为CV,将24天内的CV总和相加后称为CVS\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.VR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let avs = 0\n let bvs = 0\n let cvs = 0\n let vr = 0\n let maVr\n let sumVr = 0\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n const openPrice = dataList[i].open\n const volume = dataList[i].volume\n if (closePrice > openPrice) {\n avs += volume\n } else if (closePrice < openPrice) {\n bvs += volume\n } else {\n cvs += volume\n }\n\n if (i > params[0] - 1) {\n const agoClosePrice = dataList[i - params[0]].close\n const agoOpenPrice = dataList[i - params[0]].open\n const agoVolume = dataList[i - params[0]].volume\n if (agoClosePrice > agoOpenPrice) {\n avs -= agoVolume\n } else if (agoClosePrice < agoOpenPrice) {\n bvs -= agoVolume\n } else {\n cvs -= agoVolume\n }\n }\n\n const v = bvs + 1 / 2 * cvs\n if (v !== 0) {\n vr = (avs + 1 / 2 * cvs) / v * 100\n }\n sumVr += vr\n if (i < params[1]) {\n maVr = sumVr / (i + 1)\n } else {\n sumVr -= dataList[i - params[1]].vr.vr\n maVr = sumVr / params[1]\n }\n dataList[i].vr = { vr, maVr }\n })\n}\n\n/**\n * 计算wr指标\n * 默认参数13 34 89\n * 公式 WR(N) = 100 * [ HIGH(N)-C ] / [ HIGH(N)-LOW(N) ]\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.WR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n let wr1\n let wr2\n let wr3\n let h1 = Number.MIN_SAFE_INTEGER\n let l1 = Number.MAX_SAFE_INTEGER\n let h2 = Number.MIN_SAFE_INTEGER\n let l2 = Number.MAX_SAFE_INTEGER\n let h3 = Number.MIN_SAFE_INTEGER\n let l3 = Number.MAX_SAFE_INTEGER\n\n let hl1\n let hl2\n let hl3\n\n return calc(dataList, (i) => {\n const closePrice = dataList[i].close\n const highPrice = dataList[i].high\n const lowPrice = dataList[i].low\n\n if (i < params[0]) {\n h1 = Math.max(highPrice, h1)\n l1 = Math.min(lowPrice, l1)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[0], i))\n h1 = highLowPriceArray[0]\n l1 = highLowPriceArray[1]\n }\n hl1 = h1 - l1\n wr1 = hl1 !== 0 ? (h1 - closePrice) / hl1 * 100 : 0.0\n\n if (i < params[1]) {\n h2 = Math.max(highPrice, h2)\n l2 = Math.min(lowPrice, l2)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[1], i))\n h2 = highLowPriceArray[0]\n l2 = highLowPriceArray[1]\n }\n hl2 = h2 - l2\n wr2 = hl2 !== 0 ? (h2 - closePrice) / hl2 * 100 : 0.0\n\n if (i < params[2]) {\n h3 = Math.max(highPrice, h3)\n l3 = Math.min(lowPrice, l3)\n } else {\n const highLowPriceArray = getHighLow(dataList.slice(i - params[2], i))\n h3 = highLowPriceArray[0]\n l3 = highLowPriceArray[1]\n }\n hl3 = h3 - l3\n wr3 = hl3 !== 0.0 ? (h3 - closePrice) / hl3 * 100 : 0.0\n\n dataList[i].wr = { wr1, wr2, wr3 }\n })\n}\n\n/**\n * 计算mtm指标\n * 默认参数6 10\n * 公式 MTM(N日)=C-CN\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.MTM] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n let mtm\n let mtmSum = 0\n let mtmMa\n return calc(dataList, (i) => {\n if (i < params[0]) {\n mtm = 0.0\n mtmMa = 0.0\n } else {\n const closePrice = dataList[i].close\n mtm = closePrice - dataList[i - params[0]].close\n mtmSum += mtm\n if (i < params[0] + params[1]) {\n mtmMa = mtmSum / (i - params[0] + 1)\n } else {\n mtmMa = mtmSum / params[1]\n mtmSum -= dataList[i - params[1]].mtm.mtm\n }\n }\n dataList[i].mtm = { mtm, mtmMa }\n })\n}\n\n/**\n * 简易波动指标\n * 默认参数N为14,默认参数M为9\n * 公式:\n * A=(今日最高+今日最低)/2\n * B=(前日最高+前日最低)/2\n * C=今日最高-今日最低\n * EM=(A-B)*C/今日成交额\n * EMV=N日内EM的累和\n * MAEMV=EMV的M日的简单移动平均\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.EMV] = function (dataList, params) {\n if (!checkParamsWithSize(params, 2)) {\n return dataList\n }\n\n let emv = 0\n let maEmv\n let sumEmv = 0\n let em = 0\n\n const emList = []\n\n return calc(dataList, (i) => {\n if (i > 0) {\n const turnover = dataList[i].turnover\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n const preHighestPrice = dataList[i - 1].high\n const preLowestPrice = dataList[i - 1].low\n const highSubLow = highestPrice - lowestPrice\n const halfHighAddLow = (highestPrice + lowestPrice) / 2\n const preHalfHighAddLow = (preHighestPrice + preLowestPrice) / 2\n em = (halfHighAddLow - preHalfHighAddLow) * highSubLow / turnover\n }\n emList.push(em)\n if (i < params[0]) {\n emv += em\n } else {\n emv -= emList[i - params[0]]\n }\n sumEmv += emv\n if (i < params[1]) {\n maEmv = sumEmv / (i + 1)\n } else {\n sumEmv -= dataList[i - params[1]].emv.emv\n maEmv = sumEmv / params[1]\n }\n dataList[i].emv = { emv, maEmv }\n })\n}\n\n/**\n * 计算sar\n * 默认参数2, 2, 20(开始值,步长,最大值)\n * @param dataList\n * @param params\n * @return\n */\ncalcIndicator[TechnicalIndicatorType.SAR] = function (dataList, params) {\n if (!checkParamsWithSize(params, 3)) {\n return dataList\n }\n const startAf = params[0] / 100\n const step = params[1] / 100\n const maxAf = params[2] / 100\n // 加速因子\n let af = startAf\n // 极值\n let ep = -100\n // 判断是上涨还是下跌 false:下跌\n let isIncreasing = false\n let sar = 0\n\n return calc(dataList, (i) => {\n // 上一个周期的sar\n const preSar = sar\n const highestPrice = dataList[i].high\n const lowestPrice = dataList[i].low\n if (isIncreasing) {\n // 上涨\n if (ep === -100 || ep < highestPrice) {\n // 重新初始化值\n ep = highestPrice\n af = Math.min(af + step, maxAf)\n }\n sar = preSar + af * (ep - preSar)\n const lowestPriceMin = Math.min(dataList[Math.max(1, i) - 1].low, lowestPrice)\n if (sar > dataList[i].low) {\n sar = ep\n // 重新初始化值\n af = startAf\n ep = -100\n isIncreasing = !isIncreasing\n } else if (sar > lowestPriceMin) {\n sar = lowestPriceMin\n }\n } else {\n if (ep === -100 || ep > lowestPrice) {\n // 重新初始化值\n ep = lowestPrice\n af = Math.min(af + step, maxAf)\n }\n sar = preSar + af * (ep - preSar)\n const highestPriceMax = Math.max(dataList[Math.max(1, i) - 1].high, highestPrice)\n if (sar < dataList[i].high) {\n sar = ep\n // 重新初始化值\n af = 0\n ep = -100\n isIncreasing = !isIncreasing\n } else if (sar < highestPriceMax) {\n sar = highestPriceMax\n }\n }\n dataList[i].sar = { sar }\n })\n}\n\n/**\n * 计算\n * @param dataList\n * @param calcIndicator\n */\nfunction calc (dataList, calcIndicator) {\n const dataSize = dataList.length\n for (let i = 0; i < dataSize; i++) {\n calcIndicator(i)\n }\n return dataList\n}\n\n/**\n * 计算布林指标中的标准差\n *\n * @param list\n * @param ma\n * @return\n */\nfunction getBollMd (list, ma) {\n let sum = 0\n for (let i = 0; i < list.length; i++) {\n const closeMa = list[i].close - ma\n sum += closeMa * closeMa\n }\n const b = sum > 0\n sum = Math.abs(sum)\n const md = Math.sqrt(sum / list.length)\n return b ? md : -1 * md\n}\n\n/**\n * 获取list中的最大的最高价\n *\n * @param list\n * @return\n */\nfunction getHigh (list) {\n let high = 0\n if (list && list.length > 0) {\n const size = list.length\n high = list[0].high\n for (let i = 1; i < size; i++) {\n high = Math.max(list[i].high, high)\n }\n }\n return high\n}\n\n/**\n * 获取list中的最小的最低价\n *\n * @param list\n * @return\n */\nfunction getLow (list) {\n let low = 0\n if (list && list.length > 0) {\n const size = list.length\n low = list[0].low\n for (let i = 1; i < size; i++) {\n low = Math.min(list[i].low, low)\n }\n }\n return low\n}\n\n/**\n * 获取最大最小值\n * @param list\n * @returns {number[]}\n */\nfunction getHighLow (list) {\n let high = 0\n let low = 0\n if (list && list.length > 0) {\n const size = list.length\n high = list[0].high\n low = list[0].low\n for (let i = 1; i < size; i++) {\n high = Math.max(list[i].high, high)\n low = Math.min(list[i].low, low)\n }\n }\n return [high, low]\n}\n\n/**\n * 检查参数\n * @param params\n */\nfunction checkParams (params) {\n return params && isArray(params)\n}\n\n/**\n * 检查参数, 并检查参数个数\n * @param params\n * @param paramsSize\n */\nfunction checkParamsWithSize (params, paramsSize) {\n return checkParams(params) && params.length === paramsSize\n}\n","import { isNumber, isObject } from './typeChecks'\n\n/**\n * 格式化值\n * @param data\n * @param key\n * @param defaultValue\n * @returns {string|*}\n */\nexport function formatValue (data, key, defaultValue = '--') {\n if (data && isObject(data)) {\n const value = data[key]\n if (value || value === 0 || value === false) {\n return value\n }\n }\n return defaultValue\n}\n\n/**\n * 格式化时间\n * @param timestamp\n * @param format\n * @param timezone\n * @returns {string}\n */\nconst locales = 'en-us'\nexport function formatDate (timestamp, format, timezone) {\n if (timestamp && isNumber(timestamp)) {\n const date = new Date(timestamp)\n let dateTimeString\n try {\n dateTimeString = new Intl.DateTimeFormat(\n locales, { hour12: false, timeZone: timezone, year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' }\n ).format(date)\n } catch (e) {\n dateTimeString = new Intl.DateTimeFormat(\n locales, { hour12: false, year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric' }\n ).format(date)\n }\n const dateString = dateTimeString.match(/^[\\d]{1,2}\\/[\\d]{1,2}\\/[\\d]{4}/)[0]\n const dateStringArray = dateString.split('/')\n const month = `${dateStringArray[0].length === 1 ? `0${dateStringArray[0]}` : dateStringArray[0]}`\n const day = `${dateStringArray[1].length === 1 ? `0${dateStringArray[1]}` : dateStringArray[1]}`\n let timeString = dateTimeString.match(/[\\d]{2}:[\\d]{2}$/)[0]\n // 这里将小时24转换成00\n if (timeString.match(/^[\\d]{2}/)[0] === '24') {\n timeString = timeString.replace(/^[\\d]{2}/, '00')\n }\n switch (format) {\n case 'YYYY': {\n return dateStringArray[2]\n }\n case 'YYYY-MM': {\n return `${dateStringArray[2]}-${month}`\n }\n case 'YYYY-MM-DD': {\n return `${dateStringArray[2]}-${month}-${day}`\n }\n case 'YYYY-MM-DD hh:mm': {\n return `${dateStringArray[2]}-${month}-${day} ${timeString}`\n }\n case 'MM-DD': {\n return `${month}-${day}`\n }\n case 'hh:mm': {\n return timeString\n }\n default: {\n return `${month}-${day} ${timeString}`\n }\n }\n }\n return '--'\n}\n\n/**\n * 格式化精度\n */\nexport function formatPrecision (value, precision = 2) {\n const v = +value\n if ((v || v === 0) && isNumber(v)) {\n return value.toFixed(precision)\n }\n return `${v}`\n}\n\n/**\n * 格式化大数据\n * @param value\n */\nexport function formatBigNumber (value) {\n if (isNumber(+value)) {\n if (value > 50000) {\n return `${+((value / 1000).toFixed(1))}K`\n }\n if (value > 5000000) {\n return `${+((value / 1000000).toFixed(3))}M`\n }\n return `${value}`\n }\n return '--'\n}\n","import { isArray, isObject, merge, clone, isFunction, isBoolean } from '../utils/typeChecks'\nimport { defaultStyleOptions } from './options/styleOptions'\nimport { defaultTechnicalIndicatorParamOptions, TechnicalIndicatorType } from './options/technicalIndicatorParamOptions'\nimport { defaultPrecisionOptions } from './options/precisionOptions'\n\nimport calcIndicator from './calcIndicator'\nimport { formatValue } from '../utils/format'\n\nexport const InvalidateLevel = {\n FLOAT_LAYER: 1,\n GRAPHIC_MARK: 2,\n FULL: 3\n}\n\nexport const GraphicMarkType = {\n NONE: 'none',\n HORIZONTAL_STRAIGHT_LINE: 'horizontalStraightLine',\n VERTICAL_STRAIGHT_LINE: 'verticalStraightLine',\n STRAIGHT_LINE: 'straightLine',\n HORIZONTAL_RAY_LINE: 'horizontalRayLine',\n VERTICAL_RAY_LINE: 'verticalRayLine',\n RAY_LINE: 'rayLine',\n HORIZONTAL_SEGMENT_LINE: 'horizontalSegmentLine',\n VERTICAL_SEGMENT_LINE: 'verticalSegmentLine',\n SEGMENT_LINE: 'segmentLine',\n PRICE_LINE: 'priceLine',\n PRICE_CHANNEL_LINE: 'priceChannelLine',\n PARALLEL_STRAIGHT_LINE: 'parallelStraightLine',\n FIBONACCI_LINE: 'fibonacciLine'\n}\n\nconst BAR_MARGIN_SPACE_RATE = 0.25\n\nconst MAX_DATA_SPACE = 30\nconst MIN_DATA_SPACE = 2\n\nexport default class ChartData {\n constructor (styleOptions, invalidateHandler) {\n // 刷新持有者\n this._invalidateHandler = invalidateHandler\n // 样式配置\n this._styleOptions = clone(defaultStyleOptions)\n merge(this._styleOptions, styleOptions)\n // 指标参数配置\n this._technicalIndicatorParamOptions = clone(defaultTechnicalIndicatorParamOptions)\n // 精度配置\n this._precisionOptions = clone(defaultPrecisionOptions)\n // 时区\n this._timezone = null\n\n // 数据源\n this._dataList = []\n\n // 是否在加载中\n this._loading = true\n // 加载更多回调\n this._loadMoreCallback = null\n // 还有更多\n this._more = true\n\n // 可见区域数据占用的空间\n this._totalDataSpace = 0\n // 向右偏移的空间\n this._offsetRightSpace = 50\n // 开始绘制的索引\n this._from = 0\n // 结束的索引\n this._to = 0\n // 绘制区间数据数量\n this._range = 0\n // 每一条数据的空间\n this._dataSpace = 4\n // bar的空间\n this._barSpace = this._calcBarSpace()\n\n // 十字光标位置\n this._crossHairPoint = null\n // 标识十字光标在哪个series\n this._crossHairSeriesTag = null\n // 用来记录开始拖拽时数据绘制开始位置\n this._preFrom = 0\n\n // 当前绘制的标记图形的类型\n this._graphicMarkType = GraphicMarkType.NONE\n // 标记图形点\n this._graphicMarkPoint = null\n // 拖拽标记图形标记\n this._dragGraphicMarkFlag = false\n // 绘图标记数据\n this._graphicMarkDatas = {\n // 水平直线\n horizontalStraightLine: [],\n // 垂直直线\n verticalStraightLine: [],\n // 直线\n straightLine: [],\n // 水平射线\n horizontalRayLine: [],\n // 垂直射线\n verticalRayLine: [],\n // 射线\n rayLine: [],\n // 水平线段\n horizontalSegmentLine: [],\n // 垂直线段\n verticalSegmentLine: [],\n // 线段\n segmentLine: [],\n // 价格线\n priceLine: [],\n // 平行直线\n parallelStraightLine: [],\n // 价格通道线\n priceChannelLine: [],\n // 斐波那契线\n fibonacciLine: []\n }\n }\n\n /**\n * 加载更多持有者\n * @private\n */\n _loadMoreHandler () {\n // 有更多并且没有在加载则去加载更多\n if (this._more && !this._loading && this._loadMoreCallback && isFunction(this._loadMoreCallback)) {\n this._loading = true\n this._loadMoreCallback(formatValue(this._dataList[0], 'timestamp'))\n }\n }\n\n /**\n * 计算绘制区间\n * @private\n */\n _calcRange () {\n this._range = Math.floor(this._totalDataSpace / this._dataSpace)\n this.adjustFromTo()\n }\n\n /**\n * 计算一条柱子的空间\n * @returns {number}\n * @private\n */\n _calcBarSpace () {\n return (1 - BAR_MARGIN_SPACE_RATE) * this._dataSpace\n }\n\n /**\n * 计算rang dif\n * @private\n */\n _calcRangDif () {\n const offsetRightRange = Math.floor(this._offsetRightSpace / this._dataSpace)\n return this._range - offsetRightRange\n }\n\n /**\n * 内部用来设置一条数据的空间\n * @param dataSpace\n * @returns {boolean}\n * @private\n */\n _innerSetDataSpace (dataSpace) {\n if (!dataSpace || dataSpace < MIN_DATA_SPACE || dataSpace > MAX_DATA_SPACE || this._dataSpace === dataSpace) {\n return false\n }\n this._dataSpace = dataSpace\n this._barSpace = this._calcBarSpace()\n this._calcRange()\n return true\n }\n\n /**\n * 获取样式配置\n */\n styleOptions () {\n return this._styleOptions\n }\n\n applyStyleOptions (options) {\n merge(this._styleOptions, options)\n }\n\n /**\n * 获取计算指标参数配置\n */\n technicalIndicatorParamOptions () {\n return this._technicalIndicatorParamOptions\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n applyTechnicalIndicatorParams (technicalIndicatorType, params = []) {\n if (this._technicalIndicatorParamOptions.hasOwnProperty(technicalIndicatorType)) {\n this._technicalIndicatorParamOptions[technicalIndicatorType] = params\n }\n }\n\n /**\n * 精度配置\n */\n precisionOptions () {\n return this._precisionOptions\n }\n\n /**\n * 设置时区\n * @param timezone\n */\n setTimezone (timezone) {\n this._timezone = timezone\n }\n\n /**\n * 获取时区\n * @returns {null}\n */\n timezone () {\n return this._timezone\n }\n\n /**\n * 加载精度\n * @param pricePrecision\n * @param volumePrecision\n */\n applyPrecision (pricePrecision, volumePrecision) {\n if ((pricePrecision || pricePrecision === 0) && !(pricePrecision < 0)) {\n this._precisionOptions.price = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.MA] = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.BOLL] = pricePrecision\n this._precisionOptions[TechnicalIndicatorType.SAR] = pricePrecision\n }\n if ((volumePrecision || volumePrecision === 0) && !(volumePrecision < 0)) {\n this._precisionOptions.volume = volumePrecision\n this._precisionOptions[TechnicalIndicatorType.VOL] = volumePrecision\n }\n }\n\n /**\n * 计算指标\n * @param technicalIndicatorType\n * @returns {boolean}\n */\n calcTechnicalIndicator (technicalIndicatorType) {\n if (technicalIndicatorType === TechnicalIndicatorType.NO) {\n return true\n }\n const calcFun = calcIndicator[technicalIndicatorType]\n if (calcFun) {\n this._dataList = calcFun(this._dataList, this._technicalIndicatorParamOptions[technicalIndicatorType])\n return true\n }\n return false\n }\n\n /**\n * 获取数据源\n * @returns {[]|*[]}\n */\n dataList () {\n return this._dataList\n }\n\n /**\n * 清空数据源\n */\n clearDataList () {\n this._more = true\n this._loading = true\n this._dataList = []\n this._from = 0\n this._to = 0\n }\n\n /**\n * 添加数据\n * @param data\n * @param pos\n * @param more\n */\n addData (data, pos, more) {\n if (isObject(data)) {\n if (isArray(data)) {\n if (this._dataList.length === 0) {\n this._loading = false\n this._more = isBoolean(more) ? more : true\n this._dataList = data.concat(this._dataList)\n const rangeDif = this._calcRangDif()\n this._from = this._dataList.length - rangeDif\n this.adjustFromTo()\n } else {\n this._loading = false\n this._more = more\n this._dataList = data.concat(this._dataList)\n this._from += data.length\n this.adjustFromTo()\n }\n } else {\n if (pos >= this._dataList.length) {\n const oldDataSize = this._dataList.length\n this._dataList.push(data)\n if (this._from !== 0) {\n if (this._to === oldDataSize) {\n this._to += 1\n const rangeDif = this._calcRangDif()\n if (this._to - this._from > rangeDif) {\n this._from += 1\n }\n }\n } else {\n const rangeDif = this._calcRangDif()\n if (this._dataList.length < rangeDif) {\n this._to = this._dataList.length\n } else {\n this._from += 1\n this._to += 1\n }\n }\n } else {\n this._dataList[pos] = data\n }\n }\n }\n }\n\n /**\n * 获取一条数据的空间\n * @returns {number}\n */\n dataSpace () {\n return this._dataSpace\n }\n\n /**\n * 获取绘制一条数据的空间(不包括bar之间的间隙)\n * @returns {*}\n */\n barSpace () {\n return this._barSpace\n }\n\n /**\n * 设置一条数据的空间\n * @param dataSpace\n */\n setDataSpace (dataSpace) {\n if (this._innerSetDataSpace(dataSpace)) {\n this._invalidateHandler()\n }\n }\n\n /**\n * 设置可见区域数据占用的总空间\n * @param totalSpace\n */\n setTotalDataSpace (totalSpace) {\n if (this._totalDataSpace === totalSpace) {\n return\n }\n this._totalDataSpace = totalSpace\n this._calcRange()\n }\n\n /**\n * 设置右边可以偏移的空间\n * @param space\n */\n setOffsetRightSpace (space) {\n if (space < 0) {\n space = 0\n }\n this._offsetRightSpace = space\n }\n\n /**\n * 获取数据绘制起点\n * @returns {number}\n */\n from () {\n return this._from\n }\n\n /**\n * 获取数据绘制终点\n * @returns {number}\n */\n to () {\n return this._to\n }\n\n /**\n * 获取绘制数据个数\n * @returns {number}\n */\n range () {\n return this._range\n }\n\n /**\n * 获取十字光标点\n * @returns {null}\n */\n crossHairPoint () {\n return this._crossHairPoint\n }\n\n /**\n * 获取十字光标点所在的series的标识\n * @returns {null}\n */\n crossHairSeriesTag () {\n return this._crossHairSeriesTag\n }\n\n /**\n * 设置十字光标点所在的series的标识\n * @param tag\n */\n setCrossHairSeriesTag (tag) {\n this._crossHairSeriesTag = tag\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n }\n\n /**\n * 设置十字光标点\n * @param point\n */\n setCrossHairPoint (point) {\n this._crossHairPoint = point\n }\n\n /**\n * 开始拖拽\n */\n startDrag () {\n this._preFrom = this._from\n }\n\n /**\n * 拖动\n * @param distance\n */\n drag (distance) {\n if (Math.abs(distance) < this._dataSpace / 2) {\n return\n }\n let distanceRange = distance / this._dataSpace\n distanceRange = distanceRange < 0 ? Math.floor(distanceRange) : Math.ceil(distanceRange)\n if (distanceRange === 0) {\n this._loadMoreHandler()\n return\n }\n if (distanceRange > 0) {\n // 右移\n if (this._from === 0) {\n this._loadMoreHandler(formatValue(this._dataList[0], 'timestamp'))\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n return\n }\n } else {\n // 左移\n const rangeDif = this._calcRangDif()\n const dataSize = this._dataList.length\n if (this._from === dataSize - rangeDif) {\n this._invalidateHandler(InvalidateLevel.FLOAT_LAYER)\n return\n }\n }\n this._from = this._preFrom - distanceRange\n this.adjustFromTo()\n if (this._from === 0) {\n this._loadMoreHandler()\n }\n this._invalidateHandler()\n }\n\n /**\n * 缩放\n * @param zoomScale\n */\n zoom (zoomScale) {\n const dataSpace = this._dataSpace + zoomScale * (this._dataSpace / 10)\n if (this._innerSetDataSpace(dataSpace)) {\n this._invalidateHandler()\n }\n }\n\n /**\n * 调整from和to\n */\n adjustFromTo () {\n const dataSize = this._dataList.length\n const rangeDif = this._calcRangDif()\n if (this._from > dataSize - rangeDif) {\n this._from = dataSize - rangeDif\n }\n if (this._from < 0) {\n this._from = 0\n }\n this._to = this._from + this._range\n if (this._to > dataSize) {\n this._to = dataSize\n }\n }\n\n /**\n * 获取图形标记类型\n * @returns {string}\n */\n graphicMarkType () {\n return this._graphicMarkType\n }\n\n /**\n * 设置图形标记类型\n * @param graphicMarkType\n */\n setGraphicMarkType (graphicMarkType) {\n this._graphicMarkType = graphicMarkType\n }\n\n /**\n * 获取图形标记拖拽标记\n * @returns {boolean}\n */\n dragGraphicMarkFlag () {\n return this._dragGraphicMarkFlag\n }\n\n /**\n * 设置图形标记拖拽标记\n * @param flag\n */\n setDragGraphicMarkFlag (flag) {\n this._dragGraphicMarkFlag = flag\n }\n\n /**\n * 获取图形标记开始的点\n * @returns {null}\n */\n graphicMarkPoint () {\n return this._graphicMarkPoint\n }\n\n /**\n * 设置图形标记开始的点\n * @param point\n */\n setGraphicMarkPoint (point) {\n this._graphicMarkPoint = point\n }\n\n /**\n * 获取图形标记的数据\n * @returns {{straightLine: [], verticalRayLine: [], rayLine: [], segmentLine: [], horizontalRayLine: [], horizontalSegmentLine: [], fibonacciLine: [], verticalStraightLine: [], priceChannelLine: [], priceLine: [], verticalSegmentLine: [], horizontalStraightLine: [], parallelStraightLine: []}}\n */\n graphicMarkData () {\n return this._graphicMarkDatas\n }\n\n /**\n * 设置图形标记的数据\n * @param datas\n */\n setGraphicMarkData (datas) {\n this._graphicMarkDatas = datas\n this._invalidateHandler(InvalidateLevel.GRAPHIC_MARK)\n }\n\n /**\n * 设置加载更多\n * @param callback\n */\n loadMore (callback) {\n this._loadMoreCallback = callback\n }\n}\n","/**\n * 获取屏幕比\n * @param ctx\n * @returns {number}\n */\nexport function getPixelRatio (ctx) {\n const backingStore = ctx.backingStorePixelRatio ||\n ctx.webkitBackingStorePixelRatio ||\n ctx.mozBackingStorePixelRatio ||\n ctx.msBackingStorePixelRatio ||\n ctx.oBackingStorePixelRatio ||\n ctx.backingStorePixelRatio || 1\n return (window.devicePixelRatio || 1) / backingStore\n}\n\n/**\n * 测量文字的宽度\n * @param ctx\n * @param text\n * @returns {number}\n */\nexport function calcTextWidth (ctx, text) {\n return ctx.measureText(text).width\n}\n\n/**\n * 获取字体\n * @param fontSize\n * @returns {string}\n */\nexport function getFont (fontSize) {\n return `${fontSize}px Arial`\n}\n\n/**\n * 绘制水平直线\n * @param ctx\n * @param y\n * @param left\n * @param right\n */\nexport function drawHorizontalLine (ctx, y, left, right) {\n ctx.beginPath()\n const correction = (ctx.lineWidth % 2) ? 0.5 : 0\n ctx.moveTo(left, y + correction)\n ctx.lineTo(right, y + correction)\n ctx.stroke()\n ctx.closePath()\n}\n\n/**\n * 绘制垂直直线\n * @param ctx\n * @param x\n * @param top\n * @param bottom\n */\nexport function drawVerticalLine (ctx, x, top, bottom) {\n ctx.beginPath()\n const correction = (ctx.lineWidth % 2) ? 0.5 : 0\n ctx.moveTo(x + correction, top)\n ctx.lineTo(x + correction, bottom)\n ctx.stroke()\n ctx.closePath()\n}\n\n/**\n * 绘制线\n * @param ctx\n * @param drawFuc\n */\nexport function strokeInPixel (ctx, drawFuc) {\n ctx.save()\n if (ctx.lineWidth % 2) {\n ctx.translate(0.5, 0.5)\n }\n drawFuc()\n ctx.restore()\n}\n","import { InvalidateLevel } from '../data/ChartData'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class Series {\n constructor (props) {\n this._container = props.container\n this._chartData = props.chartData\n this._width = -1\n this._height = -1\n this._initBefore(props)\n this._initElement()\n this._mainWidget = this._createMainWidget(this._mainWidgetCell, props)\n this._yAxisWidget = this._createYAxisWidget(this._yAxisWidgetCell, props)\n }\n\n _initBefore (props) {}\n\n _initElement () {\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.position = 'relative'\n this._element.style.overflow = 'hidden'\n this._element.style.width = '100%'\n this._mainWidgetCell = this._createCell()\n this._yAxisWidgetCell = this._createCell()\n this._element.appendChild(this._mainWidgetCell)\n this._element.appendChild(this._yAxisWidgetCell)\n const lastElement = this._container.lastChild\n if (lastElement) {\n this._container.insertBefore(this._element, lastElement)\n } else {\n this._container.appendChild(this._element)\n }\n }\n\n _createCell () {\n const cell = document.createElement('div')\n cell.style.display = 'table-cell'\n cell.style.position = 'absolute'\n cell.style.margin = '0'\n cell.style.padding = '0'\n cell.style.top = '0'\n cell.style.zIndex = '1'\n return cell\n }\n\n /**\n * 创建主组件\n * @param container\n * @param props\n * @private\n */\n _createMainWidget (container, props) {}\n\n /**\n * 创建y轴组件\n * @param container\n * @param props\n * @private\n */\n _createYAxisWidget (container, props) {}\n\n /**\n * 设置cell的尺寸\n * @param cell\n * @param size\n * @private\n */\n _setCellSize (cell, size) {\n cell.style.left = `${size.left}px`\n cell.style.width = `${size.width}px`\n cell.style.height = `${size.height}px`\n }\n\n /**\n * 计算轴\n * @private\n */\n _computeAxis () {}\n\n /**\n * 获取宽度\n * @returns {number}\n */\n width () {\n return this._element.offsetWidth\n }\n\n /**\n * 获取高度\n */\n height () {\n return this._height\n }\n\n /**\n * 设置临时高度\n * @param height\n */\n setTempHeight (height) {\n this._height = height\n }\n\n /**\n * 设置尺寸\n * @param mainWidgetSize\n * @param yAxisWidgetSize\n */\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._height = mainWidgetSize.height\n this._element.style.height = `${mainWidgetSize.height}px`\n this._setCellSize(this._mainWidgetCell, mainWidgetSize)\n this._setCellSize(this._yAxisWidgetCell, yAxisWidgetSize)\n this._mainWidget.setSize(mainWidgetSize.width, this._height)\n if (this._yAxisWidget) {\n this._yAxisWidget.setSize(yAxisWidgetSize.width, yAxisWidgetSize.height)\n }\n }\n\n /**\n * 刷新\n * @param level\n */\n invalidate (level) {\n if (level === InvalidateLevel.FULL) {\n this._computeAxis()\n }\n if (level !== InvalidateLevel.GRAPHIC_MARK) {\n if (this._yAxisWidget) {\n this._yAxisWidget.invalidate(level)\n }\n }\n this._mainWidget.invalidate(level)\n }\n\n getImage (includeFloatLayer, includeGraphicMark) {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._element.offsetWidth\n const height = this._element.offsetHeight\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n\n const mainWidgetWidth = this._mainWidgetCell.offsetWidth\n const mainWidgetHeight = this._mainWidgetCell.offsetHeight\n const mainWidgetOffsetLeft = parseInt(this._mainWidgetCell.style.left)\n\n const yAxisWidgetWidth = this._yAxisWidgetCell.offsetWidth\n const yAxisWidgetHeight = this._yAxisWidgetCell.offsetHeight\n const yAxisWidgetOffsetLeft = parseInt(this._yAxisWidgetCell.style.left)\n\n ctx.drawImage(\n this._mainWidget.getImage(includeFloatLayer, includeGraphicMark),\n mainWidgetOffsetLeft, 0,\n mainWidgetWidth, mainWidgetHeight\n )\n if (this._yAxisWidget) {\n ctx.drawImage(\n this._yAxisWidget.getImage(includeFloatLayer),\n yAxisWidgetOffsetLeft, 0,\n yAxisWidgetWidth, yAxisWidgetHeight\n )\n }\n return canvas\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._container.removeChild(this._element)\n delete this\n }\n}\n","import { InvalidateLevel } from '../data/ChartData'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class Widget {\n constructor (props) {\n this._width = 0\n this._height = 0\n this._initElement(props.container)\n this._mainView = this._createMainView(this._element, props)\n this._expandView = this._createExpandView(this._element, props)\n this._floatLayerView = this._createFloatLayerView(this._element, props)\n }\n\n /**\n * 初始化element\n * @param container\n * @private\n */\n _initElement (container) {\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.width = '100%'\n this._element.style.height = '100%'\n this._element.style.position = 'relative'\n this._element.style.overflow = 'hidden'\n container.appendChild(this._element)\n }\n\n /**\n * 创建主view\n * @param container\n * @param props\n * @private\n */\n _createMainView (container, props) {}\n\n /**\n * 创建拓展的view\n * @param container\n * @param props\n * @private\n */\n _createExpandView (container, props) {}\n\n /**\n * 创建浮层view\n * @param container\n * @param props\n * @private\n */\n _createFloatLayerView (container, props) {}\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n this._width = width\n this._height = height\n this._mainView.setSize(width, height)\n this._floatLayerView.setSize(width, height)\n }\n\n /**\n * 更新\n * @param level\n */\n invalidate (level) {\n switch (level) {\n case InvalidateLevel.FLOAT_LAYER: {\n this._floatLayerView.flush()\n break\n }\n case InvalidateLevel.FULL: {\n this._mainView.flush()\n this._floatLayerView.flush()\n break\n }\n default: {\n break\n }\n }\n }\n\n /**\n * 将widget转换成图片\n * @param includeFloatLayer\n * @param includeGraphicMark\n * @returns {HTMLCanvasElement}\n */\n getImage (includeFloatLayer, includeGraphicMark) {\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n canvas.style.width = `${this._width}px`\n canvas.style.height = `${this._height}px`\n canvas.width = this._width * pixelRatio\n canvas.height = this._height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n\n ctx.drawImage(this._mainView.getImage(), 0, 0, this._width, this._height)\n\n if (includeGraphicMark && this._expandView) {\n ctx.drawImage(this._expandView.getImage(), 0, 0, this._width, this._height)\n }\n if (includeFloatLayer) {\n ctx.drawImage(this._floatLayerView.getImage(), 0, 0, this._width, this._height)\n }\n return canvas\n }\n}\n","/**\n * requestAnimationFrame兼容\n * @param fn\n */\nexport function requestAnimationFrame (fn) {\n if (!window.requestAnimationFrame) {\n return window.setTimeout(() => { fn() }, 1000 / 60)\n }\n return window.requestAnimationFrame(fn)\n}\n\n/**\n * cancelAnimationFrame兼容\n * @param id\n */\nexport function cancelAnimationFrame (id) {\n if (!window.cancelAnimationFrame) {\n clearTimeout(id)\n }\n window.cancelAnimationFrame(id)\n}\n","import { getPixelRatio } from '../utils/canvas'\nimport { cancelAnimationFrame, requestAnimationFrame } from '../utils/compatible'\n\nclass View {\n constructor (container, chartData) {\n this._chartData = chartData\n this._initCanvas(container)\n }\n\n /**\n * 初始化画布\n * @param container\n * @private\n */\n _initCanvas (container) {\n this._canvas = document.createElement('canvas')\n this._canvas.style.position = 'absolute'\n this._canvas.style.right = '0'\n this._canvas.style.left = '0'\n this._canvas.style.zIndex = '2'\n this._ctx = this._canvas.getContext('2d')\n container.appendChild(this._canvas)\n }\n\n /**\n * 重新绘制\n * @param extendFun\n * @private\n */\n _redraw (extendFun) {\n this._ctx.clearRect(0, 0, this._width, this._height)\n if (extendFun) {\n extendFun()\n }\n this._draw()\n }\n\n /**\n * 绘制\n */\n _draw () {\n }\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n if (this._width !== width || this._height !== height) {\n this._redraw(() => {\n const pixelRatio = getPixelRatio(this._ctx)\n this._width = width\n this._height = height\n this._canvas.style.top = '0'\n this._canvas.style.width = `${width}px`\n this._canvas.style.height = `${height}px`\n this._canvas.width = width * pixelRatio\n this._canvas.height = height * pixelRatio\n this._ctx.scale(pixelRatio, pixelRatio)\n // this._ctx.translate(0.5, 0.5)\n })\n }\n }\n\n /**\n * 刷新\n */\n flush () {\n if (this.requestAnimationId) {\n cancelAnimationFrame(this.requestAnimationId)\n }\n this.requestAnimationId = requestAnimationFrame(() => {\n this._redraw()\n })\n }\n\n /**\n * 获取图片\n * @returns {HTMLCanvasElement}\n */\n getImage () {\n return this._canvas\n }\n}\n\nexport default View\n","import View from './View'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { LineStyle } from '../data/options/styleOptions'\nimport { drawHorizontalLine, drawVerticalLine, strokeInPixel } from '../utils/canvas'\n\nexport default class TechnicalIndicatorView extends View {\n constructor (container, chartData, xAxis, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawGrid()\n this._drawTechnicalIndicator()\n }\n\n /**\n * 绘制网格\n * @private\n */\n _drawGrid () {\n const grid = this._chartData.styleOptions().grid\n if (!grid.display) {\n return\n }\n const horizontalGrid = grid.horizontal\n if (horizontalGrid.display) {\n this._ctx.strokeStyle = horizontalGrid.color\n this._ctx.lineWidth = horizontalGrid.size\n if (horizontalGrid.style === LineStyle.DASH) {\n this._ctx.setLineDash(horizontalGrid.dashValue)\n }\n this._yAxis.ticks().forEach(tick => {\n drawHorizontalLine(this._ctx, tick.y, 0, this._width)\n })\n }\n\n const verticalGrid = grid.vertical\n if (verticalGrid.display) {\n this._ctx.strokeStyle = verticalGrid.color\n this._ctx.lineWidth = verticalGrid.size\n if (verticalGrid.style === LineStyle.DASH) {\n this._ctx.setLineDash(verticalGrid.dashValue)\n } else {\n this._ctx.setLineDash([])\n }\n this._xAxis.ticks().forEach(tick => {\n drawVerticalLine(this._ctx, tick.x, 0, this._height)\n })\n }\n\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制指标\n * @private\n */\n _drawTechnicalIndicator () {\n let onDrawing\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n const technicalIndicatorParams = this._chartData.technicalIndicatorParamOptions()[technicalIndicatorType] || []\n const linePoints = []\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n switch (technicalIndicatorType) {\n case TechnicalIndicatorType.MA: {\n const dataKeys = []\n technicalIndicatorParams.forEach(p => {\n dataKeys.push(`ma${p}`)\n })\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, dataKeys,\n this._yAxis.isCandleStickYAxis(), (values) => {\n this._prepareLinePoints(x, values, linePoints)\n }\n )\n }\n break\n }\n\n case TechnicalIndicatorType.MACD: {\n const dataList = this._chartData.dataList()\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n const macd = kLineData.macd || {}\n this._prepareLinePoints(x, [macd.diff, macd.dea], linePoints)\n const preKLineData = dataList[i - 1] || {}\n const macdValue = macd.macd\n const preMacdValue = (preKLineData.macd || {}).macd || -Infinity\n if (macdValue > 0) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.upColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.upColor\n } else if (macdValue < 0) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.downColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.downColor\n } else {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.noChangeColor\n this._ctx.fillStyle = technicalIndicatorOptions.bar.noChangeColor\n }\n const isFill = !((preMacdValue || preMacdValue === 0) && macdValue > preMacdValue)\n this._drawBars(x, halfBarSpace, macdValue, isFill)\n }\n break\n }\n\n case TechnicalIndicatorType.VOL: {\n const dataList = this._chartData.dataList()\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n const vol = kLineData.vol || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(vol[`ma${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n const preKLineData = dataList[i - 1] || {}\n const close = kLineData.close\n const preClose = (preKLineData || {}).close || close\n if (close > preClose) {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.upColor\n } else if (close < preClose) {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.downColor\n } else {\n this._ctx.fillStyle = technicalIndicatorOptions.bar.noChangeColor\n }\n this._drawBars(x, halfBarSpace, vol.num, true)\n }\n break\n }\n\n case TechnicalIndicatorType.BOLL: {\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, ['up', 'mid', 'dn'],\n this._yAxis.isCandleStickYAxis(), (values) => {\n this._prepareLinePoints(x, values, linePoints)\n }\n )\n }\n break\n }\n\n case TechnicalIndicatorType.BIAS: {\n onDrawing = (x, i, kLineData) => {\n const bias = kLineData.bias || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(bias[`bias${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.BRAR: {\n onDrawing = (x, i, kLineData) => {\n const brar = kLineData.brar || {}\n this._prepareLinePoints(x, [brar.br, brar.ar], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.CCI: {\n onDrawing = (x, i, kLineData) => {\n const cci = kLineData.cci || {}\n this._prepareLinePoints(x, [cci.cci], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.CR: {\n onDrawing = (x, i, kLineData) => {\n const cr = kLineData.cr || {}\n this._prepareLinePoints(x, [cr.cr, cr.ma1, cr.ma2, cr.ma3, cr.ma4], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.DMA: {\n onDrawing = (x, i, kLineData) => {\n const dma = kLineData.dma || {}\n this._prepareLinePoints(x, [dma.dif, dma.difMa], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.DMI: {\n onDrawing = (x, i, kLineData) => {\n const dmi = kLineData.dmi || {}\n this._prepareLinePoints(x, [dmi.mdi, dmi.pdi, dmi.adx, dmi.adxr], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.KDJ: {\n onDrawing = (x, i, kLineData) => {\n const kdj = kLineData.kdj || {}\n this._prepareLinePoints(x, [kdj.k, kdj.d, kdj.j], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.RSI: {\n onDrawing = (x, i, kLineData) => {\n const rsi = kLineData.rsi || {}\n const lineValues = []\n technicalIndicatorParams.forEach(p => {\n lineValues.push(rsi[`rsi${p}`])\n })\n this._prepareLinePoints(x, lineValues, linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.PSY: {\n onDrawing = (x, i, kLineData) => {\n const psy = kLineData.psy || {}\n this._prepareLinePoints(x, [psy.psy], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.TRIX: {\n onDrawing = (x, i, kLineData) => {\n const trix = kLineData.trix || {}\n this._prepareLinePoints(x, [trix.trix, trix.maTrix], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.OBV: {\n onDrawing = (x, i, kLineData) => {\n const obv = kLineData.obv || {}\n this._prepareLinePoints(x, [obv.obv, obv.maObv], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.VR: {\n onDrawing = (x, i, kLineData) => {\n const vr = kLineData.vr || {}\n this._prepareLinePoints(x, [vr.vr, vr.maVr], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.WR: {\n onDrawing = (x, i, kLineData) => {\n const wr = kLineData.wr || {}\n this._prepareLinePoints(x, [wr.wr1, wr.wr2, wr.wr3], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.MTM: {\n onDrawing = (x, i, kLineData) => {\n const mtm = kLineData.mtm || {}\n this._prepareLinePoints(x, [mtm.mtm, mtm.mtmMa], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.EMV: {\n onDrawing = (x, i, kLineData) => {\n const emv = kLineData.emv || {}\n this._prepareLinePoints(x, [emv.emv, emv.maEmv], linePoints)\n }\n break\n }\n\n case TechnicalIndicatorType.SAR: {\n onDrawing = (x, i, kLineData, halfBarSpace) => {\n this._ohlcTechnicalIndicatorDrawing(\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType, ['sar'],\n this._yAxis.isCandleStickYAxis(), (values) => {\n const sar = values[0]\n if (sar || sar === 0) {\n const dataY = this._yAxis.convertToPixel(sar)\n if (sar < (kLineData.high + kLineData.low) / 2) {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.upColor\n } else {\n this._ctx.strokeStyle = technicalIndicatorOptions.bar.downColor\n }\n this._ctx.beginPath()\n this._ctx.arc(x, dataY, halfBarSpace, Math.PI * 2, 0, true)\n this._ctx.stroke()\n this._ctx.closePath()\n }\n }\n )\n }\n }\n }\n this._drawGraphics(onDrawing,\n () => {\n this._drawLines(linePoints, technicalIndicatorOptions)\n }\n )\n }\n\n /**\n * 需要绘制ohlc指标每条数据渲染\n * @param i\n * @param x\n * @param halfBarSpace\n * @param technicalIndicatorOptions\n * @param kLineData\n * @param technicalIndicatorType\n * @param dataKeys\n * @param isCandleStick\n * @param prepare\n */\n _ohlcTechnicalIndicatorDrawing (\n i, x, halfBarSpace, technicalIndicatorOptions,\n kLineData, technicalIndicatorType,\n dataKeys, isCandleStick, prepare\n ) {\n const technicalIndicatorData = kLineData[technicalIndicatorType.toLowerCase()] || {}\n const values = []\n dataKeys.forEach(key => {\n values.push(technicalIndicatorData[key])\n })\n if (prepare) {\n prepare(values)\n }\n const dataList = this._chartData.dataList()\n if (!isCandleStick) {\n const preKLineData = dataList[i - 1] || {}\n this._drawOhlc(\n halfBarSpace, x, kLineData,\n preKLineData, technicalIndicatorOptions.bar.upColor,\n technicalIndicatorOptions.bar.downColor, technicalIndicatorOptions.bar.noChangeColor\n )\n }\n }\n\n /**\n * 准备绘制线的数据\n * @param x\n * @param lineValues\n * @param linePoints\n */\n _prepareLinePoints (x, lineValues, linePoints) {\n for (let i = 0; i < lineValues.length; i++) {\n const value = lineValues[i]\n const valueY = this._yAxis.convertToPixel(value)\n if (!linePoints[i]) {\n linePoints[i] = [{ x: x, y: valueY }]\n } else {\n linePoints[i].push({ x: x, y: valueY })\n }\n }\n }\n\n /**\n * 绘制线\n * @param linePoints\n * @param technicalIndicatorOptions\n */\n _drawLines (linePoints, technicalIndicatorOptions) {\n const colors = technicalIndicatorOptions.line.colors\n const pointCount = linePoints.length\n const colorSize = (colors || []).length\n this._ctx.lineWidth = technicalIndicatorOptions.line.size\n strokeInPixel(this._ctx, () => {\n for (let i = 0; i < pointCount; i++) {\n const points = linePoints[i]\n if (points.length > 0) {\n this._ctx.strokeStyle = colors[i % colorSize]\n this._ctx.beginPath()\n this._ctx.moveTo(points[0].x, points[0].y)\n for (let j = 1; j < points.length; j++) {\n this._ctx.lineTo(points[j].x, points[j].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n }\n }\n })\n }\n\n /**\n * 绘制柱状图\n * @param x\n * @param halfBarSpace\n * @param barData\n * @param isFill\n */\n _drawBars (x, halfBarSpace, barData, isFill) {\n if (barData || barData === 0) {\n this._ctx.lineWidth = 1\n const dataY = this._yAxis.convertToPixel(barData)\n const zeroY = this._yAxis.convertToPixel(0)\n let y = dataY\n if (barData < 0) {\n y = zeroY\n }\n const yDif = zeroY - dataY\n let barHeight = Math.abs(yDif)\n if (barHeight < 1) {\n barHeight = 1\n y = barData < 0 ? y + 1 : y - 1\n }\n if (isFill) {\n this._ctx.fillRect(x - halfBarSpace, y, halfBarSpace * 2, barHeight)\n } else {\n this._ctx.strokeRect(x - halfBarSpace, y, halfBarSpace * 2, barHeight)\n }\n }\n }\n\n /**\n * 绘制ohlc\n * @param halfBarSpace\n * @param x\n * @param kLineData\n * @param preKLineData\n * @param upColor\n * @param downColor\n * @param noChangeColor\n * @private\n */\n _drawOhlc (halfBarSpace, x, kLineData, preKLineData, upColor, downColor, noChangeColor) {\n const close = kLineData.close\n const openY = this._yAxis.convertToPixel(kLineData.open)\n const closeY = this._yAxis.convertToPixel(close)\n const highY = this._yAxis.convertToPixel(kLineData.high)\n const lowY = this._yAxis.convertToPixel(kLineData.low)\n const preClose = (preKLineData || {}).close || close\n if (close > preClose) {\n this._ctx.strokeStyle = upColor\n } else if (close < preClose) {\n this._ctx.strokeStyle = downColor\n } else {\n this._ctx.strokeStyle = noChangeColor\n }\n this._ctx.lineWidth = 1\n this._ctx.beginPath()\n this._ctx.moveTo(x, highY)\n this._ctx.lineTo(x, lowY)\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x - halfBarSpace, openY)\n this._ctx.lineTo(x, openY)\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x, closeY)\n this._ctx.lineTo(x + halfBarSpace, closeY)\n this._ctx.stroke()\n this._ctx.closePath()\n }\n\n /**\n * 绘制图形\n * @param onDrawing\n * @param onDrawEnd\n * @private\n */\n _drawGraphics (onDrawing, onDrawEnd) {\n let startX = 0\n const dataList = this._chartData.dataList()\n const barSpace = this._chartData.barSpace()\n const dataSpace = this._chartData.dataSpace()\n const halfBarSpace = barSpace / 2\n const to = this._chartData.to()\n for (let i = this._chartData.from(); i < to; i++) {\n const endX = startX + barSpace\n const x = (startX + endX) / 2\n const kLineData = dataList[i]\n if (onDrawing) {\n onDrawing(x, i, kLineData, halfBarSpace, barSpace)\n }\n startX += dataSpace\n }\n if (onDrawEnd) {\n onDrawEnd()\n }\n }\n}\n","import View from './View'\nimport { FloatLayerPromptDisplayRule, LineStyle } from '../data/options/styleOptions'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { isArray } from '../utils/typeChecks'\nimport { formatPrecision, formatValue } from '../utils/format'\nimport { calcTextWidth, drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\n\nexport default class TechnicalIndicatorFloatLayerView extends View {\n constructor (container, chartData, xAxis, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n const crossHairPoint = this._chartData.crossHairPoint()\n let dataPos\n if (crossHairPoint) {\n dataPos = this._xAxis.convertFromPixel(crossHairPoint.x)\n } else {\n dataPos = this._chartData.dataList().length - 1\n }\n const kLineData = this._chartData.dataList()[dataPos]\n const x = this._xAxis.convertToPixel(dataPos)\n this._drawCrossHairHorizontalLine()\n this._drawCrossHairVerticalLine(kLineData, x)\n const displayRule = this._chartData.styleOptions().floatLayer.prompt.displayRule\n if (displayRule === FloatLayerPromptDisplayRule.ALWAYS ||\n (displayRule === FloatLayerPromptDisplayRule.FOLLOW_CROSS && this._chartData.crossHairSeriesTag())) {\n this._drawPrompt(kLineData, x)\n }\n }\n\n /**\n * 绘制提示\n * @param kLineData\n * @param x\n * @private\n */\n _drawPrompt (kLineData, x) {\n this._drawTechnicalIndicatorPrompt(kLineData, x)\n }\n\n /**\n * 绘制十字光标水平线\n * @private\n */\n _drawCrossHairHorizontalLine () {\n if (this._chartData.crossHairSeriesTag() !== this._additionalDataProvider.tag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairHorizontal = crossHair.horizontal\n const crossHairHorizontalLine = crossHairHorizontal.line\n if (!crossHair.display || !crossHairHorizontal.display || !crossHairHorizontalLine.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n if (!crossHairPoint) {\n return\n }\n // 绘制十字光标水平线\n this._ctx.lineWidth = crossHairHorizontalLine.size\n this._ctx.strokeStyle = crossHairHorizontalLine.color\n if (crossHairHorizontalLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(crossHairHorizontalLine.dashValue)\n }\n drawHorizontalLine(this._ctx, crossHairPoint.y, 0, this._width)\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制十字光标垂直线\n * @param kLineData\n * @param x\n * @private\n */\n _drawCrossHairVerticalLine (kLineData, x) {\n if (!this._chartData.crossHairSeriesTag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairVertical = crossHair.vertical\n const crossHairVerticalLine = crossHairVertical.line\n if (!crossHair.display || !crossHairVertical.display || !crossHairVerticalLine.display) {\n return\n }\n if (!kLineData) {\n return\n }\n this._ctx.lineWidth = crossHairVerticalLine.size\n this._ctx.strokeStyle = crossHairVerticalLine.color\n\n if (crossHairVerticalLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(crossHairVerticalLine.dashValue)\n }\n drawVerticalLine(this._ctx, x, 0, this._height)\n this._ctx.setLineDash([])\n }\n\n /**\n * 绘制指标提示\n * @param kLineData\n * @param x\n * @param offsetTop\n * @private\n */\n _drawTechnicalIndicatorPrompt (kLineData, x, offsetTop = 0) {\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n const data = this._getTechnicalIndicatorPromptData(kLineData)\n const colors = technicalIndicatorOptions.line.colors\n this._drawTechnicalIndicatorPromptText(\n data, colors, offsetTop\n )\n this._drawTechnicalIndicatorPromptPoint(\n data.values, colors, x\n )\n }\n\n /**\n * 绘制指标提示文字\n * @param data\n * @param colors\n * @param offsetTop\n * @private\n */\n _drawTechnicalIndicatorPromptText (data, colors, offsetTop) {\n const floatLayerPromptTechnicalIndicatorText = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.text\n const nameText = data.name\n const labels = data.labels\n const values = data.values\n const textMarginLeft = floatLayerPromptTechnicalIndicatorText.marginLeft\n const textMarginRight = floatLayerPromptTechnicalIndicatorText.marginRight\n let labelX = textMarginLeft\n const labelY = floatLayerPromptTechnicalIndicatorText.marginTop + offsetTop\n const textSize = floatLayerPromptTechnicalIndicatorText.size\n const textColor = floatLayerPromptTechnicalIndicatorText.color\n const colorSize = colors.length\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(textSize)\n const nameTextWidth = calcTextWidth(this._ctx, nameText)\n this._ctx.fillStyle = textColor\n this._ctx.fillText(nameText, labelX, labelY)\n labelX += (textMarginLeft + nameTextWidth)\n for (let i = 0; i < labels.length; i++) {\n const text = `${labels[i].toUpperCase()}: ${values[i] || '--'}`\n const textWidth = calcTextWidth(this._ctx, text)\n this._ctx.fillStyle = colors[i % colorSize] || textColor\n this._ctx.fillText(text, labelX, labelY)\n labelX += (textMarginLeft + textMarginRight + textWidth)\n }\n }\n\n /**\n * 绘制指标提示点\n * @param values\n * @param colors\n * @param x\n * @private\n */\n _drawTechnicalIndicatorPromptPoint (values, colors, x) {\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n if (!this._chartData.crossHairSeriesTag() ||\n technicalIndicatorType === TechnicalIndicatorType.SAR) {\n return\n }\n const colorSize = colors.length\n const valueSize = technicalIndicatorType === TechnicalIndicatorType.MACD || technicalIndicatorType === TechnicalIndicatorType.VOL ? values.length - 1 : values.length\n\n for (let i = 0; i < valueSize; i++) {\n const value = values[i]\n if (value || value === 0) {\n const y = this._yAxis.convertToPixel(value)\n this._ctx.fillStyle = colors[i % colorSize]\n this._ctx.beginPath()\n this._ctx.arc(x, y, 3, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.fill()\n }\n }\n }\n\n /**\n * 获取需要绘制的指标提示数据\n * @param kLineData\n * @returns {{values: Array, labels: Array}}\n */\n _getTechnicalIndicatorPromptData (kLineData) {\n const technicalIndicatorType = this._additionalDataProvider.technicalIndicatorType()\n const params = this._chartData.technicalIndicatorParamOptions()[technicalIndicatorType] || []\n const values = []\n let labels = []\n switch (technicalIndicatorType) {\n case TechnicalIndicatorType.MA: {\n params.forEach(p => {\n labels.push(`ma${p}`)\n })\n break\n }\n case TechnicalIndicatorType.VOL: {\n params.forEach(p => {\n labels.push(`ma${p}`)\n })\n labels.push('num')\n break\n }\n case TechnicalIndicatorType.MACD: {\n labels = ['diff', 'dea', 'macd']\n break\n }\n case TechnicalIndicatorType.BOLL: {\n labels = ['up', 'mid', 'dn']\n break\n }\n case TechnicalIndicatorType.BIAS: {\n params.forEach(p => {\n labels.push(`bias${p}`)\n })\n break\n }\n case TechnicalIndicatorType.BRAR: {\n labels = ['br', 'ar']\n break\n }\n case TechnicalIndicatorType.CCI: {\n labels = ['cci']\n break\n }\n case TechnicalIndicatorType.CR: {\n labels = ['cr', 'ma1', 'ma2', 'ma3', 'ma4']\n break\n }\n case TechnicalIndicatorType.DMA: {\n labels = ['dif', 'difMa']\n break\n }\n case TechnicalIndicatorType.DMI: {\n labels = ['mdi', 'pdi', 'adx', 'adxr']\n break\n }\n case TechnicalIndicatorType.KDJ: {\n labels = ['k', 'd', 'j']\n break\n }\n\n case TechnicalIndicatorType.RSI: {\n params.forEach(p => {\n labels.push(`rsi${p}`)\n })\n break\n }\n case TechnicalIndicatorType.PSY: {\n labels = ['psy']\n break\n }\n case TechnicalIndicatorType.TRIX: {\n labels = ['trix', 'maTrix']\n break\n }\n case TechnicalIndicatorType.OBV: {\n labels = ['obv', 'maObv']\n break\n }\n case TechnicalIndicatorType.VR: {\n labels = ['vr', 'maVr']\n break\n }\n case TechnicalIndicatorType.WR: {\n labels = ['wr1', 'wr2', 'wr3']\n break\n }\n case TechnicalIndicatorType.MTM: {\n labels = ['mtm', 'mtmMa']\n break\n }\n\n case TechnicalIndicatorType.EMV: {\n labels = ['emv', 'maEmv']\n break\n }\n\n case TechnicalIndicatorType.SAR: {\n labels = ['sar']\n break\n }\n }\n let name = ''\n if (labels.length > 0) {\n name = `${technicalIndicatorType}`\n if (params && isArray(params) && params.length > 0) {\n name = `${name}(${params.join(',')})`\n }\n const indicatorData = formatValue(kLineData, technicalIndicatorType.toLowerCase())\n labels.forEach(label => {\n values.push(formatValue(indicatorData, label))\n })\n const decimal = this._chartData.precisionOptions()[technicalIndicatorType]\n values.forEach((value, index) => {\n values[index] = formatPrecision(value, decimal)\n })\n }\n return { labels, values, name }\n }\n}\n","import Widget from './Widget'\nimport TechnicalIndicatorView from '../view/TechnicalIndicatorView'\nimport TechnicalIndicatorFloatLayerView from '../view/TechnicalIndicatorFloatLayerView'\n\nexport default class TechnicalIndicatorWidget extends Widget {\n _createMainView (container, props) {\n return new TechnicalIndicatorView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n _createFloatLayerView (container, props) {\n return new TechnicalIndicatorFloatLayerView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n}\n","import View from './View'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\nimport { calcTextWidth, drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\nimport { formatBigNumber, formatPrecision } from '../utils/format'\n\nexport default class YAxisView extends View {\n constructor (container, chartData, yAxis) {\n super(container, chartData)\n this._yAxis = yAxis\n }\n\n _draw () {\n const yAxisOptions = this._chartData.styleOptions().yAxis\n if (yAxisOptions.display) {\n this._drawAxisLine(yAxisOptions)\n this._drawTickLines(yAxisOptions)\n this._drawTickLabels(yAxisOptions)\n this._drawLastPriceLabel(yAxisOptions)\n }\n }\n\n _drawAxisLine (yAxisOptions) {\n const axisLine = yAxisOptions.axisLine\n if (!axisLine.display) {\n return\n }\n this._ctx.strokeStyle = axisLine.color\n this._ctx.lineWidth = axisLine.size\n let x\n if (this._isDrawFromStart(yAxisOptions)) {\n x = 0\n } else {\n x = this._width\n }\n drawVerticalLine(this._ctx, x, 0, this._height)\n }\n\n _drawTickLines (yAxisOptions) {\n const tickLine = yAxisOptions.tickLine\n if (!tickLine.display) {\n return\n }\n this._ctx.lineWidth = tickLine.size\n this._ctx.strokeStyle = tickLine.color\n\n const tickLineLength = tickLine.length\n\n let startX\n let endX\n if (this._isDrawFromStart(yAxisOptions)) {\n startX = 0\n if (yAxisOptions.axisLine.display) {\n startX += yAxisOptions.axisLine.size\n }\n endX = startX + tickLineLength\n } else {\n startX = this._width\n if (yAxisOptions.axisLine.display) {\n startX -= yAxisOptions.axisLine.size\n }\n endX = startX - tickLineLength\n }\n this._yAxis.ticks().forEach(tick => {\n drawHorizontalLine(this._ctx, tick.y, startX, endX)\n })\n }\n\n _drawTickLabels (yAxisOptions) {\n const tickText = yAxisOptions.tickText\n if (!tickText.display) {\n return\n }\n const tickLine = yAxisOptions.tickLine\n const tickLineDisplay = tickLine.display\n const tickLineLength = tickLine.length\n const tickTextMargin = tickText.margin\n let labelX\n if (this._isDrawFromStart(yAxisOptions)) {\n labelX = tickTextMargin\n if (yAxisOptions.axisLine.display) {\n labelX += yAxisOptions.axisLine.size\n }\n if (tickLineDisplay) {\n labelX += tickLineLength\n }\n this._ctx.textAlign = 'left'\n } else {\n labelX = this._width - tickTextMargin\n if (yAxisOptions.axisLine.display) {\n labelX -= yAxisOptions.axisLine.size\n }\n if (tickLineDisplay) {\n labelX -= tickLineLength\n }\n this._ctx.textAlign = 'right'\n }\n const textSize = tickText.size\n this._ctx.textBaseline = 'middle'\n this._ctx.font = getFont(textSize)\n this._ctx.fillStyle = tickText.color\n this._yAxis.ticks().forEach(tick => {\n const text = formatBigNumber(tick.v)\n this._ctx.fillText(text, labelX, tick.y)\n })\n this._ctx.textAlign = 'left'\n }\n\n /**\n * 绘制最新价文字\n * @private\n */\n _drawLastPriceLabel (yAxisOptions) {\n if (!this._yAxis.isCandleStickYAxis()) {\n return\n }\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lastPriceMark = priceMark.last\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n if (!priceMark.display || !lastPriceMark.display || !lastPriceMark.text.display || dataSize === 0) {\n return\n }\n const lastPrice = dataList[dataSize - 1].close\n const preKLineData = dataList[dataSize - 2] || {}\n const preLastPrice = preKLineData.close || lastPrice\n let priceY = this._yAxis.convertToPixel(lastPrice)\n priceY = +(Math.max(this._height * 0.05, Math.min(priceY, this._height * 0.98))).toFixed(0)\n let color\n if (lastPrice > preLastPrice) {\n color = lastPriceMark.upColor\n } else if (lastPrice < preLastPrice) {\n color = lastPriceMark.downColor\n } else {\n color = lastPriceMark.noChangeColor\n }\n const priceMarkText = lastPriceMark.text\n const text = formatPrecision(lastPrice, this._chartData.precisionOptions().price)\n const textSize = lastPriceMark.text.size\n this._ctx.font = getFont(textSize)\n const rectWidth = calcTextWidth(this._ctx, text) + priceMarkText.paddingLeft + priceMarkText.paddingRight\n const rectHeight = priceMarkText.paddingTop + textSize + priceMarkText.paddingBottom\n let rectStartX\n if (this._isDrawFromStart(yAxisOptions)) {\n rectStartX = 0\n } else {\n rectStartX = this._width - rectWidth\n }\n this._ctx.fillStyle = color\n this._ctx.fillRect(rectStartX, priceY - priceMarkText.paddingTop - textSize / 2, rectWidth, rectHeight)\n this._ctx.fillStyle = priceMarkText.color\n this._ctx.textBaseline = 'middle'\n this._ctx.fillText(text, rectStartX + priceMarkText.paddingLeft, priceY)\n }\n\n /**\n * 判断是否从开始点绘制\n * @private\n */\n _isDrawFromStart (yAxisOptions) {\n return ((yAxisOptions.position === YAxisPosition.LEFT && yAxisOptions.tickText.position === YAxisTextPosition.INSIDE) ||\n (yAxisOptions.position === YAxisPosition.RIGHT && yAxisOptions.tickText.position === YAxisTextPosition.OUTSIDE))\n }\n}\n","import View from './View'\n\nexport default class AxisFloatLayerView extends View {\n constructor (container, chartData, axis, additionalDataProvider) {\n super(container, chartData)\n this._axis = axis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\n /**\n * 绘制十字光标文字\n * @private\n */\n _drawCrossHairLabel () {\n }\n}\n","import AxisFloatLayerView from './AxisFloatLayerView'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\n\nexport default class YAxisFloatLayerView extends AxisFloatLayerView {\n _drawCrossHairLabel () {\n if (this._chartData.crossHairSeriesTag() !== this._additionalDataProvider.tag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairHorizontal = crossHair.horizontal\n const crossHairHorizontalText = crossHairHorizontal.text\n if (!crossHair.display || !crossHairHorizontal.display || !crossHairHorizontalText.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n if (!crossHairPoint) {\n return\n }\n const value = this._axis.convertFromPixel(crossHairPoint.y)\n const precision = this._chartData.precisionOptions()[this._axis.isCandleStickYAxis() ? 'price' : this._additionalDataProvider.technicalIndicatorType()]\n const yAxisDataLabel = formatPrecision(value, precision)\n const textSize = crossHairHorizontalText.size\n this._ctx.font = getFont(textSize)\n const yAxisDataLabelWidth = calcTextWidth(this._ctx, yAxisDataLabel)\n let rectStartX\n\n const paddingLeft = crossHairHorizontalText.paddingLeft\n const paddingRight = crossHairHorizontalText.paddingRight\n const paddingTop = crossHairHorizontalText.paddingTop\n const paddingBottom = crossHairHorizontalText.paddingBottom\n const borderSize = crossHairHorizontalText.borderSize\n\n const rectWidth = yAxisDataLabelWidth + borderSize * 2 + paddingLeft + paddingRight\n const rectHeight = textSize + borderSize * 2 + paddingTop + paddingBottom\n const yAxis = this._chartData.styleOptions().yAxis\n if (\n (yAxis.position === YAxisPosition.LEFT && yAxis.tickText.position === YAxisTextPosition.INSIDE) ||\n (yAxis.position === YAxisPosition.RIGHT && yAxis.tickText.position === YAxisTextPosition.OUTSIDE)\n ) {\n rectStartX = 0\n } else {\n rectStartX = this._width - rectWidth\n }\n\n const rectY = crossHairPoint.y - borderSize - paddingTop - textSize / 2\n // 绘制y轴文字外的边框\n this._ctx.fillStyle = crossHairHorizontalText.backgroundColor\n this._ctx.fillRect(rectStartX, rectY, rectWidth, rectHeight)\n\n this._ctx.lineWidth = borderSize\n this._ctx.strokeStyle = crossHairHorizontalText.borderColor\n this._ctx.strokeRect(rectStartX, rectY, rectWidth, rectHeight)\n\n this._ctx.textBaseline = 'middle'\n this._ctx.fillStyle = crossHairHorizontalText.color\n this._ctx.fillText(yAxisDataLabel, rectStartX + borderSize + paddingLeft, crossHairPoint.y)\n }\n}\n","import Widget from './Widget'\nimport YAxisView from '../view/YAxisView'\nimport YAxisFloatLayerView from '../view/YAxisFloatLayerView'\n\nexport default class YAxisWidget extends Widget {\n _createMainView (container, props) {\n return new YAxisView(container, props.chartData, props.yAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new YAxisFloatLayerView(container, props.chartData, props.yAxis, props.additionalDataProvider)\n }\n}\n","export default class Axis {\n constructor (chartData) {\n this._chartData = chartData\n this._width = 0\n this._height = 0\n this._minValue = 0\n this._maxValue = 0\n this._range = 0\n this._ticks = []\n }\n\n /**\n * 设置尺寸\n * @param width\n * @param height\n */\n setSize (width, height) {\n this._width = width\n this._height = height\n }\n\n /**\n * 获取ticks\n * @returns {[]|*[]}\n */\n ticks () {\n return this._ticks\n }\n\n /**\n * 计算轴\n */\n computeAxis () {\n const { min, max, range } = this._computeMinMaxValue()\n this._minValue = min\n this._maxValue = max\n this._range = range\n this._ticks = this._computeOptimalTicks(this._computeTicks())\n }\n\n /**\n * 计算最大最小值\n */\n _computeMinMaxValue () {}\n\n /**\n * 计算最佳的tick\n * @param ticks\n */\n _computeOptimalTicks (ticks) {}\n\n /**\n * 计算轴上的tick值\n */\n _computeTicks () {\n const ticks = []\n if (this._range >= 0) {\n const interval = +this._nice(this._range / 8.0)\n const precision = this._getIntervalPrecision(interval)\n const first = +this._round(Math.ceil(this._minValue / interval) * interval, precision)\n const last = +this._round(Math.floor(this._maxValue / interval) * interval, precision)\n let n = 0\n let f = first\n\n if (interval !== 0) {\n while (f <= (+last)) {\n ++n\n f += interval\n }\n }\n f = first\n for (let i = 0; i < n; i++) {\n ticks[i] = { v: f.toFixed(precision) }\n f += interval\n }\n }\n return ticks\n }\n\n _nice (value) {\n const exponent = Math.floor(Math.log(value) / Math.log(10.0))\n const exp10 = Math.pow(10.0, exponent)\n const f = value / exp10 // 1 <= f < 10\n let nf = 0\n if (f < 1) {\n nf = 1\n } else if (f < 2) {\n nf = 2\n } else if (f < 3) {\n nf = 3\n } else if (f < 5) {\n nf = 5\n } else {\n nf = 10\n }\n value = nf * exp10\n return exponent >= -20 ? +value.toFixed(exponent < 0 ? -exponent : 0) : value\n }\n\n _getIntervalPrecision (value) {\n const str = value.toString()\n\n // Consider scientific notation: '3.4e-12' '3.4e+12'\n const eIndex = str.indexOf('e')\n if (eIndex > 0) {\n const precision = +str.slice(eIndex + 1)\n return precision < 0 ? -precision : 0\n } else {\n const dotIndex = str.indexOf('.')\n return dotIndex < 0 ? 0 : str.length - 1 - dotIndex\n }\n }\n\n _round (x, precision) {\n if (precision == null) {\n precision = 10\n }\n // Avoid range error\n precision = Math.min(Math.max(0, precision), 20)\n x = (+x).toFixed(precision)\n return x\n }\n}\n","import Axis from './Axis'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport { formatValue } from '../utils/format'\n\nexport const YAxisType = {\n CANDLE_STICK: 'candle_stick',\n TECHNICAL_INDICATOR: 'technical_indicator'\n}\n\nexport default class YAxis extends Axis {\n constructor (chartData, yAxisType) {\n super(chartData)\n this._yAxisType = yAxisType\n }\n\n _compareMinMax (kLineData, technicalIndicatorType, minMaxArray) {\n const technicalIndicatorData = formatValue(kLineData, technicalIndicatorType.toLowerCase(), {})\n Object.keys(technicalIndicatorData).forEach(key => {\n const value = technicalIndicatorData[key]\n if (value || value === 0) {\n minMaxArray[0] = Math.min(minMaxArray[0], value)\n minMaxArray[1] = Math.max(minMaxArray[1], value)\n }\n })\n if (technicalIndicatorType === TechnicalIndicatorType.BOLL || technicalIndicatorType === TechnicalIndicatorType.SAR) {\n minMaxArray[0] = Math.min(minMaxArray[0], kLineData.low)\n minMaxArray[1] = Math.max(minMaxArray[1], kLineData.high)\n }\n return minMaxArray\n }\n\n _computeMinMaxValue () {\n let min = this._minValue\n let max = this._maxValue\n if (min === Infinity || max === -Infinity) {\n return { min: 0, max: 0, range: 0 }\n }\n\n let range = Math.abs(max - min)\n if (range === 0) {\n max += 1\n range = Math.abs(max - min)\n }\n // 保证每次图形绘制上下都留间隙\n min = min - (range / 100.0) * 10.0\n max = max + (range / 100.0) * 20.0\n range = Math.abs(max - min)\n return { min, max, range }\n }\n\n _computeOptimalTicks (ticks) {\n const optimalTicks = []\n const tickLength = ticks.length\n if (tickLength > 0) {\n const textHeight = this._chartData.styleOptions().xAxis.tickText.size\n const y = this.convertToPixel(+ticks[0].v)\n let tickCountDif = 1\n if (tickLength > 1) {\n const nextY = this.convertToPixel(+ticks[1].v)\n const yDif = Math.abs(nextY - y)\n if (yDif < textHeight * 2) {\n tickCountDif = Math.ceil(textHeight * 2 / yDif)\n }\n }\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const v = ticks[i].v\n const y = this.convertToPixel(+v)\n if (y > textHeight &&\n y < this._height - textHeight) {\n optimalTicks.push({ v, y })\n }\n }\n }\n return optimalTicks\n }\n\n /**\n * 计算最大最小值\n * @param technicalIndicatorType\n * @param isRealTime\n */\n calcMinMaxValue (technicalIndicatorType, isRealTime) {\n const dataList = this._chartData.dataList()\n const from = this._chartData.from()\n const to = this._chartData.to()\n const isShowAverageLine = this._chartData.styleOptions().realTime.averageLine.display\n const minMaxArray = [Infinity, -Infinity]\n if (isRealTime) {\n for (let i = from; i < to; i++) {\n const kLineData = dataList[i]\n const minCompareArray = [kLineData.close, minMaxArray[0]]\n const maxCompareArray = [kLineData.close, minMaxArray[1]]\n if (isShowAverageLine) {\n minCompareArray.push(kLineData.average)\n maxCompareArray.push(kLineData.average)\n }\n minMaxArray[0] = Math.min.apply(null, minCompareArray)\n minMaxArray[1] = Math.max.apply(null, maxCompareArray)\n }\n } else {\n for (let i = from; i < to; i++) {\n const kLineData = dataList[i]\n this._compareMinMax(kLineData, technicalIndicatorType, minMaxArray)\n if (this.isCandleStickYAxis()) {\n minMaxArray[0] = Math.min(kLineData.low, minMaxArray[0])\n minMaxArray[1] = Math.max(kLineData.high, minMaxArray[1])\n }\n }\n if (technicalIndicatorType === TechnicalIndicatorType.VOL) {\n minMaxArray[0] = 0\n }\n }\n if (minMaxArray[0] !== Infinity && minMaxArray[1] !== -Infinity) {\n this._minValue = minMaxArray[0]\n this._maxValue = minMaxArray[1]\n }\n }\n\n /**\n * 是否是蜡烛图y轴组件\n * @returns {boolean}\n */\n isCandleStickYAxis () {\n return this._yAxisType === YAxisType.CANDLE_STICK\n }\n\n convertFromPixel (pixel) {\n return (1.0 - pixel / this._height) * this._range + this._minValue\n }\n\n convertToPixel (value) {\n return Math.round((1.0 - (value - this._minValue) / this._range) * this._height)\n }\n}\n","import Series from './Series'\nimport TechnicalIndicatorWidget from '../widget/TechnicalIndicatorWidget'\nimport YAxisWidget from '../widget/YAxisWidget'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport YAxis, { YAxisType } from '../component/YAxis'\nimport { InvalidateLevel } from '../data/ChartData'\n\nexport default class TechnicalIndicatorSeries extends Series {\n constructor (props) {\n super(props)\n this._technicalIndicatorType = props.technicalIndicatorType || TechnicalIndicatorType.MACD\n this._calcTechnicalIndicator()\n }\n\n _initBefore (props) {\n this._tag = props.tag\n this._yAxis = this._createYAxis(props)\n }\n\n _createYAxis (props) {\n return new YAxis(props.chartData, YAxisType.TECHNICAL_INDICATOR)\n }\n\n _createMainWidget (container, props) {\n return new TechnicalIndicatorWidget({\n container,\n chartData: props.chartData,\n xAxis: props.xAxis,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _createYAxisWidget (container, props) {\n return new YAxisWidget({\n container,\n chartData: props.chartData,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _computeAxis () {\n this._yAxis.calcMinMaxValue(this._technicalIndicatorType, this._isRealTime())\n this._yAxis.computeAxis()\n }\n\n _isRealTime () {\n return false\n }\n\n /**\n * 计算指标\n * @private\n */\n _calcTechnicalIndicator () {\n if (this._chartData.calcTechnicalIndicator(this._technicalIndicatorType)) {\n this.invalidate(InvalidateLevel.FULL)\n }\n }\n\n /**\n * 获取标识\n * @returns {string}\n */\n tag () {\n return this._tag\n }\n\n /**\n * 设置尺寸\n * @param mainWidgetSize\n * @param yAxisWidgetSize\n */\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._yAxis.setSize(yAxisWidgetSize.width, yAxisWidgetSize.height)\n this._computeAxis()\n super.setSize(mainWidgetSize, yAxisWidgetSize)\n }\n\n yAxis () {\n return this._yAxis\n }\n\n /**\n * 获取技术指标类型\n * @returns {string}\n */\n technicalIndicatorType () {\n return this._technicalIndicatorType\n }\n\n setTechnicalIndicatorType (technicalIndicatorType) {\n if (this._technicalIndicatorType !== technicalIndicatorType) {\n this._technicalIndicatorType = technicalIndicatorType\n this._calcTechnicalIndicator()\n }\n }\n}\n","import TechnicalIndicatorView from './TechnicalIndicatorView'\nimport { LineStyle, CandleStickStyle, ChartType } from '../data/options/styleOptions'\nimport { drawHorizontalLine, drawVerticalLine, getFont, strokeInPixel } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\n\nexport default class CandleStickView extends TechnicalIndicatorView {\n _draw () {\n this._drawGrid()\n if (this._additionalDataProvider.chartType() === ChartType.REAL_TIME) {\n this._drawRealTime()\n } else {\n this._drawCandleStick()\n this._drawTechnicalIndicator()\n this._drawHighestPriceMark()\n this._drawLowestPriceMark()\n }\n this._drawLastPriceLine()\n }\n\n /**\n * 绘制分时图\n * @private\n */\n _drawRealTime () {\n const timeLinePoints = []\n const timeLineAreaPoints = [{ x: 0, y: this._height }]\n const averageLinePoints = []\n\n const from = this._chartData.from()\n const range = this._chartData.range()\n const to = this._chartData.to()\n const onDrawing = (x, i, kLineData) => {\n const average = kLineData.average\n const closeY = this._yAxis.convertToPixel(kLineData.close)\n const averageY = this._yAxis.convertToPixel(average)\n timeLinePoints.push({ x: x, y: closeY })\n if (average || average === 0) {\n averageLinePoints.push({ x: x, y: averageY })\n }\n if (i === from) {\n timeLineAreaPoints.push({ x: 0, y: closeY })\n }\n timeLineAreaPoints.push({ x: x, y: closeY })\n }\n const onDrawEnd = () => {\n const areaPointLength = timeLineAreaPoints.length\n if (areaPointLength > 0) {\n const lastPoint = timeLineAreaPoints[areaPointLength - 1]\n const isFit = !(from - to < range)\n if (isFit) {\n timeLineAreaPoints.push({ x: this._width, y: lastPoint.y })\n timeLineAreaPoints.push({ x: this._width, y: this._height })\n } else {\n timeLineAreaPoints.push({ x: lastPoint.x, y: this._height })\n }\n }\n\n const realTime = this._chartData.styleOptions().realTime\n const timeLine = realTime.timeLine\n if (timeLinePoints.length > 0) {\n // 绘制分时线\n this._ctx.lineWidth = timeLine.size\n this._ctx.strokeStyle = timeLine.color\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(timeLinePoints[0].x, timeLinePoints[0].y)\n for (let i = 1; i < timeLinePoints.length; i++) {\n this._ctx.lineTo(timeLinePoints[i].x, timeLinePoints[i].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n })\n }\n\n if (timeLineAreaPoints.length > 0) {\n // 绘制分时线填充区域\n this._ctx.fillStyle = timeLine.areaFillColor\n this._ctx.beginPath()\n this._ctx.moveTo(timeLineAreaPoints[0].x, timeLineAreaPoints[0].y)\n for (let i = 1; i < timeLineAreaPoints.length; i++) {\n this._ctx.lineTo(timeLineAreaPoints[i].x, timeLineAreaPoints[i].y)\n }\n this._ctx.closePath()\n this._ctx.fill()\n }\n const averageLine = realTime.averageLine\n if (averageLine.display && averageLinePoints.length > 0) {\n // 绘制均线\n this._ctx.lineWidth = averageLine.size\n this._ctx.strokeStyle = averageLine.color\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(averageLinePoints[0].x, averageLinePoints[0].y)\n for (let i = 1; i < averageLinePoints.length; i++) {\n this._ctx.lineTo(averageLinePoints[i].x, averageLinePoints[i].y)\n }\n this._ctx.stroke()\n this._ctx.closePath()\n })\n }\n }\n this._drawGraphics(onDrawing, onDrawEnd)\n }\n\n /**\n * 绘制蜡烛\n * @private\n */\n _drawCandleStick () {\n this._ctx.lineWidth = 1\n let rect = []\n let markHighestPrice = -Infinity\n let markHighestPriceX = -1\n let markLowestPrice = Infinity\n let markLowestPriceX = -1\n const dataList = this._chartData.dataList()\n const candleStick = this._chartData.styleOptions().candleStick\n const onDrawing = (x, i, kLineData, halfBarSpace, barSpace) => {\n const close = kLineData.close\n const preKLineData = dataList[i - 1] || {}\n const preClose = preKLineData.close || close\n const high = kLineData.high\n const low = kLineData.low\n const open = kLineData.open\n if (markHighestPrice < high) {\n markHighestPrice = high\n markHighestPriceX = x\n }\n\n if (low < markLowestPrice) {\n markLowestPrice = low\n markLowestPriceX = x\n }\n if (close > preClose) {\n this._ctx.strokeStyle = candleStick.bar.upColor\n this._ctx.fillStyle = candleStick.bar.upColor\n } else if (close < preClose) {\n this._ctx.strokeStyle = candleStick.bar.downColor\n this._ctx.fillStyle = candleStick.bar.downColor\n } else {\n this._ctx.strokeStyle = candleStick.bar.noChangeColor\n this._ctx.fillStyle = candleStick.bar.noChangeColor\n }\n\n if (candleStick.bar.style !== CandleStickStyle.OHLC) {\n const openY = this._yAxis.convertToPixel(open)\n const closeY = this._yAxis.convertToPixel(close)\n const highY = this._yAxis.convertToPixel(high)\n const lowY = this._yAxis.convertToPixel(low)\n const highLine = []\n const lowLine = []\n highLine[0] = highY\n lowLine[1] = lowY\n if (openY > closeY) {\n highLine[1] = closeY\n lowLine[0] = openY\n rect = [x - halfBarSpace, closeY, barSpace, openY - closeY]\n } else if (openY < closeY) {\n highLine[1] = openY\n lowLine[0] = closeY\n rect = [x - halfBarSpace, openY, barSpace, closeY - openY]\n } else {\n highLine[1] = openY\n lowLine[0] = closeY\n rect = [x - halfBarSpace, openY, barSpace, 1]\n }\n this._ctx.beginPath()\n this._ctx.moveTo(x, highLine[0])\n this._ctx.lineTo(x, highLine[1])\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(x, lowLine[0])\n this._ctx.lineTo(x, lowLine[1])\n this._ctx.stroke()\n this._ctx.closePath()\n\n if (rect[3] < 1) {\n rect[3] = 1\n }\n switch (candleStick.bar.style) {\n case CandleStickStyle.SOLID: {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n break\n }\n case CandleStickStyle.STROKE: {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n break\n }\n case CandleStickStyle.UP_STROKE: {\n if (close > preClose) {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n } else {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n }\n break\n }\n case CandleStickStyle.DOWN_STROKE: {\n if (close > preClose) {\n this._ctx.fillRect(rect[0], rect[1], rect[2], rect[3])\n } else {\n this._ctx.strokeRect(rect[0], rect[1], rect[2], rect[3])\n }\n break\n }\n }\n } else {\n this._drawOhlc(\n halfBarSpace, x, kLineData,\n preKLineData, candleStick.bar.upColor,\n candleStick.bar.downColor, candleStick.bar.noChangeColor\n )\n }\n }\n this._drawGraphics(onDrawing)\n this._highestMarkData = { x: markHighestPriceX, price: markHighestPrice }\n this._lowestMarkData = { x: markLowestPriceX, price: markLowestPrice }\n }\n\n /**\n * 渲染最高价标记\n * @param pricePrecision\n */\n _drawHighestPriceMark (pricePrecision) {\n if (!this._highestMarkData) {\n return\n }\n const price = this._highestMarkData.price\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const highestPriceMark = priceMark.high\n if (price === -Infinity || !priceMark.display || !highestPriceMark.display) {\n return\n }\n this._drawLowestHighestPriceMark(\n highestPriceMark, this._highestMarkData.x, price, true, this._chartData.precisionOptions().price\n )\n }\n\n /**\n * 绘制最低价标记\n */\n _drawLowestPriceMark () {\n if (!this._lowestMarkData) {\n return\n }\n const price = this._lowestMarkData.price\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lowestPriceMark = priceMark.low\n if (price === Infinity || !priceMark.display || !lowestPriceMark.display) {\n return\n }\n this._drawLowestHighestPriceMark(\n lowestPriceMark, this._lowestMarkData.x, price, false, this._chartData.precisionOptions().price\n )\n }\n\n /**\n * 渲染最高最低价格标记\n * @param priceMark\n * @param x\n * @param price\n * @param isHigh\n * @param pricePrecision\n */\n _drawLowestHighestPriceMark (priceMark, x, price, isHigh, pricePrecision) {\n const priceY = this._yAxis.convertToPixel(price)\n const startX = x\n const startY = priceY + (isHigh ? -2 : 2)\n this._ctx.textAlign = 'left'\n this._ctx.lineWidth = 1\n this._ctx.strokeStyle = priceMark.color\n this._ctx.fillStyle = priceMark.color\n\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(startX, startY)\n this._ctx.lineTo(startX - 2, startY + (isHigh ? -2 : 2))\n this._ctx.stroke()\n this._ctx.closePath()\n\n this._ctx.beginPath()\n this._ctx.moveTo(startX, startY)\n this._ctx.lineTo(startX + 2, startY + (isHigh ? -2 : 2))\n this._ctx.stroke()\n this._ctx.closePath()\n })\n\n // 绘制竖线\n const y = startY + (isHigh ? -5 : 5)\n drawVerticalLine(this._ctx, startX, startY, y)\n drawHorizontalLine(this._ctx, y, startX, startX + 5)\n\n this._ctx.font = getFont(priceMark.textSize)\n const text = formatPrecision(price, pricePrecision)\n this._ctx.textBaseline = 'middle'\n this._ctx.fillText(text, startX + 5 + priceMark.textMargin, y)\n }\n\n /**\n * 绘制最新价线\n * @private\n */\n _drawLastPriceLine () {\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n const priceMark = this._chartData.styleOptions().candleStick.priceMark\n const lastPriceMark = priceMark.last\n if (!priceMark.display || !lastPriceMark.display || !lastPriceMark.line.display || dataSize === 0) {\n return\n }\n const lastPrice = dataList[dataSize - 1].close\n const preKLineData = dataList[dataSize - 2] || {}\n const preLastPrice = preKLineData.close || lastPrice\n let priceY = this._yAxis.convertToPixel(lastPrice)\n priceY = +(Math.max(this._height * 0.05, Math.min(priceY, this._height * 0.98))).toFixed(0)\n let color\n if (lastPrice > preLastPrice) {\n color = lastPriceMark.upColor\n } else if (lastPrice < preLastPrice) {\n color = lastPriceMark.downColor\n } else {\n color = lastPriceMark.noChangeColor\n }\n const priceMarkLine = lastPriceMark.line\n this._ctx.strokeStyle = color\n this._ctx.lineWidth = priceMarkLine.size\n if (priceMarkLine.style === LineStyle.DASH) {\n this._ctx.setLineDash(priceMarkLine.dashValue)\n }\n drawHorizontalLine(this._ctx, priceY, 0, this._width)\n this._ctx.setLineDash([])\n }\n}\n","import TechnicalIndicatorFloatLayerView from './TechnicalIndicatorFloatLayerView'\nimport { isFunction } from '../utils/typeChecks'\nimport { formatDate, formatPrecision, formatValue } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { ChartType, FloatLayerPromptCandleStickTextDisplayType } from '../data/options/styleOptions'\n\nexport default class CandleStickFloatLayerView extends TechnicalIndicatorFloatLayerView {\n _drawPrompt (kLineData, x) {\n const floatLayerPromptCandleStick = this._chartData.styleOptions().floatLayer.prompt.candleStick\n const candleStickPromptData = this._getCandleStickPromptData(kLineData, floatLayerPromptCandleStick)\n if (floatLayerPromptCandleStick.showType === FloatLayerPromptCandleStickTextDisplayType.STANDARD) {\n this._drawCandleStickStandardPromptText(floatLayerPromptCandleStick, candleStickPromptData)\n if (this._additionalDataProvider.chartType() === ChartType.CANDLE_STICK) {\n this._drawTechnicalIndicatorPrompt(\n kLineData, x,\n floatLayerPromptCandleStick.text.size + floatLayerPromptCandleStick.text.marginTop\n )\n }\n } else {\n this._drawCandleStickRectPromptText(kLineData, x, floatLayerPromptCandleStick, candleStickPromptData)\n }\n }\n\n _drawCandleStickStandardPromptText (floatLayerPromptCandleStick, candleStickPromptData) {\n const values = candleStickPromptData\n const textMarginLeft = floatLayerPromptCandleStick.text.marginLeft\n const textMarginRight = floatLayerPromptCandleStick.text.marginRight\n const textSize = floatLayerPromptCandleStick.text.size\n const textColor = floatLayerPromptCandleStick.text.color\n const labels = floatLayerPromptCandleStick.labels\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(textSize)\n let labelX = textMarginLeft\n const labelY = floatLayerPromptCandleStick.text.marginTop\n labels.forEach((label, i) => {\n const labelText = label ? `${label}: ` : ''\n const labelWidth = calcTextWidth(this._ctx, labelText)\n this._ctx.fillStyle = textColor\n this._ctx.fillText(labelText, labelX, labelY)\n labelX += labelWidth\n\n const value = values[i] || '--'\n let valueText\n if (typeof value === 'object') {\n valueText = value.value || '--'\n this._ctx.fillStyle = value.color || textColor\n } else {\n this._ctx.fillStyle = textColor\n valueText = value\n }\n const textWidth = calcTextWidth(this._ctx, valueText)\n this._ctx.fillText(valueText, labelX, labelY)\n labelX += (textWidth + textMarginLeft + textMarginRight)\n })\n }\n\n _drawCandleStickRectPromptText (kLineData, x, floatLayerPromptCandleStick, candleStickPromptData) {\n const baseLabels = floatLayerPromptCandleStick.labels\n const baseValues = candleStickPromptData\n const baseTextMarginLeft = floatLayerPromptCandleStick.text.marginLeft\n const baseTextMarginRight = floatLayerPromptCandleStick.text.marginRight\n const baseTextMarginTop = floatLayerPromptCandleStick.text.marginTop\n const baseTextMarginBottom = floatLayerPromptCandleStick.text.marginBottom\n const baseTextSize = floatLayerPromptCandleStick.text.size\n const baseTextColor = floatLayerPromptCandleStick.text.color\n\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(baseTextSize)\n let maxLabelWidth = 0\n baseLabels.forEach((label, i) => {\n const value = baseValues[i] || '--'\n let v = value\n if (typeof value === 'object') {\n v = value.value || '--'\n }\n const text = `${label}: ${v}`\n const labelWidth = calcTextWidth(this._ctx, text) + baseTextMarginLeft + baseTextMarginRight\n maxLabelWidth = Math.max(maxLabelWidth, labelWidth)\n })\n\n const rect = floatLayerPromptCandleStick.rect\n const rectBorderSize = rect.borderSize\n const rectPaddingLeft = rect.paddingLeft\n const rectPaddingRight = rect.paddingRight\n const rectPaddingTop = rect.paddingTop\n const rectPaddingBottom = rect.paddingBottom\n const rectLeft = rect.left\n const rectRight = rect.right\n let rectHeight = rectBorderSize * 2 +\n rectPaddingTop + rectPaddingBottom +\n (baseTextMarginBottom + baseTextMarginTop + baseTextSize) * baseLabels.length\n\n const technicalIndicatorPromptData = this._getTechnicalIndicatorPromptData(kLineData)\n const floatLayerPromptTechnicalIndicator = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator\n\n const indicatorTextMarginLeft = floatLayerPromptTechnicalIndicator.text.marginLeft\n const indicatorTextMarginRight = floatLayerPromptTechnicalIndicator.text.marginRight\n const indicatorTextMarginTop = floatLayerPromptTechnicalIndicator.text.marginTop\n const indicatorTextMarginBottom = floatLayerPromptTechnicalIndicator.text.marginBottom\n const indicatorTextSize = floatLayerPromptTechnicalIndicator.text.size\n\n const isCandleStick = this._additionalDataProvider.chartType() === ChartType.CANDLE_STICK\n const indicatorLabels = technicalIndicatorPromptData.labels || []\n const indicatorValues = technicalIndicatorPromptData.values || []\n if (isCandleStick) {\n this._ctx.font = getFont(indicatorTextSize)\n indicatorLabels.forEach((label, i) => {\n const v = indicatorValues[i] || '--'\n const text = `${label}: ${v}`\n const labelWidth = calcTextWidth(this._ctx, text) + indicatorTextMarginLeft + indicatorTextMarginRight\n maxLabelWidth = Math.max(maxLabelWidth, labelWidth)\n })\n rectHeight += ((indicatorTextMarginTop + indicatorTextMarginBottom + indicatorTextSize) * indicatorLabels.length)\n }\n\n const rectWidth = rectBorderSize * 2 + maxLabelWidth + rectPaddingLeft + rectPaddingRight\n\n const centerX = this._width / 2\n let rectX\n if (x < centerX) {\n rectX = this._width - rectRight - rectWidth\n } else {\n rectX = rectLeft\n }\n const rectY = rect.top\n const radius = rect.borderRadius\n this._ctx.lineWidth = rectBorderSize\n this._ctx.strokeStyle = rect.borderColor\n this._ctx.fillStyle = rect.fillColor\n this._drawRoundRect(rectX, rectY, rectWidth, rectHeight, radius)\n this._ctx.stroke()\n this._drawRoundRect(rectX, rectY, rectWidth, rectHeight, radius)\n this._ctx.fill()\n\n if (isCandleStick) {\n const baseLabelX = rectX + rectBorderSize + rectPaddingLeft + baseTextMarginLeft\n let labelY = rectY + rectBorderSize + rectPaddingTop\n // 开始渲染基础数据文字\n this._ctx.font = getFont(baseTextSize)\n baseLabels.forEach((label, i) => {\n labelY += baseTextMarginTop\n this._ctx.textAlign = 'left'\n this._ctx.fillStyle = baseTextColor\n this._ctx.fillText(`${label}: `, baseLabelX, labelY)\n\n const value = baseValues[i] || '--'\n let text\n this._ctx.fillStyle = value.color || baseTextColor\n if (typeof value === 'object') {\n text = value.value || '--'\n } else {\n text = value\n }\n this._ctx.textAlign = 'right'\n this._ctx.fillText(text, rectX + rectWidth - rectBorderSize - baseTextMarginRight - rectPaddingRight, labelY)\n labelY += (baseTextSize + baseTextMarginBottom)\n })\n // 开始渲染指标数据文字\n const technicalIndicatorOptions = this._chartData.styleOptions().technicalIndicator\n const colors = technicalIndicatorOptions.line.colors\n const indicatorLabelX = rectX + rectBorderSize + rectPaddingLeft + indicatorTextMarginLeft\n const colorSize = colors.length\n this._ctx.font = getFont(indicatorTextSize)\n indicatorLabels.forEach((label, i) => {\n labelY += indicatorTextMarginTop\n this._ctx.textAlign = 'left'\n this._ctx.fillStyle = colors[i % colorSize] || technicalIndicatorOptions.text.color\n this._ctx.fillText(`${label.toUpperCase()}: `, indicatorLabelX, labelY)\n\n this._ctx.textAlign = 'right'\n this._ctx.fillText(\n indicatorValues[i] || '--',\n rectX + rectWidth - rectBorderSize - indicatorTextMarginRight - rectPaddingRight,\n labelY\n )\n labelY += (indicatorTextSize + indicatorTextMarginBottom)\n })\n }\n this._ctx.textAlign = 'left'\n }\n\n /**\n * 渲染圆角矩形\n * @param x\n * @param y\n * @param w\n * @param h\n * @param r\n */\n _drawRoundRect (x, y, w, h, r) {\n this._ctx.beginPath()\n this._ctx.moveTo(x + r, y)\n this._ctx.arcTo(x + w, y, x + w, y + h, r)\n this._ctx.arcTo(x + w, y + h, x, y + h, r)\n this._ctx.arcTo(x, y + h, x, y, r)\n this._ctx.arcTo(x, y, x + w, y, r)\n this._ctx.closePath()\n }\n\n /**\n * 获取蜡烛提示数据\n * @param kLineData\n * @param floatLayerPromptCandleStick\n * @returns {*}\n * @private\n */\n _getCandleStickPromptData (kLineData, floatLayerPromptCandleStick) {\n const baseValues = floatLayerPromptCandleStick.values\n let values = []\n if (baseValues) {\n if (isFunction(baseValues)) {\n values = baseValues(kLineData) || []\n } else {\n values = baseValues\n }\n } else {\n const precisionOptions = this._chartData.precisionOptions()\n values = [\n formatValue(kLineData, 'timestamp'),\n formatValue(kLineData, 'open'),\n formatValue(kLineData, 'close'),\n formatValue(kLineData, 'high'),\n formatValue(kLineData, 'low'),\n formatValue(kLineData, 'volume')\n ]\n values.forEach((value, index) => {\n switch (index) {\n case 0: {\n values[index] = formatDate(value, 'YYYY-MM-DD hh:mm', this._chartData.timezone())\n break\n }\n case values.length - 1: {\n values[index] = formatPrecision(value, precisionOptions.volume)\n break\n }\n default: {\n values[index] = formatPrecision(value, precisionOptions.price)\n break\n }\n }\n })\n }\n return values\n }\n}\n","/**\n * 获取某点在两点决定的一次函数上的y值\n * @param point1\n * @param point2\n * @param targetPoints\n */\nexport function getLinearY (point1, point2, targetPoints) {\n const v = []\n if (point1 && point2 && targetPoints.length > 0) {\n const subX = (point1.x - point2.x)\n if (subX === 0) {\n targetPoints.forEach(point => {\n v.push(point.y)\n })\n } else {\n const k = (point1.y - point2.y) / subX\n const b = point1.y - k * point1.x\n targetPoints.forEach(point => {\n v.push(point.x * k + b)\n })\n }\n }\n return v\n}\n\n/**\n * 点是否在线上\n * @param point1\n * @param point2\n * @param targetPoint\n */\nexport function checkPointOnStraightLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (point1.x === point2.x) {\n return Math.abs(targetPoint.x - point1.x) < 1\n }\n if (point1.y === point2.y) {\n return Math.abs(targetPoint.y - point1.y) < 1\n }\n return Math.abs(targetPoint.y - getLinearY(point1, point2, [targetPoint])[0]) < 1\n}\n\n/**\n * 点是否在线段上\n * @param point1\n * @param point2\n * @param targetPoint\n * @returns {boolean}\n */\nexport function checkPointOnRayLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (checkPointOnStraightLine(point1, point2, targetPoint)) {\n if (point1.x === point2.x) {\n if (point1.y < point2.y) {\n return targetPoint.y > point1.y - 2\n } else {\n return targetPoint.y < point1.y + 2\n }\n }\n if (point1.x < point2.x) {\n return targetPoint.x > point1.x - 2\n } else {\n return targetPoint.x < point1.x + 2\n }\n }\n return false\n}\n\n/**\n * 判断点是否在线段上面\n * @param point1\n * @param point2\n * @param targetPoint\n */\nexport function checkPointOnSegmentLine (point1, point2, targetPoint) {\n if (!targetPoint || !point1 || !point2) {\n return false\n }\n if (checkPointOnStraightLine(point1, point2, targetPoint)) {\n const a = Math.sqrt(Math.pow(targetPoint.x - point1.x, 2) + Math.pow(targetPoint.y - point1.y, 2))\n const b = Math.sqrt(Math.pow(targetPoint.x - point2.x, 2) + Math.pow(targetPoint.y - point2.y, 2))\n const c = Math.sqrt(Math.pow(point1.x - point2.x, 2) + Math.pow(point1.y - point2.y, 2))\n return Math.abs(a + b - c) < 2\n }\n return false\n}\n\n/**\n * 点是否在圆上\n * @param circleCenterPoint\n * @param radius\n * @param targetPoint\n * @returns {boolean}\n */\nexport function checkPointOnCircle (circleCenterPoint, radius, targetPoint) {\n if (!targetPoint) {\n return false\n }\n const subX = targetPoint.x - circleCenterPoint.x\n const subY = targetPoint.y - circleCenterPoint.y\n return !(subX * subX + subY * subY > radius * radius)\n}\n\n/**\n * 获取平行线\n * @param points\n * @param size\n * @param isPriceChannelLine\n * @returns {Array}\n */\nexport function getParallelLines (points, size, isPriceChannelLine) {\n const lines = []\n if (points.length > 1) {\n if (points[0].x === points[1].x) {\n const startY = 0\n const endY = size.height\n lines.push([{ x: points[0].x, y: startY }, { x: points[0].x, y: endY }])\n if (points.length > 2) {\n lines.push([{ x: points[2].x, y: startY }, { x: points[2].x, y: endY }])\n if (isPriceChannelLine) {\n const distance = points[0].x - points[2].x\n lines.push([{ x: points[0].x + distance, y: startY }, { x: points[0].x + distance, y: endY }])\n }\n }\n } else {\n const startX = 0\n const endX = size.width\n if (points[0].y === points[1].y) {\n lines.push([{ x: startX, y: points[0].y }, { x: endX, y: points[0].y }])\n if (points.length > 2) {\n lines.push([{ x: startX, y: points[2].y }, { x: endX, y: points[2].y }])\n if (isPriceChannelLine) {\n const distance = points[0].y - points[2].y\n lines.push([{ x: startX, y: points[0].y + distance }, { x: endX, y: points[0].y + distance }])\n }\n }\n } else {\n const k = (points[0].y - points[1].y) / (points[0].x - points[1].x)\n const b = points[0].y - k * points[0].x\n lines.push([{ x: startX, y: startX * k + b }, { x: endX, y: endX * k + b }])\n if (points.length > 2) {\n const b1 = points[2].y - k * points[2].x\n lines.push([{ x: startX, y: startX * k + b1 }, { x: endX, y: endX * k + b1 }])\n if (isPriceChannelLine) {\n const b2 = b + (b - b1)\n lines.push([{ x: startX, y: startX * k + b2 }, { x: endX, y: endX * k + b2 }])\n }\n }\n }\n }\n }\n return lines\n}\n\n/**\n * 获取斐波那契线\n * @param points\n * @param size\n */\nexport function getFibonacciLines (points, size) {\n const lines = []\n if (points.length > 0) {\n const startX = 0\n const endX = size.width\n lines.push([{ x: startX, y: points[0].y }, { x: endX, y: points[0].y }])\n if (points.length > 1) {\n const yDistance = points[0].y - points[1].y\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.786 }, { x: endX, y: points[1].y + yDistance * 0.786 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.618 }, { x: endX, y: points[1].y + yDistance * 0.618 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.5 }, { x: endX, y: points[1].y + yDistance * 0.5 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.382 }, { x: endX, y: points[1].y + yDistance * 0.382 }])\n lines.push([{ x: startX, y: points[1].y + yDistance * 0.236 }, { x: endX, y: points[1].y + yDistance * 0.236 }])\n lines.push([{ x: startX, y: points[1].y }, { x: endX, y: points[1].y }])\n }\n }\n return lines\n}\n","const MouseEventButton = {\n LEFT: 0,\n RIGHT: 2\n}\n\nconst DELAY_RESET_CLICK = 500\nconst DELAY_LONG_TAG = 600\n\nfunction getBoundingClientRect (element) {\n return element.getBoundingClientRect() || { left: 0, top: 0 }\n}\n\nfunction isTouchEvent (event) {\n return Boolean(event.touches)\n}\n\nfunction preventDefault (event) {\n if (event.cancelable) {\n event.preventDefault()\n }\n}\n\nfunction checkTouchEvents () {\n if ('ontouchstart' in window) {\n return true\n }\n\n return Boolean(window.DocumentTouch && document instanceof window.DocumentTouch)\n}\n\nconst touch = !!navigator.maxTouchPoints || !!navigator.msMaxTouchPoints || checkTouchEvents()\nconst mobileTouch = 'onorientationchange' in window && touch\n\nfunction getDistance (p1, p2) {\n const xDiff = p1.clientX - p2.clientX\n const yDiff = p1.clientY - p2.clientY\n return Math.sqrt(xDiff * xDiff + yDiff * yDiff)\n}\n\nexport const EventType = {\n MOUSE: 'mouse',\n TOUCH: 'touch'\n}\n\nexport default class EventBase {\n constructor (target, eventHandler, options) {\n this._target = target\n this._handler = eventHandler\n this._options = options\n\n this._clickCount = 0\n this._clickTimeoutId = null\n this._longTapTimeoutId = null\n this._longTapActive = false\n this._mouseMoveStartPosition = null\n this._moveExceededManhattanDistance = false\n this._cancelClick = false\n this._unsubscribeOutsideEvents = null\n this._unsubscribeMousemove = null\n this._unsubscribeRoot = null\n\n this._startPinchMiddlePoint = null\n this._startPinchDistance = 0\n this._pinchPrevented = false\n this._preventDragProcess = false\n\n this._mousePressed = false\n\n this._init()\n }\n\n destroy () {\n if (this._unsubscribeOutsideEvents !== null) {\n this._unsubscribeOutsideEvents()\n this._unsubscribeOutsideEvents = null\n }\n\n if (this._unsubscribeMousemove !== null) {\n this._unsubscribeMousemove()\n this._unsubscribeMousemove = null\n }\n\n if (this._unsubscribeRoot !== null) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n this._clearLongTapTimeout()\n this._resetClickTimeout()\n }\n\n _mouseEnterHandler (enterEvent) {\n if (this._unsubscribeMousemove) {\n this._unsubscribeMousemove()\n }\n\n {\n const boundMouseMoveHandler = this._mouseMoveHandler.bind(this)\n const boundMouseWheelHandler = this._mouseWheelHandler.bind(this)\n this._unsubscribeMousemove = () => {\n this._target.removeEventListener('mousemove', boundMouseMoveHandler)\n this._target.removeEventListener('wheel', boundMouseWheelHandler)\n }\n this._target.addEventListener('mousemove', boundMouseMoveHandler)\n this._target.addEventListener('wheel', boundMouseWheelHandler, { passive: false })\n }\n\n if (isTouchEvent(enterEvent)) {\n this._mouseMoveHandler(enterEvent)\n }\n\n const compatEvent = this._makeCompatEvent(enterEvent)\n this._processEvent(compatEvent, this._handler.mouseEnterEvent)\n }\n\n _resetClickTimeout () {\n if (this._clickTimeoutId !== null) {\n clearTimeout(this._clickTimeoutId)\n }\n\n this._clickCount = 0\n this._clickTimeoutId = null\n }\n\n _mouseMoveHandler (moveEvent) {\n if (this._mousePressed && !isTouchEvent(moveEvent)) {\n return\n }\n\n const compatEvent = this._makeCompatEvent(moveEvent)\n this._processEvent(compatEvent, this._handler.mouseMoveEvent)\n }\n\n _mouseWheelHandler (wheelEvent) {\n const compatEvent = this._makeCompatEvent(wheelEvent)\n wheelEvent.localX = compatEvent.localX\n wheelEvent.localY = compatEvent.localY\n this._processEvent(wheelEvent, this._handler.mouseWheelEvent)\n }\n\n _mouseMoveWithDownHandler (moveEvent) {\n if ('button' in moveEvent && moveEvent.button !== MouseEventButton.LEFT) {\n return\n }\n\n if (this._startPinchMiddlePoint !== null) {\n return\n }\n\n const isTouch = isTouchEvent(moveEvent)\n if (this._preventDragProcess && isTouch) {\n return\n }\n\n this._pinchPrevented = true\n\n const compatEvent = this._makeCompatEvent(moveEvent)\n\n const startMouseMovePos = this._mouseMoveStartPosition\n const xOffset = Math.abs(startMouseMovePos.x - compatEvent.pageX)\n const yOffset = Math.abs(startMouseMovePos.y - compatEvent.pageY)\n\n const moveExceededManhattanDistance = xOffset + yOffset > 5\n\n if (!moveExceededManhattanDistance && isTouch) {\n return\n }\n\n if (moveExceededManhattanDistance && !this._moveExceededManhattanDistance && isTouch) {\n // vertical drag is more important than horizontal drag\n // because we scroll the page vertically often than horizontally\n const correctedXOffset = xOffset * 0.5\n\n // a drag can be only if touch page scroll isn't allowed\n const isVertDrag = yOffset >= correctedXOffset && !this._options.treatVertTouchDragAsPageScroll\n const isHorzDrag = correctedXOffset > yOffset && !this._options.treatHorzTouchDragAsPageScroll\n\n // if drag event happened then we should revert preventDefault state to original one\n // and try to process the drag event\n // else we shouldn't prevent default of the event and ignore processing the drag event\n if (!isVertDrag && !isHorzDrag) {\n this._preventDragProcess = true\n }\n }\n\n if (moveExceededManhattanDistance) {\n this._moveExceededManhattanDistance = true\n\n // if manhattan distance is more that 5 - we should cancel click event\n this._cancelClick = true\n\n if (isTouch) {\n this._clearLongTapTimeout()\n }\n }\n\n if (!this._preventDragProcess) {\n this._processEvent(compatEvent, this._handler.pressedMouseMoveEvent)\n\n // we should prevent default in case of touch only\n // to prevent scroll of the page\n if (isTouch) {\n preventDefault(moveEvent)\n }\n }\n }\n\n _mouseUpHandler (mouseUpEvent) {\n if ('button' in mouseUpEvent && mouseUpEvent.button !== MouseEventButton.LEFT) {\n return\n }\n const compatEvent = this._makeCompatEvent(mouseUpEvent)\n\n this._clearLongTapTimeout()\n\n this._mouseMoveStartPosition = null\n\n this._mousePressed = false\n\n if (this._unsubscribeRoot) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n if (isTouchEvent(mouseUpEvent)) {\n this._mouseLeaveHandler(mouseUpEvent)\n }\n\n this._processEvent(compatEvent, this._handler.mouseUpEvent)\n ++this._clickCount\n if (this._clickTimeoutId && this._clickCount > 1) {\n this._processEvent(compatEvent, this._handler.mouseDoubleClickEvent)\n this._resetClickTimeout()\n } else {\n if (!this._cancelClick) {\n this._processEvent(compatEvent, this._handler.mouseClickEvent)\n }\n }\n\n // prevent safari's dblclick-to-zoom\n // we handle mouseDoubleClickEvent here ourself\n if (isTouchEvent(mouseUpEvent)) {\n preventDefault(mouseUpEvent)\n\n this._mouseLeaveHandler(mouseUpEvent)\n\n if (mouseUpEvent.touches.length === 0) {\n this._longTapActive = false\n }\n }\n }\n\n _clearLongTapTimeout () {\n if (this._longTapTimeoutId === null) {\n return\n }\n\n clearTimeout(this._longTapTimeoutId)\n this._longTapTimeoutId = null\n }\n\n _mouseDownHandler (downEvent) {\n if ('button' in downEvent && downEvent.button !== MouseEventButton.LEFT && downEvent.button !== MouseEventButton.RIGHT) {\n return\n }\n const compatEvent = this._makeCompatEvent(downEvent)\n if ('button' in downEvent && downEvent.button === MouseEventButton.RIGHT) {\n this._processEvent(compatEvent, this._handler.mouseRightDownEvent)\n return\n }\n this._cancelClick = false\n this._moveExceededManhattanDistance = false\n this._preventDragProcess = false\n\n if (isTouchEvent(downEvent)) {\n this._mouseEnterHandler(downEvent)\n }\n\n this._mouseMoveStartPosition = {\n x: compatEvent.pageX,\n y: compatEvent.pageY\n }\n\n if (this._unsubscribeRoot) {\n this._unsubscribeRoot()\n this._unsubscribeRoot = null\n }\n\n {\n const boundMouseMoveWithDownHandler = this._mouseMoveWithDownHandler.bind(this)\n const boundMouseUpHandler = this._mouseUpHandler.bind(this)\n const rootElement = this._target.ownerDocument.documentElement\n\n this._unsubscribeRoot = () => {\n rootElement.removeEventListener('touchmove', boundMouseMoveWithDownHandler)\n rootElement.removeEventListener('touchend', boundMouseUpHandler)\n\n rootElement.removeEventListener('mousemove', boundMouseMoveWithDownHandler)\n rootElement.removeEventListener('mouseup', boundMouseUpHandler)\n }\n\n rootElement.addEventListener('touchmove', boundMouseMoveWithDownHandler, { passive: false })\n rootElement.addEventListener('touchend', boundMouseUpHandler, { passive: false })\n\n this._clearLongTapTimeout()\n\n if (isTouchEvent(downEvent) && downEvent.touches.length === 1) {\n this._longTapTimeoutId = setTimeout(this._longTapHandler.bind(this, downEvent), DELAY_LONG_TAG)\n } else {\n rootElement.addEventListener('mousemove', boundMouseMoveWithDownHandler)\n rootElement.addEventListener('mouseup', boundMouseUpHandler)\n }\n }\n\n this._mousePressed = true\n this._processEvent(compatEvent, this._handler.mouseDownEvent)\n\n if (!this._clickTimeoutId) {\n this._clickCount = 0\n this._clickTimeoutId = setTimeout(this._resetClickTimeout.bind(this), DELAY_RESET_CLICK)\n }\n }\n\n _init () {\n this._target.addEventListener('mouseenter', this._mouseEnterHandler.bind(this))\n\n this._target.addEventListener('touchcancel', this._clearLongTapTimeout.bind(this))\n\n {\n const doc = this._target.ownerDocument\n\n const outsideHandler = (event) => {\n if (!this._handler.mouseDownOutsideEvent) {\n return\n }\n if (event.target && this._target.contains(event.target)) {\n return\n }\n this._handler.mouseDownOutsideEvent()\n }\n\n this._unsubscribeOutsideEvents = () => {\n doc.removeEventListener('mousedown', outsideHandler)\n doc.removeEventListener('touchstart', outsideHandler)\n }\n\n doc.addEventListener('mousedown', outsideHandler)\n doc.addEventListener('touchstart', outsideHandler, { passive: true })\n }\n\n this._target.addEventListener('mouseleave', this._mouseLeaveHandler.bind(this))\n\n this._target.addEventListener('touchstart', this._mouseDownHandler.bind(this), { passive: true })\n if (!mobileTouch) {\n this._target.addEventListener('mousedown', this._mouseDownHandler.bind(this))\n }\n\n this._initPinch()\n\n // Hey mobile Safari, what's up?\n // If mobile Safari doesn't have any touchmove handler with passive=false\n // it treats a touchstart and the following touchmove events as cancelable=false,\n // so we can't prevent them (as soon we subscribe on touchmove inside handler of touchstart).\n // And we'll get scroll of the page along with chart's one instead of only chart's scroll.\n this._target.addEventListener('touchmove', () => {}, { passive: false })\n }\n\n _initPinch () {\n if (this._handler.pinchStartEvent === undefined &&\n this._handler.pinchEvent === undefined &&\n this._handler.pinchEndEvent === undefined\n ) {\n return\n }\n\n this._target.addEventListener(\n 'touchstart',\n (event) => this._checkPinchState(event.touches),\n { passive: true }\n )\n\n this._target.addEventListener(\n 'touchmove',\n (event) => {\n if (event.touches.length !== 2 || this._startPinchMiddlePoint === null) {\n return\n }\n\n if (this._handler.pinchEvent !== undefined) {\n const currentDistance = getDistance(event.touches[0], event.touches[1])\n const scale = currentDistance / this._startPinchDistance\n this._handler.pinchEvent(this._startPinchMiddlePoint, scale)\n preventDefault(event)\n }\n },\n { passive: false }\n )\n\n this._target.addEventListener('touchend', (event) => {\n this._checkPinchState(event.touches)\n })\n }\n\n _checkPinchState (touches) {\n if (touches.length === 1) {\n this._pinchPrevented = false\n }\n\n if (touches.length !== 2 || this._pinchPrevented || this._longTapActive) {\n this._stopPinch()\n } else {\n this._startPinch(touches)\n }\n }\n\n _startPinch (touches) {\n const box = getBoundingClientRect(this._target)\n this._startPinchMiddlePoint = {\n x: ((touches[0].clientX - box.left) + (touches[1].clientX - box.left)) / 2,\n y: ((touches[0].clientY - box.top) + (touches[1].clientY - box.top)) / 2\n }\n\n this._startPinchDistance = getDistance(touches[0], touches[1])\n\n if (this._handler.pinchStartEvent !== undefined) {\n this._handler.pinchStartEvent()\n }\n\n this._clearLongTapTimeout()\n }\n\n _stopPinch () {\n if (this._startPinchMiddlePoint === null) {\n return\n }\n\n this._startPinchMiddlePoint = null\n\n if (this._handler.pinchEndEvent !== undefined) {\n this._handler.pinchEndEvent()\n }\n }\n\n _mouseLeaveHandler (event) {\n if (this._unsubscribeMousemove) {\n this._unsubscribeMousemove()\n }\n const compatEvent = this._makeCompatEvent(event)\n this._processEvent(compatEvent, this._handler.mouseLeaveEvent)\n }\n\n _longTapHandler (event) {\n const compatEvent = this._makeCompatEvent(event)\n this._processEvent(compatEvent, this._handler.longTapEvent)\n this._cancelClick = true\n\n // long tap is active untill touchend event with 0 touches occured\n this._longTapActive = true\n }\n\n _processEvent (event, callback) {\n if (!callback) {\n return\n }\n callback.call(this._handler, event)\n }\n\n _makeCompatEvent (event) {\n // TouchEvent has no clientX/Y coordinates:\n // We have to use the last Touch instead\n let eventLike\n if ('touches' in event && event.touches.length) {\n eventLike = event.touches[0]\n } else if ('changedTouches' in event && event.changedTouches.length) {\n eventLike = event.changedTouches[0]\n } else {\n eventLike = event\n }\n\n const box = getBoundingClientRect(this._target)\n\n return {\n clientX: eventLike.clientX,\n clientY: eventLike.clientY,\n pageX: eventLike.pageX,\n pageY: eventLike.pageY,\n screenX: eventLike.screenX,\n screenY: eventLike.screenY,\n localX: eventLike.clientX - box.left,\n localY: eventLike.clientY - box.top,\n\n ctrlKey: event.ctrlKey,\n altKey: event.altKey,\n shiftKey: event.shiftKey,\n metaKey: event.metaKey,\n\n type: event.type.startsWith('mouse') ? EventType.MOUSE : EventType.TOUCH,\n\n target: eventLike.target,\n view: event.view\n }\n }\n}\n","import { EventType } from './EventBase'\n\nexport function isTouch (event) {\n return event.type === EventType.TOUCH\n}\n\nexport function isMouse (event) {\n return event.type === EventType.MOUSE\n}\n\nexport default class EventHandler {\n constructor (chartData) {\n this._chartData = chartData\n this._seriesSize = {}\n }\n\n _checkEventPointX (x) {\n return x > this._seriesSize.contentLeft && x < this._seriesSize.contentRight\n }\n\n setSeriesSize (seriesSize) {\n this._seriesSize = seriesSize\n }\n}\n","import {\n checkPointOnCircle, checkPointOnStraightLine,\n checkPointOnRayLine, checkPointOnSegmentLine,\n getParallelLines, getFibonacciLines\n} from '../utils/graphic'\nimport { isFunction } from '../utils/typeChecks'\nimport { CANDLE_STICK_SERIES_TAG } from '../series/ChartSeries'\nimport { GraphicMarkType } from '../data/ChartData'\nimport EventHandler from './EventHandler'\n\n/**\n * 标记图形绘制步骤\n * @type {{STEP_3: *, STEP_DONE: *, STEP_1: *, STEP_2: *}}\n */\nexport const GraphicMarkDrawStep = {\n STEP_1: 'step_1',\n STEP_2: 'step_2',\n STEP_3: 'step_3',\n STEP_DONE: 'step_done'\n}\n\nexport default class GraphicMarkEventHandler extends EventHandler {\n constructor (chartData, xAxis, yAxis) {\n super(chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n // 标记当没有画线时鼠标是否按下\n this._noneGraphicMarkMouseDownFlag = false\n\n // 用来记录当没有绘制标记图形时,鼠标操作后落点线上的数据\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: null,\n dataIndex: -1,\n onLine: false,\n onCircle: false,\n pointIndex: -1\n }\n }\n\n /**\n * 鼠标抬起事件\n * @param event\n */\n mouseUpEvent (event) {\n this._chartData.setDragGraphicMarkFlag(false)\n this._noneGraphicMarkMouseDownFlag = false\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: null,\n dataIndex: -1,\n onLine: false,\n onCircle: false,\n pointIndex: -1\n }\n }\n\n /**\n * 鼠标按下事件\n * @param event\n */\n mouseDownEvent (event) {\n if (!this._checkEventPointX(event.localX) || !this._checkEventPointY(event.localY)) {\n return\n }\n const point = { x: event.localX, y: event.localY }\n this._chartData.setGraphicMarkPoint(point)\n const graphicMarkType = this._chartData.graphicMarkType()\n switch (graphicMarkType) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.PRICE_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n this._twoStepGraphicMarkMouseDown(event, graphicMarkType)\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n this._threeStepGraphicMarkMouseDown(event, graphicMarkType)\n break\n }\n case GraphicMarkType.NONE: {\n this._noneGraphicMarkMouseLeftDown(event)\n break\n }\n }\n }\n\n mouseRightDownEvent (event) {\n const graphicMarkType = this._chartData.graphicMarkType()\n if (graphicMarkType === GraphicMarkType.NONE) {\n this._findNoneGraphicMarkMouseDownActiveData(event)\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n graphicMarkData.splice(dataIndex, 1)\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n this.mouseUpEvent(event)\n }\n }\n }\n\n /**\n * 两步形成的标记图形鼠标按下处理\n * @param event\n * @param markKey\n */\n _twoStepGraphicMarkMouseDown (event, markKey) {\n this._graphicMarkMouseDown(event, markKey, (lastLineData) => {\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_2\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_DONE\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n break\n }\n }\n })\n }\n\n /**\n * 两个点形成的标记图形鼠标按下事件\n * @param event\n * @param markKey\n */\n _threeStepGraphicMarkMouseDown (event, markKey) {\n this._graphicMarkMouseDown(event, markKey, (lastLineData) => {\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_2\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_3\n break\n }\n case GraphicMarkDrawStep.STEP_3: {\n lastLineData.drawStep = GraphicMarkDrawStep.STEP_DONE\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n break\n }\n }\n })\n }\n\n /**\n * 绘制标记图形时鼠标按下事件\n * @param event\n * @param markKey\n * @param performDifPoint\n */\n _graphicMarkMouseDown (event, markKey, performDifPoint) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n if (event.button === 2) {\n graphicMarkData.splice(graphicMarkData.length - 1, 1)\n this._chartData.setGraphicMarkType(GraphicMarkType.NONE)\n } else {\n const lastLineData = graphicMarkData[graphicMarkData.length - 1]\n performDifPoint(lastLineData)\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n }\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n // this.graphicMarkChart.flush()\n }\n\n /**\n * 没有绘制时鼠标按下事件\n */\n _noneGraphicMarkMouseLeftDown (event) {\n this._findNoneGraphicMarkMouseDownActiveData(event)\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n if (this._noneGraphicMarkMouseDownActiveData.onCircle) {\n this._noneGraphicMarkMouseDownFlag = true\n this._chartData.setDragGraphicMarkFlag(true)\n }\n }\n }\n\n /**\n * 查找没有绘制时鼠标按下时在哪条数据上\n * @param event\n */\n _findNoneGraphicMarkMouseDownActiveData (event) {\n const point = { x: event.localX, y: event.localY }\n const keys = Object.keys(this._chartData.graphicMarkData())\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n switch (key) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(\n xyPoints[0], { x: this._seriesSize.contentRight, y: xyPoints[0].y }, point\n )\n })) {\n return\n }\n break\n }\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(\n xyPoints[0], { x: xyPoints[0].x, y: this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentBottom }, point\n )\n })) {\n return\n }\n break\n }\n case GraphicMarkType.STRAIGHT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnStraightLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.RAY_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnRayLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE:\n case GraphicMarkType.SEGMENT_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n return checkPointOnSegmentLine(xyPoints[0], xyPoints[1], point)\n })) {\n return\n }\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n if (this._realFindNoneGraphicMarkMouseDownActiveData(key, point, (xyPoints) => {\n let linePoints = []\n const size = {\n width: this._seriesSize.contentRight - this._seriesSize.contentLeft,\n height: this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentBottom - this._seriesSize.tags[CANDLE_STICK_SERIES_TAG].contentTop\n }\n switch (key) {\n case GraphicMarkType.PRICE_CHANNEL_LINE: {\n linePoints = getParallelLines(xyPoints, size, true)\n break\n }\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n linePoints = getParallelLines(xyPoints, size)\n break\n }\n case GraphicMarkType.FIBONACCI_LINE: {\n linePoints = getFibonacciLines(xyPoints, size)\n break\n }\n }\n let isOnGraphicMark = false\n for (let i = 0; i < linePoints.length; i++) {\n const points = linePoints[i]\n isOnGraphicMark = checkPointOnStraightLine(points[0], points[1], point)\n if (isOnGraphicMark) {\n return isOnGraphicMark\n }\n }\n return isOnGraphicMark\n })) {\n return\n }\n break\n }\n }\n }\n }\n\n /**\n * 查找没有绘制图时鼠标按下时落点在哪条数据上\n * @param markKey\n * @param point\n * @param checkPointOnLine\n * @returns {boolean}\n */\n _realFindNoneGraphicMarkMouseDownActiveData (markKey, point, checkPointOnLine) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const graphicMark = this._chartData.styleOptions().graphicMark\n graphicMarkData.forEach((data, index) => {\n const points = data.points\n const xyPoints = []\n let isOnCircle = false\n let pointIndex = -1\n points.forEach((p, i) => {\n const x = this._xAxis.convertToPixel(p.xPos)\n const y = this._yAxis.convertToPixel(p.price)\n xyPoints.push({ x, y })\n const isOn = checkPointOnCircle({ x, y }, graphicMark.point.radius, point)\n if (isOn) {\n pointIndex = i\n }\n if (!isOnCircle) {\n isOnCircle = isOn\n }\n })\n const isOnLine = checkPointOnLine(xyPoints, point)\n if (isOnLine || isOnCircle) {\n this._noneGraphicMarkMouseDownActiveData = {\n markKey: markKey,\n dataIndex: index,\n onLine: isOnLine,\n onCircle: isOnCircle,\n pointIndex\n }\n return true\n }\n })\n return false\n }\n\n /**\n * 鼠标移动事件\n */\n mouseMoveEvent (event) {\n if (!this._checkEventPointX(event.localX) || !this._checkEventPointY(event.localY)) {\n return\n }\n const point = { x: event.localX, y: event.localY }\n this._chartData.setGraphicMarkPoint(point)\n if (!this._waitingForMouseMoveAnimationFrame) {\n this._waitingForMouseMoveAnimationFrame = true\n const graphicMarkType = this._chartData.graphicMarkType()\n switch (graphicMarkType) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE: {\n this._onePointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType, (lastLineData, { price }) => {\n lastLineData.points[0].price = price\n })\n break\n }\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE: {\n this._twoPointGraphicMarkMouseMove(point, graphicMarkType, (lastLineData, { xPos }) => {\n lastLineData.points[0].xPos = xPos\n })\n break\n }\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE: {\n this._threePointGraphicMarkMouseMove(point, graphicMarkType)\n break\n }\n case GraphicMarkType.NONE: {\n this._chartData.setGraphicMarkData(this._chartData.graphicMarkData())\n break\n }\n }\n this._waitingForMouseMoveAnimationFrame = false\n }\n }\n\n pressedMouseMoveEvent (event) {\n const markKey = this._noneGraphicMarkMouseDownActiveData.markKey\n const dataIndex = this._noneGraphicMarkMouseDownActiveData.dataIndex\n if (markKey && dataIndex !== -1) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const point = { x: event.localX, y: event.localY }\n switch (markKey) {\n case GraphicMarkType.HORIZONTAL_STRAIGHT_LINE:\n case GraphicMarkType.VERTICAL_STRAIGHT_LINE:\n case GraphicMarkType.PRICE_LINE:\n case GraphicMarkType.STRAIGHT_LINE:\n case GraphicMarkType.RAY_LINE:\n case GraphicMarkType.SEGMENT_LINE:\n case GraphicMarkType.PRICE_CHANNEL_LINE:\n case GraphicMarkType.PARALLEL_STRAIGHT_LINE:\n case GraphicMarkType.FIBONACCI_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n graphicMarkData[dataIndex].points[pointIndex].xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[pointIndex].price = this._yAxis.convertFromPixel(point.y)\n }\n break\n }\n case GraphicMarkType.HORIZONTAL_RAY_LINE:\n case GraphicMarkType.HORIZONTAL_SEGMENT_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n const price = this._yAxis.convertFromPixel(point.y)\n graphicMarkData[dataIndex].points[pointIndex].xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[0].price = price\n graphicMarkData[dataIndex].points[1].price = price\n }\n break\n }\n case GraphicMarkType.VERTICAL_RAY_LINE:\n case GraphicMarkType.VERTICAL_SEGMENT_LINE: {\n const pointIndex = this._noneGraphicMarkMouseDownActiveData.pointIndex\n if (pointIndex !== -1) {\n const xPos = this._xAxis.convertFromPixel(point.x)\n graphicMarkData[dataIndex].points[0].xPos = xPos\n graphicMarkData[dataIndex].points[1].xPos = xPos\n graphicMarkData[dataIndex].points[pointIndex].price = this._yAxis.convertFromPixel(point.y)\n }\n break\n }\n }\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkPoint({ x: event.localX, y: event.localY })\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n }\n }\n\n /**\n * 一个点形成的图形鼠标移动事件\n * @param point\n * @param markKey\n */\n _onePointGraphicMarkMouseMove (point, markKey) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1:\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.points[0].xPos = xPos\n lastLineData.points[0].price = price\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 两个点形成的线鼠标移动事件\n * @param point\n * @param markKey\n * @param stepTwo\n */\n _twoPointGraphicMarkMouseMove (point, markKey, stepTwo) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }, { xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.points[0] = { xPos, price }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n lastLineData.points[1] = { xPos, price }\n if (isFunction(stepTwo)) {\n stepTwo(lastLineData, { xPos, price })\n }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 三步形成的标记图形鼠标移动事件\n * @param point\n * @param markKey\n * @param stepTwo\n */\n _threePointGraphicMarkMouseMove (point, markKey, stepTwo) {\n this._graphicMarkMouseMove(point, markKey, (graphicMarkData, lastLineData) => {\n const xPos = this._xAxis.convertFromPixel(point.x)\n const price = this._yAxis.convertFromPixel(point.y)\n switch (lastLineData.drawStep) {\n case GraphicMarkDrawStep.STEP_DONE: {\n graphicMarkData.push({ points: [{ xPos, price }, { xPos, price }], drawStep: GraphicMarkDrawStep.STEP_1 })\n break\n }\n case GraphicMarkDrawStep.STEP_1: {\n lastLineData.points[0] = { xPos, price }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_2: {\n if (isFunction(stepTwo)) {\n stepTwo(lastLineData, { xPos, price })\n }\n lastLineData.points[1] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n case GraphicMarkDrawStep.STEP_3: {\n lastLineData.points[2] = { xPos, price }\n graphicMarkData[graphicMarkData.length - 1] = lastLineData\n break\n }\n }\n })\n }\n\n /**\n * 绘制标记图形时鼠标移动事件\n * @param point\n * @param markKey\n * @param performDifPoint\n */\n _graphicMarkMouseMove (point, markKey, performDifPoint) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n const lastLineData = graphicMarkData[graphicMarkData.length - 1] || { drawStep: GraphicMarkDrawStep.STEP_DONE }\n performDifPoint(graphicMarkData, lastLineData)\n graphicMarkDatas[markKey] = graphicMarkData\n this._chartData.setGraphicMarkData(graphicMarkDatas)\n // this.graphicMarkChart.flush()\n }\n\n _checkEventPointY (y) {\n const size = this._seriesSize.tags[CANDLE_STICK_SERIES_TAG]\n return y > size.contentTop && y < size.contentBottom\n }\n}\n","import View from './View'\nimport {\n checkPointOnCircle,\n checkPointOnRayLine,\n checkPointOnSegmentLine,\n checkPointOnStraightLine, getFibonacciLines,\n getLinearY,\n getParallelLines\n} from '../utils/graphic'\n\nimport { GraphicMarkType } from '../data/ChartData'\nimport { GraphicMarkDrawStep } from '../event/GraphicMarkEventHandler'\nimport { formatPrecision } from '../utils/format'\nimport { drawHorizontalLine, drawVerticalLine, getFont, strokeInPixel } from '../utils/canvas'\n\nconst LineType = {\n COMMON: 0,\n HORIZONTAL: 1,\n VERTICAL: 2\n}\n\nexport default class GraphicMarkView extends View {\n constructor (container, chartData, xAxis, yAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n this._yAxis = yAxis\n }\n\n _draw () {\n const graphicMark = this._chartData.styleOptions().graphicMark\n const pricePrecision = this._chartData.precisionOptions().price\n // 画线\n this._drawHorizontalStraightLine(graphicMark)\n this._drawVerticalStraightLine(graphicMark)\n this._drawStraightLine(graphicMark)\n this._drawHorizontalRayLine(graphicMark)\n this._drawVerticalRayLine(graphicMark)\n this._drawRayLine(graphicMark)\n this._drawSegmentLine(graphicMark)\n this._drawPriceLine(graphicMark, pricePrecision)\n this._drawPriceChannelLine(graphicMark)\n this._drawParallelStraightLine(graphicMark)\n this._drawFibonacciLine(graphicMark, pricePrecision)\n }\n\n /**\n * 渲染水平直线\n * @param graphicMark\n */\n _drawHorizontalStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return [[\n {\n x: 0,\n y: points[0].y\n }, {\n x: this._width,\n y: points[0].y\n }\n ]]\n }\n )\n }\n\n /**\n * 渲染垂直直线\n * @param graphicMark\n */\n _drawVerticalStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return [[\n {\n x: points[0].x,\n y: 0\n }, {\n x: points[0].x,\n y: this._height\n }\n ]]\n }\n )\n }\n\n /**\n * 渲染直线\n * @param graphicMark\n */\n _drawStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n if (points[0].x === points[1].x) {\n return [[\n {\n x: points[0].x,\n y: 0\n }, {\n x: points[0].x,\n y: this._height\n }\n ]]\n }\n const y = getLinearY(\n points[0], points[1],\n [\n {\n x: 0,\n y: points[0].y\n }, {\n x: this._width,\n y: points[0].y\n }\n ]\n )\n return [[\n {\n x: 0,\n y: y[0]\n }, {\n x: this._width,\n y: y[1]\n }\n ]]\n }\n )\n }\n\n /**\n * 绘制水平射线\n * @param graphicMark\n */\n _drawHorizontalRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n const point = { x: 0, y: points[0].y }\n if (points[0].x < points[1].x) {\n point.x = this._width\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 绘制垂直射线\n * @param graphicMark\n */\n _drawVerticalRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n const point = { x: points[0].x, y: 0 }\n if (points[0].y < points[1].y) {\n point.y = this._height\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 渲染射线\n * @param graphicMark\n */\n _drawRayLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.RAY_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n let point\n if (points[0].x === points[1].x && points[0].y !== points[1].y) {\n if (points[0].y < points[1].y) {\n point = {\n x: points[0].x,\n y: this._height\n }\n } else {\n point = {\n x: points[0].x,\n y: 0\n }\n }\n } else if (points[0].x > points[1].x) {\n point = {\n x: 0,\n y: getLinearY(points[0], points[1], [{ x: 0, y: points[0].y }])[0]\n }\n } else {\n point = {\n x: this._width,\n y: getLinearY(points[0], points[1], [{ x: this._width, y: points[0].y }])[0]\n }\n }\n return [[points[0], point]]\n }\n )\n }\n\n /**\n * 绘制线段,水平线段,垂直线段,普通线段一起绘制\n * @param graphicMark\n */\n _drawSegmentLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.HORIZONTAL_SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n this._drawPointGraphicMark(\n GraphicMarkType.VERTICAL_SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n this._drawPointGraphicMark(\n GraphicMarkType.SEGMENT_LINE, graphicMark, checkPointOnSegmentLine\n )\n }\n\n /**\n * 绘制价格线\n * @param graphicMark\n * @param pricePrecision\n */\n _drawPriceLine (graphicMark, pricePrecision) {\n this._drawPointGraphicMark(\n GraphicMarkType.PRICE_LINE, graphicMark, checkPointOnRayLine,\n (points) => {\n return [[points[0], { x: this._width, y: points[0].y }]]\n },\n true, pricePrecision\n )\n }\n\n /**\n * 渲染价格通道线\n * @param graphicMark\n */\n _drawPriceChannelLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.PRICE_CHANNEL_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getParallelLines(points, { width: this._width, height: this._height }, true)\n }\n )\n }\n\n /**\n * 渲染平行直线\n * @param graphicMark\n */\n _drawParallelStraightLine (graphicMark) {\n this._drawPointGraphicMark(\n GraphicMarkType.PARALLEL_STRAIGHT_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getParallelLines(points, { width: this._width, height: this._height })\n }\n )\n }\n\n /**\n * 渲染斐波那契线\n * @param graphicMark\n * @param pricePrecision\n */\n _drawFibonacciLine (graphicMark, pricePrecision) {\n this._drawPointGraphicMark(\n GraphicMarkType.FIBONACCI_LINE, graphicMark, checkPointOnStraightLine,\n (points) => {\n return getFibonacciLines(points, { width: this._width, height: this._height })\n }, true, pricePrecision, ['(100.0%)', '(78.6%)', '(61.8%)', '(50.0%)', '(38.2%)', '(23.6%)', '(0.0%)']\n )\n }\n\n /**\n * 渲染点形成的图形\n * @param markKey\n * @param graphicMark\n * @param checkPointOnLine\n * @param generatedLinePoints\n * @param isDrawPrice\n * @param pricePrecision\n * @param priceExtendsText\n */\n _drawPointGraphicMark (markKey, graphicMark, checkPointOnLine, generatedLinePoints, isDrawPrice, pricePrecision, priceExtendsText) {\n const graphicMarkDatas = this._chartData.graphicMarkData()\n const graphicMarkData = graphicMarkDatas[markKey]\n graphicMarkData.forEach(({ points, drawStep }) => {\n const circlePoints = []\n points.forEach(({ xPos, price }) => {\n const x = this._xAxis.convertToPixel(xPos)\n const y = this._yAxis.convertToPixel(price)\n circlePoints.push({ x, y })\n })\n const linePoints = generatedLinePoints ? generatedLinePoints(circlePoints) : [circlePoints]\n this._drawGraphicMark(\n graphicMark, linePoints, circlePoints, drawStep,\n checkPointOnLine,\n isDrawPrice, pricePrecision, priceExtendsText\n )\n })\n }\n\n /**\n * 绘制标记图形\n * @param graphicMark\n * @param linePoints\n * @param circlePoints\n * @param drawStep\n * @param checkPointOnLine\n * @param isDrawPrice\n * @param pricePrecision\n * @param priceExtendsText\n */\n _drawGraphicMark (\n graphicMark, linePoints, circlePoints, drawStep, checkPointOnLine,\n isDrawPrice, pricePrecision, priceExtendsText = []\n ) {\n const graphicMarkPoint = this._chartData.graphicMarkPoint()\n let isOnLine = false\n linePoints.forEach((points, i) => {\n if (points.length > 1) {\n const isOn = checkPointOnLine(points[0], points[1], graphicMarkPoint)\n if (!isOnLine) {\n isOnLine = isOn\n }\n if (drawStep !== GraphicMarkDrawStep.STEP_1) {\n this._ctx.strokeStyle = graphicMark.line.color\n this._ctx.lineWidth = graphicMark.line.size\n const lineType = this._getLineType(points[0], points[1])\n switch (lineType) {\n case LineType.COMMON: {\n strokeInPixel(this._ctx, () => {\n this._ctx.beginPath()\n this._ctx.moveTo(points[0].x, points[0].y)\n this._ctx.lineTo(points[1].x, points[1].y)\n this._ctx.stroke()\n this._ctx.closePath()\n })\n break\n }\n case LineType.HORIZONTAL: {\n drawHorizontalLine(this._ctx, points[0].y, points[0].x, points[1].x)\n break\n }\n case LineType.VERTICAL: {\n drawVerticalLine(this._ctx, points[0].x, points[0].y, points[1].y)\n break\n }\n default: { break }\n }\n // 渲染价格\n if (isDrawPrice) {\n const price = this._yAxis.convertFromPixel(points[0].y)\n const priceText = formatPrecision(price, pricePrecision)\n const textSize = graphicMark.text.size\n this._ctx.font = getFont(textSize)\n this._ctx.fillStyle = graphicMark.text.color\n this._ctx.fillText(`${priceText} ${priceExtendsText[i] || ''}`, points[0].x + graphicMark.text.marginLeft, points[0].y - graphicMark.text.marginBottom)\n }\n }\n }\n })\n const radius = graphicMark.point.radius\n let isCircleActive = false\n for (let i = 0; i < circlePoints.length; i++) {\n isCircleActive = checkPointOnCircle(circlePoints[i], radius, graphicMarkPoint)\n if (isCircleActive) {\n break\n }\n }\n circlePoints.forEach(circlePoint => {\n const isOnCircle = checkPointOnCircle(circlePoint, radius, graphicMarkPoint)\n if (isCircleActive || isOnLine) {\n let circleRadius = radius\n let circleColor = graphicMark.point.backgroundColor\n let circleBorderColor = graphicMark.point.borderColor\n let circleBorderSize = graphicMark.point.borderSize\n if (isOnCircle) {\n circleRadius = graphicMark.point.activeRadius\n circleColor = graphicMark.point.activeBackgroundColor\n circleBorderColor = graphicMark.point.activeBorderColor\n circleBorderSize = graphicMark.point.activeBorderSize\n }\n this._ctx.fillStyle = circleColor\n this._ctx.beginPath()\n this._ctx.arc(circlePoint.x, circlePoint.y, circleRadius, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.fill()\n this._ctx.lineWidth = circleBorderSize\n this._ctx.strokeStyle = circleBorderColor\n this._ctx.beginPath()\n this._ctx.arc(circlePoint.x, circlePoint.y, circleRadius, 0, Math.PI * 2)\n this._ctx.closePath()\n this._ctx.stroke()\n }\n })\n }\n\n /**\n * 获取绘制线类型\n * @param point1\n * @param point2\n * @private\n */\n _getLineType (point1, point2) {\n if (point1.x === point2.x) {\n return LineType.VERTICAL\n }\n if (point1.y === point2.y) {\n return LineType.HORIZONTAL\n }\n return LineType.COMMON\n }\n}\n","import CandleStickView from '../view/CandleStickView'\nimport CandleStickFloatLayerView from '../view/CandleStickFloatLayerView'\nimport TechnicalIndicatorWidget from './TechnicalIndicatorWidget'\nimport { InvalidateLevel } from '../data/ChartData'\nimport GraphicMarkView from '../view/GraphicMarkView'\n\nexport default class CandleStickWidget extends TechnicalIndicatorWidget {\n _createMainView (container, props) {\n return new CandleStickView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n _createExpandView (container, props) {\n return new GraphicMarkView(container, props.chartData, props.xAxis, props.yAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new CandleStickFloatLayerView(container, props.chartData, props.xAxis, props.yAxis, props.additionalDataProvider)\n }\n\n invalidate (level) {\n if (level === InvalidateLevel.GRAPHIC_MARK) {\n this._expandView.flush()\n } else {\n super.invalidate(level)\n }\n }\n\n setSize (width, height) {\n super.setSize(width, height)\n this._expandView.setSize(width, height)\n }\n}\n","import TechnicalIndicatorSeries from './TechnicalIndicatorSeries'\nimport CandleStickWidget from '../widget/CandleStickWidget'\nimport { ChartType } from '../data/options/styleOptions'\nimport YAxis, { YAxisType } from '../component/YAxis'\nimport { InvalidateLevel } from '../data/ChartData'\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\n\nexport default class CandleStickSeries extends TechnicalIndicatorSeries {\n constructor (props) {\n super(props)\n this._chartType = ChartType.CANDLE_STICK\n }\n\n _createYAxis (props) {\n return new YAxis(props.chartData, YAxisType.CANDLE_STICK)\n }\n\n _createMainWidget (container, props) {\n return new CandleStickWidget({\n container,\n chartData: props.chartData,\n xAxis: props.xAxis,\n yAxis: this._yAxis,\n additionalDataProvider: {\n technicalIndicatorType: this.technicalIndicatorType.bind(this),\n chartType: this.chartType.bind(this),\n tag: this.tag.bind(this)\n }\n })\n }\n\n _isRealTime () {\n return this._chartType === ChartType.REAL_TIME\n }\n\n chartType () {\n return this._chartType\n }\n\n setChartType (chartType) {\n if (this._chartType !== chartType) {\n this._chartType = chartType\n if (this._chartData.styleOptions().realTime.averageLine.display && this._isRealTime()) {\n this._chartData.calcTechnicalIndicator(TechnicalIndicatorType.AVERAGE)\n }\n this.invalidate(InvalidateLevel.FULL)\n }\n }\n}\n","import View from './View'\nimport { drawHorizontalLine, drawVerticalLine, getFont } from '../utils/canvas'\n\nexport default class XAxisView extends View {\n constructor (container, chartData, xAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n }\n\n _draw () {\n const xAxisOptions = this._chartData.styleOptions().xAxis\n if (xAxisOptions.display) {\n this._drawAxisLine(xAxisOptions)\n this._drawTickLines(xAxisOptions)\n this._drawTickLabels(xAxisOptions)\n }\n }\n\n _drawAxisLine (xAxisOptions) {\n const xAxisLine = xAxisOptions.axisLine\n if (!xAxisLine.display) {\n return\n }\n this._ctx.strokeStyle = xAxisLine.color\n this._ctx.lineWidth = xAxisLine.size\n drawHorizontalLine(this._ctx, 0, 0, this._width)\n }\n\n _drawTickLines (xAxisOptions) {\n const tickLine = xAxisOptions.tickLine\n if (!tickLine.display) {\n return\n }\n this._ctx.lineWidth = tickLine.size\n this._ctx.strokeStyle = tickLine.color\n\n const startY = xAxisOptions.axisLine.display ? xAxisOptions.axisLine.size : 0\n\n const endY = startY + tickLine.length\n this._xAxis.ticks().forEach(tick => {\n drawVerticalLine(this._ctx, tick.x, startY, endY)\n })\n }\n\n _drawTickLabels (xAxisOptions) {\n const tickText = xAxisOptions.tickText\n if (!tickText.display) {\n return\n }\n const tickLine = xAxisOptions.tickLine\n\n this._ctx.textBaseline = 'top'\n this._ctx.font = getFont(tickText.size)\n this._ctx.textAlign = 'center'\n this._ctx.fillStyle = tickText.color\n\n let labelY = tickText.margin\n if (xAxisOptions.axisLine.display) {\n labelY += (xAxisOptions.axisLine.size)\n }\n if (tickLine.display) {\n labelY += (tickLine.length)\n }\n const ticks = this._xAxis.ticks()\n const tickLength = ticks.length\n for (let i = 0; i < tickLength; i++) {\n this._ctx.fillText(ticks[i].v, ticks[i].x, labelY)\n }\n }\n}\n","import AxisFloatLayerView from './AxisFloatLayerView'\nimport { formatDate } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\n\nexport default class XAxisFloatLayerView extends AxisFloatLayerView {\n _drawCrossHairLabel () {\n if (!this._chartData.crossHairSeriesTag()) {\n return\n }\n const crossHair = this._chartData.styleOptions().floatLayer.crossHair\n const crossHairVertical = crossHair.vertical\n const crossHairVerticalText = crossHairVertical.text\n if (!crossHair.display || !crossHairVertical.display || !crossHairVerticalText.display) {\n return\n }\n const crossHairPoint = this._chartData.crossHairPoint()\n let dataPos\n if (crossHairPoint) {\n dataPos = this._axis.convertFromPixel(crossHairPoint.x)\n } else {\n dataPos = this._chartData.dataList().length - 1\n }\n const kLineData = this._chartData.dataList()[dataPos]\n if (!kLineData) {\n return\n }\n const x = this._axis.convertToPixel(dataPos)\n const timestamp = kLineData.timestamp\n const text = formatDate(timestamp, 'YYYY-MM-DD hh:mm', this._chartData.timezone())\n\n const textSize = crossHairVerticalText.size\n this._ctx.font = getFont(textSize)\n const labelWidth = calcTextWidth(this._ctx, text)\n let xAxisLabelX = x - labelWidth / 2\n\n const paddingLeft = crossHairVerticalText.paddingLeft\n const paddingRight = crossHairVerticalText.paddingRight\n const paddingTop = crossHairVerticalText.paddingTop\n const paddingBottom = crossHairVerticalText.paddingBottom\n const borderSize = crossHairVerticalText.borderSize\n\n // 保证整个x轴上的提示文字总是完全显示\n if (xAxisLabelX < paddingLeft + borderSize) {\n xAxisLabelX = paddingLeft + borderSize\n } else if (xAxisLabelX > this._width - labelWidth - borderSize - paddingRight) {\n xAxisLabelX = this._width - labelWidth - borderSize - paddingRight\n }\n\n const rectLeft = xAxisLabelX - borderSize - paddingLeft\n const rectTop = 0\n const rectRight = xAxisLabelX + labelWidth + borderSize + paddingRight\n const rectBottom = rectTop + textSize + borderSize * 2 + paddingTop + paddingBottom\n this._ctx.fillStyle = crossHairVerticalText.backgroundColor\n this._ctx.fillRect(rectLeft, rectTop, rectRight - rectLeft, rectBottom - rectTop)\n\n this._ctx.lineWidth = borderSize\n this._ctx.strokeStyle = crossHairVerticalText.borderColor\n this._ctx.strokeRect(rectLeft, rectTop, rectRight - rectLeft, rectBottom - rectTop)\n\n // 绘制轴上的提示文字\n this._ctx.textBaseline = 'top'\n\n this._ctx.fillStyle = crossHairVerticalText.color\n this._ctx.fillText(\n text, xAxisLabelX, borderSize + paddingTop\n )\n }\n}\n","import Widget from './Widget'\nimport XAxisView from '../view/XAxisView'\nimport XAxisFloatLayerView from '../view/XAxisFloatLayerView'\n\nexport default class XAxisWidget extends Widget {\n _createMainView (container, props) {\n return new XAxisView(container, props.chartData, props.xAxis)\n }\n\n _createFloatLayerView (container, props) {\n return new XAxisFloatLayerView(container, props.chartData, props.xAxis)\n }\n}\n","import Axis from './Axis'\nimport { calcTextWidth, getFont, getPixelRatio } from '../utils/canvas'\nimport { formatDate, formatValue } from '../utils/format'\n\nexport default class XAxis extends Axis {\n constructor (chartData) {\n super(chartData)\n this._initMeasureCanvas()\n }\n\n _initMeasureCanvas () {\n const measureCanvas = document.createElement('canvas')\n this._measureCtx = measureCanvas.getContext('2d')\n const pixelRatio = getPixelRatio(this._measureCtx)\n this._measureCtx.scale(pixelRatio, pixelRatio)\n }\n\n _computeMinMaxValue () {\n const min = this._chartData.from()\n const max = this._chartData.to() - 1\n const range = max - min\n return { min, max, range }\n }\n\n _computeOptimalTicks (ticks) {\n const optimalTicks = []\n const tickLength = ticks.length\n const dataList = this._chartData.dataList()\n if (tickLength > 0) {\n const timezone = this._chartData.timezone()\n const fontSize = this._chartData.styleOptions().xAxis.tickText.size\n this._measureCtx.font = getFont(fontSize)\n const defaultLabelWidth = calcTextWidth(this._measureCtx, '00-00 00:00')\n const pos = parseInt(ticks[0].v)\n const timestamp = formatValue(dataList[pos], 'timestamp', 0)\n const x = this.convertToPixel(pos)\n let tickCountDif = 1\n let tickLabelFormatType = 'MM:DD hh:mm'\n if (tickLength > 1) {\n const nextPos = parseInt(ticks[1].v)\n const nextTimestamp = formatValue(dataList[nextPos], 'timestamp', 0)\n const nextX = this.convertToPixel(nextPos)\n const xDif = Math.abs(nextX - x)\n if (xDif < defaultLabelWidth) {\n tickCountDif = Math.ceil(defaultLabelWidth / xDif)\n }\n const timeDif = nextTimestamp - timestamp\n const minuteDif = timeDif / 1000 / 60\n if (minuteDif < 12 * 60) {\n tickLabelFormatType = 'hh:mm'\n } else if (minuteDif < 15 * 24 * 60) {\n tickLabelFormatType = 'MM-DD'\n } else if (minuteDif < 180 * 24 * 60) {\n tickLabelFormatType = 'YYYY-MM'\n } else {\n tickLabelFormatType = 'YYYY'\n }\n }\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const pos = parseInt(ticks[i].v)\n const kLineData = dataList[pos]\n const timestamp = kLineData.timestamp\n let label = formatDate(timestamp, tickLabelFormatType, timezone)\n if (i <= tickLength - 1 - tickCountDif) {\n const nextPos = parseInt(ticks[i + tickCountDif].v)\n const nextKLineData = dataList[nextPos]\n const nextTimestamp = nextKLineData.timestamp\n const year = formatDate(timestamp, 'YYYY', timezone)\n const month = formatDate(timestamp, 'YYYY-MM', timezone)\n const day = formatDate(timestamp, 'MM-DD', timezone)\n if (year !== formatDate(nextTimestamp, 'YYYY', timezone)) {\n label = year\n } else if (month !== formatDate(nextTimestamp, 'YYYY-MM', timezone)) {\n label = month\n } else if (day !== formatDate(nextTimestamp, 'MM-DD', timezone)) {\n label = day\n }\n }\n\n const x = this.convertToPixel(pos)\n if (x > defaultLabelWidth / 2 &&\n x < this._width - defaultLabelWidth / 2) {\n optimalTicks.push({ v: label, x })\n }\n }\n if (optimalTicks.length === 0) {\n const pos = parseInt(ticks[ticks.length - 1].v)\n const timestamp = dataList[pos].timestamp\n const x = this.convertToPixel(pos)\n optimalTicks.push({ v: formatDate(timestamp, 'MM-DD', timezone), x })\n }\n }\n return optimalTicks\n }\n\n convertFromPixel (pixel) {\n const dataSpace = this._chartData.dataSpace()\n const range = Math.ceil(pixel / dataSpace)\n let dataPos = this._chartData.from() + range - 1\n const to = this._chartData.to()\n if (dataPos > to - 1) {\n dataPos = to - 1\n }\n return dataPos\n }\n\n convertToPixel (value) {\n const dataSpace = this._chartData.dataSpace()\n return Math.round((value - this._chartData.from()) * dataSpace + this._chartData.barSpace() / 2)\n }\n}\n","import Series from './Series'\nimport XAxisWidget from '../widget/XAxisWidget'\nimport XAxis from '../component/XAxis'\n\nexport default class XAxisSeries extends Series {\n _initBefore () {\n this._xAxis = new XAxis(this._chartData)\n }\n\n _createMainWidget (container, props) {\n return new XAxisWidget({ container, chartData: props.chartData, xAxis: this._xAxis })\n }\n\n _computeAxis () {\n this._xAxis.computeAxis()\n }\n\n xAxis () {\n return this._xAxis\n }\n\n setSize (mainWidgetSize, yAxisWidgetSize) {\n this._xAxis.setSize(mainWidgetSize.width, mainWidgetSize.height)\n this._computeAxis()\n super.setSize(mainWidgetSize, yAxisWidgetSize)\n }\n}\n","import EventBase from '../event/EventBase'\nimport { getPixelRatio } from '../utils/canvas'\n\nexport default class SeparatorSeries {\n constructor (container, chartData, seriesIndex, dragEventHandler) {\n this._chartData = chartData\n this._seriesIndex = seriesIndex\n this._width = 0\n this._offsetLeft = 0\n this._dragEventHandler = dragEventHandler\n this._initElement(container)\n }\n\n _initElement (container) {\n this._container = container\n this._wrapper = document.createElement('div')\n this._wrapper.style.margin = '0'\n this._wrapper.style.padding = '0'\n this._wrapper.style.position = 'relative'\n this._wrapper.style.overflow = 'hidden'\n this._wrapper.style.zIndex = '10'\n this._element = document.createElement('div')\n this._element.style.margin = '0'\n this._element.style.padding = '0'\n this._element.style.cursor = 'ns-resize'\n this._element.style.height = '6px'\n this._wrapper.appendChild(this._element)\n const lastElement = container.lastChild\n if (lastElement) {\n container.insertBefore(this._wrapper, lastElement)\n } else {\n container.appendChild(this._wrapper)\n }\n this._dragEvent = new EventBase(this._element, {\n mouseDownEvent: this._mouseDownEvent.bind(this),\n pressedMouseMoveEvent: this._pressedMouseMoveEvent.bind(this)\n }, {\n treatVertTouchDragAsPageScroll: false,\n treatHorzTouchDragAsPageScroll: true\n })\n }\n\n _mouseDownEvent (event) {\n this._startY = event.pageY\n this._dragEventHandler.startDrag(this._seriesIndex)\n }\n\n _pressedMouseMoveEvent (event) {\n const dragDistance = event.pageY - this._startY\n this._dragEventHandler.drag(dragDistance, this._seriesIndex)\n }\n\n /**\n * 获取高度\n * @returns {number}\n */\n height () {\n return this._wrapper.offsetHeight\n }\n\n /**\n * 设置尺寸\n * 用于fill属性\n * @param offsetLeft\n * @param width\n */\n setSize (offsetLeft, width) {\n this._offsetLeft = offsetLeft\n this._width = width\n this.invalidate()\n }\n\n /**\n * 更新上下两个图表的索引\n * @param seriesIndex\n */\n updateSeriesIndex (seriesIndex) {\n this._seriesIndex = seriesIndex\n }\n\n /**\n * 刷新\n */\n invalidate () {\n const separator = this._chartData.styleOptions().separator\n this._wrapper.style.backgroundColor = separator.color\n this._wrapper.style.height = `${separator.size}px`\n this._wrapper.style.marginLeft = `${separator.fill ? 0 : this._offsetLeft}px`\n this._wrapper.style.width = separator.fill ? '100%' : `${this._width}px`\n }\n\n /**\n * 将图形转换成图片\n * @returns {HTMLCanvasElement}\n */\n getImage () {\n const separator = this._chartData.styleOptions().separator\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._wrapper.offsetWidth\n const height = separator.size\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n ctx.fillStyle = separator.color\n ctx.fillRect(this._offsetLeft, 0, width, height)\n return canvas\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._dragEvent.destroy()\n this._container.removeChild(this._wrapper)\n delete this\n }\n}\n","import EventHandler, { isMouse, isTouch } from './EventHandler'\n\nexport default class ZoomDragEventHandler extends EventHandler {\n constructor (chartData) {\n super(chartData)\n // 开始拖动时坐标点\n this._startDragPoint = {}\n // 开始触摸时坐标\n this._touchPoint = {}\n // 是否是取消了十字光标\n this._touchCancelCrossHair = false\n // 是否缩放过\n this._touchZoomed = false\n // 用来记录捏合缩放的尺寸\n this._pinchScale = 1\n }\n\n pinchStartEvent () {\n this._pinchScale = 1\n this._touchZoomed = true\n }\n\n pinchEvent (middlePoint, scale) {\n const zoomScale = (scale - this._pinchScale) * 5\n this._pinchScale = scale\n this._chartData.zoom(zoomScale)\n }\n\n mouseLeaveEvent (event) {\n if (isMouse(event)) {\n this._chartData.setCrossHairSeriesTag(null)\n }\n }\n\n mouseMoveEvent (event) {\n if (!isMouse(event)) {\n return\n }\n if (!this._checkEventPointX(event.localX)) {\n this._chartData.setCrossHairSeriesTag(null)\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n this._chartData.setCrossHairSeriesTag(null)\n return\n }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n\n mouseWheelEvent (event) {\n if (!this._checkEventPointX(event.localX)) {\n return\n }\n let deltaY = -(event.deltaY / 100)\n if (deltaY === 0) {\n return\n }\n if (event.cancelable) {\n event.preventDefault()\n }\n\n switch (event.deltaMode) {\n case event.DOM_DELTA_PAGE:\n deltaY *= 120\n break\n\n case event.DOM_DELTA_LINE:\n deltaY *= 32\n break\n }\n\n if (deltaY !== 0) {\n const zoomScale = Math.sign(deltaY) * Math.min(1, Math.abs(deltaY))\n this._chartData.zoom(zoomScale)\n }\n }\n\n mouseClickEvent (event) {\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n if (!this._touchPoint && !this._touchCancelCrossHair && !this._touchZoomed) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n }\n\n mouseDownEvent (event) {\n this._startDragPoint = { x: event.localX, y: event.localY }\n this._chartData.startDrag()\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n const crossHairPoint = { x: event.localX, y: real.y }\n this._touchZoomed = false\n if (this._touchPoint) {\n const xDif = event.localX - this._touchPoint.x\n const yDif = event.localY - this._touchPoint.y\n const radius = Math.sqrt(xDif * xDif + yDif * yDif)\n if (radius < 10) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(real.tag)\n } else {\n this._touchCancelCrossHair = true\n this._touchPoint = null\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(null)\n }\n } else {\n this._touchCancelCrossHair = false\n }\n }\n\n pressedMouseMoveEvent (event) {\n if (!this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n const crossHairPoint = { x: event.localX, y: real.y }\n if (isTouch(event)) {\n if (this._touchPoint) {\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.setCrossHairSeriesTag(real.tag)\n return\n }\n }\n const distance = event.localX - this._startDragPoint.x\n this._chartData.setCrossHairPoint(crossHairPoint)\n this._chartData.drag(distance)\n }\n\n longTapEvent (event) {\n if (!isTouch(event) || !this._checkEventPointX(event.localX)) {\n return\n }\n const real = this._translateCrossHairRealY(event.localY)\n if (!real) {\n return\n }\n this._touchPoint = { x: event.localX, y: event.localY }\n this._chartData.setCrossHairPoint({ x: event.localX, y: real.y })\n this._chartData.setCrossHairSeriesTag(real.tag)\n }\n\n /**\n * 将事件的y点转换成十字光标点的y\n * @param y\n * @returns {{}|null}\n * @private\n */\n _translateCrossHairRealY (y) {\n const tags = this._seriesSize.tags || {}\n for (const tag in tags) {\n const size = tags[tag]\n if (y > size.contentTop && y < size.contentBottom) {\n return { tag, y: y - size.contentTop }\n }\n }\n return null\n }\n}\n","import EventHandler from './EventHandler'\n\nexport default class KeyBoardEventHandler extends EventHandler {\n /**\n * 键盘事件\n * @param event\n */\n keyBoardDownEvent (event) {\n if (event.shiftKey) {\n switch (event.code) {\n case 'ArrowUp': {\n this._chartData.zoom(-0.05)\n break\n }\n case 'ArrowDown': {\n this._chartData.zoom(0.05)\n break\n }\n case 'ArrowLeft': {\n this._chartData.startDrag()\n this._chartData.drag(-this._chartData.dataSpace())\n break\n }\n case 'ArrowRight': {\n this._chartData.startDrag()\n this._chartData.drag(this._chartData.dataSpace())\n break\n }\n default: {\n break\n }\n }\n }\n }\n}\n","import EventBase from './EventBase'\nimport ZoomDragEventHandler from './ZoomDragEventHandler'\nimport GraphicMarkEventHandler from './GraphicMarkEventHandler'\nimport { GraphicMarkType } from '../data/ChartData'\nimport KeyBoardEventHandler from './KeyBoardEventHandler'\n\nexport default class ChartEvent {\n constructor (target, chartData, xAxis, yAxis) {\n this._target = target\n this._chartData = chartData\n this._seriesSize = {}\n this._event = new EventBase(this._target, {\n pinchStartEvent: this._pinchStartEvent.bind(this),\n pinchEvent: this._pinchEvent.bind(this),\n mouseUpEvent: this._mouseUpEvent.bind(this),\n mouseClickEvent: this._mouseClickEvent.bind(this),\n mouseDownEvent: this._mouseDownEvent.bind(this),\n mouseRightDownEvent: this._mouseRightDownEvent.bind(this),\n mouseLeaveEvent: this._mouseLeaveEvent.bind(this),\n mouseMoveEvent: this._mouseMoveEvent.bind(this),\n mouseWheelEvent: this._mouseWheelEvent.bind(this),\n pressedMouseMoveEvent: this._pressedMouseMoveEvent.bind(this),\n longTapEvent: this._longTapEvent.bind(this)\n }, {\n treatVertTouchDragAsPageScroll: false,\n treatHorzTouchDragAsPageScroll: false\n })\n this._boundKeyBoardDownEvent = this._keyBoardDownEvent.bind(this)\n this._target.addEventListener('keydown', this._boundKeyBoardDownEvent)\n this._boundContextMenuEvent = (e) => { e.preventDefault() }\n this._target.addEventListener('contextmenu', this._boundContextMenuEvent, false)\n this._zoomDragEventHandler = new ZoomDragEventHandler(chartData)\n this._graphicMarkEventHandler = new GraphicMarkEventHandler(chartData, xAxis, yAxis)\n this._keyBoardEventHandler = new KeyBoardEventHandler(chartData)\n }\n\n _keyBoardDownEvent (event) {\n this._keyBoardEventHandler.keyBoardDownEvent(event)\n }\n\n _pinchStartEvent () {\n this._zoomDragEventHandler.pinchStartEvent()\n }\n\n _pinchEvent (middlePoint, scale) {\n this._zoomDragEventHandler.pinchEvent(middlePoint, scale)\n }\n\n _mouseUpEvent (event) {\n this._graphicMarkEventHandler.mouseUpEvent(event)\n }\n\n _mouseLeaveEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseLeaveEvent(event)\n }\n }\n\n _mouseMoveEvent (event) {\n this._graphicMarkEventHandler.mouseMoveEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseMoveEvent(event)\n }\n }\n\n _mouseWheelEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseWheelEvent(event)\n }\n }\n\n _mouseClickEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseClickEvent(event)\n }\n }\n\n _mouseDownEvent (event) {\n this._graphicMarkEventHandler.mouseDownEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseDownEvent(event)\n }\n }\n\n _mouseRightDownEvent (event) {\n this._graphicMarkEventHandler.mouseRightDownEvent(event)\n }\n\n _pressedMouseMoveEvent (event) {\n if (this._chartData.dragGraphicMarkFlag()) {\n this._graphicMarkEventHandler.pressedMouseMoveEvent(event)\n // 这里判断一下,如果是在拖拽图形标记,让十字光标不显示\n if (this._chartData.crossHairSeriesTag() !== null) {\n this._chartData.setCrossHairSeriesTag(null)\n }\n }\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.pressedMouseMoveEvent(event)\n }\n }\n\n _longTapEvent (event) {\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.longTapEvent(event)\n }\n }\n\n _checkZoomDrag () {\n return !this._chartData.dragGraphicMarkFlag() && this._chartData.graphicMarkType() === GraphicMarkType.NONE\n }\n\n setSeriesSize (seriesSize) {\n this._zoomDragEventHandler.setSeriesSize(seriesSize)\n this._graphicMarkEventHandler.setSeriesSize(seriesSize)\n }\n\n destroy () {\n this._event.destroy()\n this._target.removeEventListener('keydown', this._boundKeyBoardDownEvent)\n this._target.removeEventListener('contextmenu', this._boundContextMenuEvent)\n }\n}\n","import ChartData, { InvalidateLevel } from '../data/ChartData'\nimport CandleStickSeries from './CandleStickSeries'\nimport XAxisSeries from './XAxisSeries'\n\nimport { ChartType, YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\nimport { isArray, isObject } from '../utils/typeChecks'\nimport { formatValue } from '../utils/format'\nimport TechnicalIndicatorSeries from './TechnicalIndicatorSeries'\nimport SeparatorSeries from './SeparatorSeries'\n\nimport { TechnicalIndicatorType } from '../data/options/technicalIndicatorParamOptions'\nimport ChartEvent from '../event/ChartEvent'\nimport { getPixelRatio } from '../utils/canvas'\n\nconst DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT = 100\n\nconst TECHNICAL_INDICATOR_NAME_PREFIX = 'technical_indicator_'\n\nexport const CANDLE_STICK_SERIES_TAG = 'candle_stick_series_tag'\n\nexport default class ChartSeries {\n constructor (container, styleOptions) {\n this._initChartContainer(container)\n this._technicalIndicatorBaseId = 0\n this._technicalIndicatorSeries = []\n this._separatorSeries = []\n this._separatorDragStartTechnicalIndicatorHeight = 0\n this._chartData = new ChartData(styleOptions, this._updateSeries.bind(this))\n this._xAxisSeries = new XAxisSeries({ container: this._chartContainer, chartData: this._chartData })\n this._candleStickSeries = new CandleStickSeries({\n container: this._chartContainer,\n chartData: this._chartData,\n xAxis: this._xAxisSeries.xAxis(),\n technicalIndicatorType: TechnicalIndicatorType.MA,\n tag: CANDLE_STICK_SERIES_TAG\n })\n this._chartEvent = new ChartEvent(\n this._chartContainer, this._chartData,\n this._xAxisSeries.xAxis(),\n this._candleStickSeries.yAxis()\n )\n this.measureSeriesSize()\n }\n\n _initChartContainer (container) {\n this._container = container\n this._chartContainer = document.createElement('div')\n this._chartContainer.style.position = 'relative'\n this._chartContainer.style.outline = 'none'\n this._chartContainer.style.borderStyle = 'none'\n this._chartContainer.style.width = '100%'\n this._chartContainer.style.height = '100%'\n this._chartContainer.tabIndex = 1\n container.appendChild(this._chartContainer)\n }\n\n /**\n * 分割线拖拽开始\n * @param seriesIndex\n * @private\n */\n _separatorStartDrag (seriesIndex) {\n this._separatorDragStartTechnicalIndicatorHeight = this._technicalIndicatorSeries[seriesIndex].height()\n }\n\n /**\n * 分割线拖拽\n * @param dragDistance\n * @param seriesIndex\n * @private\n */\n _separatorDrag (dragDistance, seriesIndex) {\n this._technicalIndicatorSeries[seriesIndex].setTempHeight(this._separatorDragStartTechnicalIndicatorHeight - dragDistance)\n this.measureSeriesSize()\n }\n\n /**\n * 计算x轴的高度\n * @returns {number}\n * @private\n */\n _measureXAxisHeight () {\n const xAxis = this._chartData.styleOptions().xAxis\n const axisLine = xAxis.axisLine\n const tickText = xAxis.tickText\n const tickLine = xAxis.tickLine\n let height = 0\n if (xAxis.display) {\n if (axisLine.display) {\n height += axisLine.size\n }\n if (tickLine.display) {\n height += tickLine.length\n }\n if (tickText.display) {\n height += (tickText.size + tickText.margin)\n }\n }\n if (height > 0) {\n height = Math.ceil(Math.max(xAxis.minHeight, Math.min(height, xAxis.maxHeight)))\n }\n return height\n }\n\n /**\n * 计算y轴宽度\n * @returns {number}\n * @private\n */\n _measureYAxisWidth () {\n const yAxis = this._chartData.styleOptions().yAxis\n const axisLine = yAxis.axisLine\n const tickText = yAxis.tickText\n const tickLine = yAxis.tickLine\n let width = 0\n if (yAxis.display) {\n if (yAxis.axisLine.display) {\n width += axisLine.size\n }\n if (yAxis.tickLine.display) {\n width += tickLine.length\n }\n if (yAxis.tickText.display) {\n width += (tickText.margin + (tickText.size - 2) * 6)\n }\n }\n if (width > 0) {\n width = Math.ceil(Math.max(yAxis.minWidth, Math.min(width, yAxis.maxWidth)))\n }\n return width\n }\n\n /**\n * 测量图表间分割线的高度\n * @returns {number}\n * @private\n */\n _measureSeparatorHeight () {\n const separator = this._chartData.styleOptions().separator\n return separator.size * this._separatorSeries.length\n }\n\n /**\n * 更新所有series\n * @private\n */\n _updateSeries (invalidateLevel = InvalidateLevel.FULL) {\n if (invalidateLevel !== InvalidateLevel.GRAPHIC_MARK) {\n this._xAxisSeries.invalidate(invalidateLevel)\n this._candleStickSeries.invalidate(invalidateLevel)\n for (const series of this._technicalIndicatorSeries) {\n series.invalidate(invalidateLevel)\n }\n }\n this._candleStickSeries.invalidate(invalidateLevel)\n }\n\n /**\n * 计算所有series的指标\n * @private\n */\n _calcAllSeriesTechnicalIndicator () {\n const technicalIndicatorTypeArray = []\n if (this._candleStickSeries.chartType() === ChartType.CANDLE_STICK) {\n technicalIndicatorTypeArray.push(this._candleStickSeries.technicalIndicatorType())\n } else {\n this._chartData.calcTechnicalIndicator(TechnicalIndicatorType.AVERAGE)\n }\n for (const series of this._technicalIndicatorSeries) {\n const technicalIndicatorSeriesTechnicalIndicatorType = series.technicalIndicatorType()\n if (technicalIndicatorTypeArray.indexOf(technicalIndicatorSeriesTechnicalIndicatorType) < 0) {\n technicalIndicatorTypeArray.push(technicalIndicatorSeriesTechnicalIndicatorType)\n }\n }\n for (const technicalIndicatorType of technicalIndicatorTypeArray) {\n this._chartData.calcTechnicalIndicator(technicalIndicatorType)\n }\n this._updateSeries()\n }\n\n /**\n * 获取图表上的数据\n * @returns {ChartData}\n */\n chartData () {\n return this._chartData\n }\n\n /**\n * 测量尺寸\n * @private\n */\n measureSeriesSize () {\n const yAxis = this._chartData.styleOptions().yAxis\n const isYAxisLeft = yAxis.position === YAxisPosition.LEFT\n const isYAxisTextOutsize = yAxis.tickText.position === YAxisTextPosition.OUTSIDE\n const seriesWidth = this._chartContainer.offsetWidth\n const seriesHeight = this._chartContainer.offsetHeight\n const separatorHeight = this._measureSeparatorHeight()\n const xAxisHeight = this._measureXAxisHeight()\n const yAxisWidth = this._measureYAxisWidth()\n const seriesExcludeXAxisSeparatorHeight = seriesHeight - xAxisHeight - separatorHeight\n const mainWidthWidth = seriesWidth - (isYAxisTextOutsize ? yAxisWidth : 0)\n let yAxisOffsetLeft = seriesWidth - yAxisWidth\n let mainOffsetLeft = 0\n if (isYAxisLeft) {\n yAxisOffsetLeft = 0\n if (isYAxisTextOutsize) {\n mainOffsetLeft = yAxisWidth\n }\n }\n let technicalIndicatorSeriesTotalHeight = 0\n for (const series of this._technicalIndicatorSeries) {\n technicalIndicatorSeriesTotalHeight += series.height()\n }\n\n const candleStickSeriesHeight = seriesExcludeXAxisSeparatorHeight - technicalIndicatorSeriesTotalHeight\n\n this._chartData.setTotalDataSpace(mainWidthWidth)\n const seriesSize = {}\n seriesSize.contentLeft = mainOffsetLeft\n seriesSize.contentRight = mainOffsetLeft + mainWidthWidth\n const tags = {}\n tags[CANDLE_STICK_SERIES_TAG] = { contentTop: 0, contentBottom: candleStickSeriesHeight }\n let contentTop = candleStickSeriesHeight\n let contentBottom = candleStickSeriesHeight\n this._candleStickSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: candleStickSeriesHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: candleStickSeriesHeight }\n )\n\n for (let i = 0; i < this._technicalIndicatorSeries.length; i++) {\n const technicalIndicatorSeries = this._technicalIndicatorSeries[i]\n const separatorSeries = this._separatorSeries[i]\n const technicalIndicatorSeriesHeight = technicalIndicatorSeries.height()\n technicalIndicatorSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: technicalIndicatorSeriesHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: technicalIndicatorSeriesHeight }\n )\n separatorSeries.setSize(mainOffsetLeft, mainWidthWidth)\n contentBottom += technicalIndicatorSeriesHeight\n tags[technicalIndicatorSeries.tag()] = { contentTop, contentBottom }\n contentTop = contentBottom\n }\n seriesSize.tags = tags\n this._xAxisSeries.setSize(\n { left: mainOffsetLeft, width: mainWidthWidth, height: xAxisHeight },\n { left: yAxisOffsetLeft, width: yAxisWidth, height: xAxisHeight }\n )\n this._chartEvent.setSeriesSize(seriesSize)\n }\n\n /**\n * 加载样式配置\n * @param styleOptions\n */\n applyStyleOptions (styleOptions) {\n this._chartData.applyStyleOptions(styleOptions)\n this.measureSeriesSize()\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n applyTechnicalIndicatorParams (technicalIndicatorType, params) {\n this._chartData.applyTechnicalIndicatorParams(technicalIndicatorType, params)\n if (this._chartData.calcTechnicalIndicator(technicalIndicatorType)) {\n const candleStickSeriesTechnicalIndicatorType = this._candleStickSeries.technicalIndicatorType()\n if (candleStickSeriesTechnicalIndicatorType === technicalIndicatorType) {\n this._candleStickSeries.invalidate(InvalidateLevel.FULL)\n }\n for (const series of this._technicalIndicatorSeries) {\n const seriesTechnicalIndicatorType = series.technicalIndicatorType()\n if (seriesTechnicalIndicatorType === technicalIndicatorType) {\n series.invalidate(InvalidateLevel.FULL)\n }\n }\n }\n }\n\n /**\n * 添加新数据\n * @param dataList\n * @param more\n */\n applyNewData (dataList, more) {\n if (isArray(dataList)) {\n this._chartData.clearDataList()\n this._chartData.addData(dataList, 0, more)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 添加更多数据\n * @param dataList\n * @param more\n */\n applyMoreData (dataList, more) {\n if (isArray(dataList)) {\n this._chartData.addData(dataList, 0, more)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 更新数据\n * @param data\n */\n updateData (data) {\n if (isObject(data) && !isArray(data)) {\n const dataList = this._chartData.dataList()\n const dataSize = dataList.length\n // 这里判断单个数据应该添加到哪个位置\n const timestamp = +formatValue(data, 'timestamp', 0)\n const lastDataTimestamp = +formatValue(dataList[dataSize - 1], 'timestamp', 0)\n let pos = dataSize\n if (timestamp === lastDataTimestamp) {\n pos = dataSize - 1\n }\n this._chartData.addData(data, pos)\n this._calcAllSeriesTechnicalIndicator()\n }\n }\n\n /**\n * 设置蜡烛图图表类型\n * @param type\n */\n setCandleStickSeriesType (type) {\n this._candleStickSeries.setChartType(type)\n }\n\n /**\n * 创建一个指标\n * @param technicalIndicatorType\n * @param height\n * @returns {string}\n */\n createTechnicalIndicator (technicalIndicatorType, height = DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT) {\n const technicalIndicatorSeriesCount = this._technicalIndicatorSeries.length\n this._separatorSeries.push(\n new SeparatorSeries(\n this._chartContainer, this._chartData,\n technicalIndicatorSeriesCount, {\n startDrag: this._separatorStartDrag.bind(this),\n drag: this._separatorDrag.bind(this)\n }\n )\n )\n this._technicalIndicatorBaseId++\n const tag = `${TECHNICAL_INDICATOR_NAME_PREFIX}${this._technicalIndicatorBaseId}`\n const technicalIndicatorSeries = new TechnicalIndicatorSeries({\n container: this._chartContainer,\n chartData: this._chartData,\n xAxis: this._xAxisSeries.xAxis(),\n technicalIndicatorType,\n tag\n })\n technicalIndicatorSeries.setTempHeight(height)\n this._technicalIndicatorSeries.push(technicalIndicatorSeries)\n this.measureSeriesSize()\n return tag\n }\n\n /**\n * 移除一个指标\n * @param tag\n */\n removeTechnicalIndicator (tag) {\n let seriesPos = -1\n for (let i = 0; i < this._technicalIndicatorSeries.length; i++) {\n const series = this._technicalIndicatorSeries[i]\n if (series.tag() === tag) {\n seriesPos = i\n break\n }\n }\n if (seriesPos !== -1) {\n this._technicalIndicatorSeries[seriesPos].destroy()\n this._separatorSeries[seriesPos].destroy()\n delete this._technicalIndicatorSeries[seriesPos]\n delete this._separatorSeries[seriesPos]\n for (let i = 0; i < this._separatorSeries.length; i++) {\n this._separatorSeries[i].updateSeriesIndex(i)\n }\n this.measureSeriesSize()\n }\n }\n\n /**\n * 设置指标类型\n * @param tag\n * @param technicalIndicatorType\n */\n setTechnicalIndicatorType (tag, technicalIndicatorType) {\n if (tag === CANDLE_STICK_SERIES_TAG) {\n this._candleStickSeries.setTechnicalIndicatorType(technicalIndicatorType)\n } else {\n let s\n for (const series of this._technicalIndicatorSeries) {\n if (series.tag() === tag) {\n s = series\n break\n }\n }\n if (s) {\n if (technicalIndicatorType === TechnicalIndicatorType.NO) {\n this.removeTechnicalIndicator(tag)\n } else {\n s.setTechnicalIndicatorType(technicalIndicatorType)\n }\n }\n }\n }\n\n /**\n * 获取图表转换为图片后url\n * @param includeFloatLayer,\n * @param includeGraphicMark\n * @param type\n */\n getConvertPictureUrl (includeFloatLayer, includeGraphicMark, type = 'jpeg') {\n if (type !== 'png' && type !== 'jpeg' && type !== 'bmp') {\n throw new Error('Picture format only supports jpeg, png and bmp!!!')\n }\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n const pixelRatio = getPixelRatio(ctx)\n const width = this._chartContainer.offsetWidth\n const height = this._chartContainer.offsetHeight\n canvas.style.width = `${width}px`\n canvas.style.height = `${height}px`\n canvas.width = width * pixelRatio\n canvas.height = height * pixelRatio\n ctx.scale(pixelRatio, pixelRatio)\n let offsetTop = 0\n const candleStickSeriesHeight = this._candleStickSeries.height()\n ctx.drawImage(\n this._candleStickSeries.getImage(includeFloatLayer, includeGraphicMark),\n 0, offsetTop, width, candleStickSeriesHeight\n )\n ctx.drawImage(\n this._candleStickSeries.getImage(includeFloatLayer, includeGraphicMark),\n 0, offsetTop, width, candleStickSeriesHeight\n )\n offsetTop += candleStickSeriesHeight\n for (let i = 0; i < this._separatorSeries.length; i++) {\n const separatorSeries = this._separatorSeries[i]\n const separatorSeriesHeight = separatorSeries.height()\n const technicalIndicatorSeries = this._technicalIndicatorSeries[i]\n const technicalIndicatorSeriesHeight = technicalIndicatorSeries.height()\n ctx.drawImage(\n separatorSeries.getImage(),\n 0, offsetTop, width, separatorSeriesHeight\n )\n offsetTop += separatorSeriesHeight\n ctx.drawImage(\n technicalIndicatorSeries.getImage(includeFloatLayer),\n 0, offsetTop, width, technicalIndicatorSeriesHeight\n )\n offsetTop += technicalIndicatorSeriesHeight\n }\n\n ctx.drawImage(\n this._xAxisSeries.getImage(includeFloatLayer),\n 0, offsetTop, width, this._xAxisSeries.height()\n )\n return canvas.toDataURL(`image/${type}`)\n }\n\n destroy () {\n this._candleStickSeries.destroy()\n this._technicalIndicatorSeries.forEach(series => {\n series.destroy()\n })\n this._separatorSeries.forEach(series => {\n series.destroy()\n })\n this._xAxisSeries.destroy()\n this._container.removeChild(this._chartContainer)\n this._chartEvent.destroy()\n delete this\n }\n}\n","import ChartSeries, { CANDLE_STICK_SERIES_TAG } from './series/ChartSeries'\nimport { isArray } from './utils/typeChecks'\nimport { GraphicMarkType } from './data/ChartData'\n\nexport default class Chart {\n constructor (container, styleOptions) {\n this._chartSeries = new ChartSeries(container, styleOptions)\n }\n\n /**\n * 设置样式配置\n * @param options\n */\n setStyleOptions (options) {\n this._chartSeries.applyStyleOptions(options)\n }\n\n /**\n * 获取样式配置\n * @returns {[]|*[]}\n */\n getStyleOptions () {\n return this._chartSeries.chartData().styleOptions()\n }\n\n /**\n * 加载技术指标参数\n * @param technicalIndicatorType\n * @param params\n */\n setTechnicalIndicatorParams (technicalIndicatorType, params) {\n this._chartSeries.applyTechnicalIndicatorParams(technicalIndicatorType, params)\n }\n\n /**\n * 获取技术指标参数配置\n */\n getTechnicalIndicatorParamOptions () {\n this._chartSeries.chartData().technicalIndicatorParamOptions()\n }\n\n /**\n * 加载精度\n * @param pricePrecision\n * @param volumePrecision\n */\n setPrecision (pricePrecision, volumePrecision) {\n this._chartSeries.chartData().applyPrecision(pricePrecision, volumePrecision)\n }\n\n /**\n * 设置时区\n * @param timezone\n */\n setTimezone (timezone) {\n this._chartSeries.chartData().setTimezone(timezone)\n }\n\n /**\n * 重置尺寸,总是会填充父容器\n */\n resize () {\n this._chartSeries.chartData().adjustFromTo()\n this._chartSeries.measureSeriesSize()\n }\n\n /**\n * 设置右边间距\n * @param space\n */\n setOffsetRightSpace (space) {\n this._chartSeries.chartData().setOffsetRightSpace(space)\n }\n\n /**\n * 设置一条数据的空间\n * @param space\n */\n setDataSpace (space) {\n this._chartSeries.chartData().setDataSpace(space)\n }\n\n /**\n * 清空数据\n */\n clearData () {\n this._chartSeries.chartData().clearDataList()\n }\n\n /**\n * 获取数据源\n */\n getDataList () {\n return this._chartSeries.chartData().dataList()\n }\n\n /**\n * 添加新数据\n * @param dataList\n * @param more\n */\n applyNewData (dataList, more) {\n this._chartSeries.applyNewData(dataList, more)\n }\n\n /**\n * 添加历史更多数据\n * @param dataList\n * @param more\n */\n applyMoreData (dataList, more) {\n this._chartSeries.applyMoreData(dataList, more)\n }\n\n /**\n * 更新数据\n * @param data\n */\n updateData (data) {\n this._chartSeries.updateData(data)\n }\n\n /**\n * 设置加载更多回调\n * @param cb\n */\n loadMore (cb) {\n this._chartSeries.chartData().loadMore(cb)\n }\n\n /**\n * 设置蜡烛图表类型\n * @param type\n */\n setCandleStickChartType (type) {\n this._chartSeries.setCandleStickSeriesType(type)\n }\n\n /**\n * 设置蜡烛图技术指标类型\n * @param technicalIndicatorType\n */\n setCandleStickTechnicalIndicatorType (technicalIndicatorType) {\n this._chartSeries.setTechnicalIndicatorType(CANDLE_STICK_SERIES_TAG, technicalIndicatorType)\n }\n\n /**\n * 设置技术指标类型\n * @param tag\n * @param technicalIndicatorType\n */\n setTechnicalIndicatorType (tag, technicalIndicatorType) {\n this._chartSeries.setTechnicalIndicatorType(tag, technicalIndicatorType)\n }\n\n /**\n * 添加一个技术指标\n * @param technicalIndicatorType\n * @param height\n * @returns {string}\n */\n addTechnicalIndicator (technicalIndicatorType, height) {\n return this._chartSeries.createTechnicalIndicator(technicalIndicatorType, height)\n }\n\n /**\n * 移除一个技术指标\n * @param tag\n */\n removeTechnicalIndicator (tag) {\n this._chartSeries.removeTechnicalIndicator(tag)\n }\n\n /**\n * 添加图形标记\n * @param type\n */\n addGraphicMark (type) {\n const graphicMarkType = this._chartSeries.chartData().graphicMarkType()\n if (graphicMarkType !== type) {\n const graphicMarkDatas = this._chartSeries.chartData().graphicMarkData()\n const graphicMarkData = graphicMarkDatas[graphicMarkType]\n if (graphicMarkData && isArray(graphicMarkData)) {\n graphicMarkData.splice(graphicMarkData.length - 1, 1)\n graphicMarkDatas[graphicMarkType] = graphicMarkData\n }\n if (!graphicMarkDatas.hasOwnProperty(type)) {\n type = GraphicMarkType.NONE\n }\n this._chartSeries.chartData().setGraphicMarkType(type)\n this._chartSeries.chartData().setGraphicMarkData(graphicMarkDatas)\n }\n }\n\n /**\n * 移除所有标记图形\n */\n removeAllGraphicMark () {\n const graphicMarkDatas = this._chartSeries.chartData().graphicMarkData()\n const newGraphicMarkDatas = {}\n Object.keys(graphicMarkDatas).forEach(key => {\n newGraphicMarkDatas[key] = []\n })\n this._chartSeries.chartData().setGraphicMarkType(GraphicMarkType.NONE)\n this._chartSeries.chartData().setGraphicMarkData(newGraphicMarkDatas)\n }\n\n /**\n * 获取将图表装换成图片后的url\n * @param includeFloatLayer\n * @param includeGraphicMark\n * @param type\n */\n getConvertPictureUrl (includeFloatLayer, includeGraphicMark, type) {\n return this._chartSeries.getConvertPictureUrl(includeFloatLayer, includeGraphicMark, type)\n }\n\n /**\n * 销毁\n */\n destroy () {\n this._chartSeries.destroy()\n delete this\n }\n}\n","import Chart from './Chart'\nimport { DEV } from './utils/env'\n\nconst instances = {}\nlet idBase = 1\n\nconst errorMessage = 'Chart version is K_LINE_VERSION. Root dom is null, can not initialize the chart!!!'\n\n/**\n * 获取版本号\n * @returns {string}\n */\nfunction version () {\n return 'K_LINE_VERSION'\n}\n\n/**\n * 初始化\n * @param ds\n * @param style\n * @returns {Chart}\n */\nfunction init (ds, style = {}) {\n let container = ds\n if (!container) {\n throw new Error(errorMessage)\n }\n if (typeof container === 'string') {\n container = document.getElementById(ds) || document.getElementsByClassName(ds)\n }\n if (!container) {\n throw new Error(errorMessage)\n }\n const instance = instances[container.chart_id || '']\n if (instance) {\n if (DEV) {\n console.warn('The chart has been initialized on the dom!!!')\n }\n return instance\n }\n const id = `k_line_chart_${idBase++}`\n const chart = new Chart(container, style)\n chart.id = id\n container.chart_id = id\n instances[id] = chart\n return chart\n}\n\n/**\n * 销毁\n * @param dcs\n */\nfunction dispose (dcs) {\n if (dcs) {\n let id\n if (typeof dcs === 'string') {\n dcs = document.getElementById(dcs) || document.getElementsByClassName(dcs)\n id = dcs.chart_id\n }\n if (!id) {\n id = dcs.chart_id\n }\n if (!id && dcs instanceof Chart) {\n id = dcs.id\n }\n if (id) {\n instances[id].destroy()\n delete instances[id]\n }\n }\n}\n\nexport { version, init, dispose }\n"],"names":["merge","target","source","isObject","key","hasOwnProperty","targetProp","sourceProp","isArray","clone","copy","p","v","value","Object","prototype","toString","call","isFunction","type","isNumber","isNaN","isBoolean","LineStyle","DASH","SOLID","YAxisPosition","LEFT","RIGHT","YAxisTextPosition","INSIDE","OUTSIDE","ChartType","REAL_TIME","CANDLE_STICK","CandleStickStyle","STROKE","UP_STROKE","DOWN_STROKE","OHLC","FloatLayerPromptDisplayRule","ALWAYS","FOLLOW_CROSS","NONE","FloatLayerPromptCandleStickTextDisplayType","RECT","STANDARD","defaultGrid","display","horizontal","size","color","style","dashValue","vertical","defaultCandleStick","bar","upColor","downColor","noChangeColor","priceMark","high","textMargin","textSize","low","last","line","text","paddingLeft","paddingTop","paddingRight","paddingBottom","defaultRealTime","timeLine","areaFillColor","averageLine","defaultTechnicalIndicator","colors","defaultXAxis","maxHeight","minHeight","axisLine","tickText","margin","tickLine","length","defaultYAxis","maxWidth","minWidth","position","defaultFloatLayer","crossHair","borderSize","borderColor","backgroundColor","prompt","displayRule","candleStick","showType","labels","values","rect","left","top","right","borderRadius","fillColor","marginLeft","marginTop","marginRight","marginBottom","technicalIndicator","defaultGraphicMark","point","radius","activeBackgroundColor","activeBorderColor","activeBorderSize","activeRadius","defaultSeparator","fill","defaultStyleOptions","grid","realTime","xAxis","yAxis","separator","floatLayer","graphicMark","TechnicalIndicatorType","NO","AVERAGE","MA","VOL","MACD","BOLL","KDJ","RSI","BIAS","BRAR","CCI","DMI","CR","PSY","DMA","TRIX","OBV","VR","WR","MTM","EMV","SAR","defaultTechnicalIndicatorParamOptions","defaultPrecisionOptions","price","volume","calcIndicator","dataList","totalTurnover","totalVolume","calc","i","turnover","average","params","checkParams","closeSums","paramsLength","ma","close","j","volumeSums","num","vol","checkParamsWithSize","emaShort","emaLong","oldEmaShort","oldEmaLong","diff","dea","oldDea","macd","closePrice","closeSum","md","up","dn","getBollMd","slice","boll","mid","k","d","ln","hn","cn","getLow","getHigh","rsv","kdj","sumCloseA1","sumCloseB1","sumCloseA2","sumCloseB2","sumCloseA3","sumCloseB3","a1","b1","a2","b2","a3","b3","rsi","tmp","absTmp","Math","abs","agoTmp","mean1","mean2","mean3","closes1","closes2","closes3","bias","br","ar","hcy","cyl","ho","ol","open","refClose","agoHigh","agoLow","agoOpen","agoRefClose","brar","closes","closeMa","closeMaList","maCloseSum","cci","tp","push","agoClosePrice","pdi","mdi","adx","adxr","trList","trSum","dmpList","dmpSum","dmmList","dmmSum","dxList","dxSum","highPrice","lowPrice","hl","lcy","hhy","lyl","tr","max","h","l","dx","agoAdx","dmi","cr","ma1","ma2","ma3","ma4","p1","p2","ma1Sum","ma1Mean","ma1List","ma2Sum","ma2Mean","ma2List","ma3Sum","ma3Mean","ma3List","ma4Sum","ma4Mean","ma4List","preHighestPrice","preLowestPrice","preClosePrice","preOpenPrice","preMidPrice","highestPrice","lowestPrice","highSubPreMid","preMidSubLow","firstHighestPrice","firstLowestPrice","firstClosePrice","firstOpenPrice","firstMidPrice","secondHighestPrice","secondLowestPrice","secondHighSubFirstMid","firstMidSubSecondLow","YM","HYM","LYM","psy","upDay","dif","difMa","difSum","dma","trix","maTrix","sumTrix","emaClose1","oldEmaClose1","emaClose2","oldEmaClose2","emaClose3","oldEmaClose3","emaClose3List","refEmaClose3","obv","sumObv","maObv","sumVa","refClosePrice","va","avs","bvs","cvs","vr","maVr","sumVr","openPrice","agoOpenPrice","agoVolume","wr1","wr2","wr3","h1","Number","MIN_SAFE_INTEGER","l1","MAX_SAFE_INTEGER","h2","l2","h3","l3","hl1","hl2","hl3","min","highLowPriceArray","getHighLow","wr","mtm","mtmSum","mtmMa","emv","maEmv","sumEmv","em","emList","highSubLow","halfHighAddLow","preHalfHighAddLow","startAf","step","maxAf","af","ep","isIncreasing","sar","preSar","lowestPriceMin","highestPriceMax","dataSize","list","sum","b","sqrt","paramsSize","formatValue","data","defaultValue","locales","formatDate","timestamp","format","timezone","date","Date","dateTimeString","Intl","DateTimeFormat","hour12","timeZone","year","month","day","hour","minute","e","dateString","match","dateStringArray","split","timeString","replace","formatPrecision","precision","toFixed","formatBigNumber","InvalidateLevel","FLOAT_LAYER","GRAPHIC_MARK","FULL","GraphicMarkType","HORIZONTAL_STRAIGHT_LINE","VERTICAL_STRAIGHT_LINE","STRAIGHT_LINE","HORIZONTAL_RAY_LINE","VERTICAL_RAY_LINE","RAY_LINE","HORIZONTAL_SEGMENT_LINE","VERTICAL_SEGMENT_LINE","SEGMENT_LINE","PRICE_LINE","PRICE_CHANNEL_LINE","PARALLEL_STRAIGHT_LINE","FIBONACCI_LINE","BAR_MARGIN_SPACE_RATE","MAX_DATA_SPACE","MIN_DATA_SPACE","ChartData","styleOptions","invalidateHandler","_invalidateHandler","_styleOptions","_technicalIndicatorParamOptions","_precisionOptions","_timezone","_dataList","_loading","_loadMoreCallback","_more","_totalDataSpace","_offsetRightSpace","_from","_to","_range","_dataSpace","_barSpace","_calcBarSpace","_crossHairPoint","_crossHairSeriesTag","_preFrom","_graphicMarkType","_graphicMarkPoint","_dragGraphicMarkFlag","_graphicMarkDatas","horizontalStraightLine","verticalStraightLine","straightLine","horizontalRayLine","verticalRayLine","rayLine","horizontalSegmentLine","verticalSegmentLine","segmentLine","priceLine","parallelStraightLine","priceChannelLine","fibonacciLine","floor","adjustFromTo","offsetRightRange","dataSpace","_calcRange","options","technicalIndicatorType","pricePrecision","volumePrecision","calcFun","pos","more","concat","rangeDif","_calcRangDif","oldDataSize","_innerSetDataSpace","totalSpace","space","tag","distance","distanceRange","ceil","_loadMoreHandler","zoomScale","graphicMarkType","flag","datas","callback","getPixelRatio","ctx","backingStore","backingStorePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","window","devicePixelRatio","calcTextWidth","measureText","width","getFont","fontSize","drawHorizontalLine","y","beginPath","correction","lineWidth","moveTo","lineTo","stroke","closePath","drawVerticalLine","x","bottom","strokeInPixel","drawFuc","save","translate","restore","Series","props","_container","container","_chartData","chartData","_width","_height","_initBefore","_initElement","_mainWidget","_createMainWidget","_mainWidgetCell","_yAxisWidget","_createYAxisWidget","_yAxisWidgetCell","_element","document","createElement","padding","overflow","_createCell","appendChild","lastElement","lastChild","insertBefore","cell","zIndex","height","offsetWidth","mainWidgetSize","yAxisWidgetSize","_setCellSize","setSize","level","_computeAxis","invalidate","includeFloatLayer","includeGraphicMark","canvas","getContext","pixelRatio","offsetHeight","scale","mainWidgetWidth","mainWidgetHeight","mainWidgetOffsetLeft","parseInt","yAxisWidgetWidth","yAxisWidgetHeight","yAxisWidgetOffsetLeft","drawImage","getImage","removeChild","Widget","_mainView","_createMainView","_expandView","_createExpandView","_floatLayerView","_createFloatLayerView","flush","requestAnimationFrame","fn","setTimeout","cancelAnimationFrame","id","clearTimeout","View","_initCanvas","_canvas","_ctx","extendFun","clearRect","_draw","_redraw","requestAnimationId","TechnicalIndicatorView","additionalDataProvider","_xAxis","_yAxis","_additionalDataProvider","_drawGrid","_drawTechnicalIndicator","horizontalGrid","strokeStyle","setLineDash","ticks","forEach","tick","verticalGrid","onDrawing","technicalIndicatorParams","technicalIndicatorParamOptions","linePoints","technicalIndicatorOptions","dataKeys","kLineData","halfBarSpace","_ohlcTechnicalIndicatorDrawing","isCandleStickYAxis","_prepareLinePoints","preKLineData","macdValue","preMacdValue","Infinity","fillStyle","isFill","_drawBars","lineValues","preClose","dataY","convertToPixel","arc","PI","_drawGraphics","_drawLines","isCandleStick","prepare","technicalIndicatorData","toLowerCase","_drawOhlc","valueY","pointCount","colorSize","points","barData","zeroY","yDif","barHeight","fillRect","strokeRect","openY","closeY","highY","lowY","onDrawEnd","startX","barSpace","to","from","endX","TechnicalIndicatorFloatLayerView","crossHairPoint","dataPos","convertFromPixel","_drawCrossHairHorizontalLine","_drawCrossHairVerticalLine","crossHairSeriesTag","_drawPrompt","_drawTechnicalIndicatorPrompt","crossHairHorizontal","crossHairHorizontalLine","crossHairVertical","crossHairVerticalLine","offsetTop","_getTechnicalIndicatorPromptData","_drawTechnicalIndicatorPromptText","_drawTechnicalIndicatorPromptPoint","floatLayerPromptTechnicalIndicatorText","nameText","name","textMarginLeft","textMarginRight","labelX","labelY","textColor","textBaseline","font","nameTextWidth","fillText","toUpperCase","textWidth","valueSize","join","indicatorData","label","decimal","precisionOptions","index","TechnicalIndicatorWidget","YAxisView","yAxisOptions","_drawAxisLine","_drawTickLines","_drawTickLabels","_drawLastPriceLabel","_isDrawFromStart","tickLineLength","tickLineDisplay","tickTextMargin","textAlign","lastPriceMark","lastPrice","preLastPrice","priceY","priceMarkText","rectWidth","rectHeight","rectStartX","AxisFloatLayerView","axis","_axis","_drawCrossHairLabel","YAxisFloatLayerView","crossHairHorizontalText","yAxisDataLabel","yAxisDataLabelWidth","rectY","YAxisWidget","Axis","_minValue","_maxValue","_ticks","_computeMinMaxValue","range","_computeOptimalTicks","_computeTicks","interval","_nice","_getIntervalPrecision","first","_round","n","f","exponent","log","exp10","pow","nf","str","eIndex","indexOf","dotIndex","YAxisType","TECHNICAL_INDICATOR","YAxis","yAxisType","_yAxisType","minMaxArray","keys","optimalTicks","tickLength","textHeight","tickCountDif","nextY","isRealTime","isShowAverageLine","minCompareArray","maxCompareArray","apply","_compareMinMax","pixel","round","TechnicalIndicatorSeries","_technicalIndicatorType","_calcTechnicalIndicator","_tag","_createYAxis","bind","calcMinMaxValue","_isRealTime","computeAxis","calcTechnicalIndicator","CandleStickView","chartType","_drawRealTime","_drawCandleStick","_drawHighestPriceMark","_drawLowestPriceMark","_drawLastPriceLine","timeLinePoints","timeLineAreaPoints","averageLinePoints","averageY","areaPointLength","lastPoint","isFit","markHighestPrice","markHighestPriceX","markLowestPrice","markLowestPriceX","highLine","lowLine","_highestMarkData","_lowestMarkData","highestPriceMark","_drawLowestHighestPriceMark","lowestPriceMark","isHigh","startY","priceMarkLine","CandleStickFloatLayerView","floatLayerPromptCandleStick","candleStickPromptData","_getCandleStickPromptData","_drawCandleStickStandardPromptText","_drawCandleStickRectPromptText","labelText","labelWidth","valueText","baseLabels","baseValues","baseTextMarginLeft","baseTextMarginRight","baseTextMarginTop","baseTextMarginBottom","baseTextSize","baseTextColor","maxLabelWidth","rectBorderSize","rectPaddingLeft","rectPaddingRight","rectPaddingTop","rectPaddingBottom","rectLeft","rectRight","technicalIndicatorPromptData","floatLayerPromptTechnicalIndicator","indicatorTextMarginLeft","indicatorTextMarginRight","indicatorTextMarginTop","indicatorTextMarginBottom","indicatorTextSize","indicatorLabels","indicatorValues","centerX","rectX","_drawRoundRect","baseLabelX","indicatorLabelX","w","r","arcTo","getLinearY","point1","point2","targetPoints","subX","checkPointOnStraightLine","targetPoint","checkPointOnRayLine","checkPointOnSegmentLine","a","c","checkPointOnCircle","circleCenterPoint","subY","getParallelLines","isPriceChannelLine","lines","endY","getFibonacciLines","yDistance","MouseEventButton","DELAY_RESET_CLICK","DELAY_LONG_TAG","getBoundingClientRect","element","isTouchEvent","event","Boolean","touches","preventDefault","cancelable","checkTouchEvents","DocumentTouch","touch","navigator","maxTouchPoints","msMaxTouchPoints","mobileTouch","getDistance","xDiff","clientX","yDiff","clientY","EventType","MOUSE","TOUCH","EventBase","eventHandler","_target","_handler","_options","_clickCount","_clickTimeoutId","_longTapTimeoutId","_longTapActive","_mouseMoveStartPosition","_moveExceededManhattanDistance","_cancelClick","_unsubscribeOutsideEvents","_unsubscribeMousemove","_unsubscribeRoot","_startPinchMiddlePoint","_startPinchDistance","_pinchPrevented","_preventDragProcess","_mousePressed","_init","_clearLongTapTimeout","_resetClickTimeout","enterEvent","boundMouseMoveHandler","_mouseMoveHandler","boundMouseWheelHandler","_mouseWheelHandler","removeEventListener","addEventListener","passive","compatEvent","_makeCompatEvent","_processEvent","mouseEnterEvent","moveEvent","mouseMoveEvent","wheelEvent","localX","localY","mouseWheelEvent","button","isTouch","startMouseMovePos","xOffset","pageX","yOffset","pageY","moveExceededManhattanDistance","correctedXOffset","isVertDrag","treatVertTouchDragAsPageScroll","isHorzDrag","treatHorzTouchDragAsPageScroll","pressedMouseMoveEvent","mouseUpEvent","_mouseLeaveHandler","mouseDoubleClickEvent","mouseClickEvent","downEvent","mouseRightDownEvent","_mouseEnterHandler","boundMouseMoveWithDownHandler","_mouseMoveWithDownHandler","boundMouseUpHandler","_mouseUpHandler","rootElement","ownerDocument","documentElement","_longTapHandler","mouseDownEvent","doc","outsideHandler","mouseDownOutsideEvent","contains","_mouseDownHandler","_initPinch","pinchStartEvent","undefined","pinchEvent","pinchEndEvent","_checkPinchState","currentDistance","_stopPinch","_startPinch","box","mouseLeaveEvent","longTapEvent","eventLike","changedTouches","screenX","screenY","ctrlKey","altKey","shiftKey","metaKey","startsWith","view","isMouse","EventHandler","_seriesSize","contentLeft","contentRight","seriesSize","GraphicMarkDrawStep","STEP_1","STEP_2","STEP_3","STEP_DONE","GraphicMarkEventHandler","_noneGraphicMarkMouseDownFlag","_noneGraphicMarkMouseDownActiveData","markKey","dataIndex","onLine","onCircle","pointIndex","setDragGraphicMarkFlag","_checkEventPointX","_checkEventPointY","setGraphicMarkPoint","_twoStepGraphicMarkMouseDown","_threeStepGraphicMarkMouseDown","_noneGraphicMarkMouseLeftDown","_findNoneGraphicMarkMouseDownActiveData","graphicMarkDatas","graphicMarkData","splice","setGraphicMarkData","_graphicMarkMouseDown","lastLineData","drawStep","setGraphicMarkType","performDifPoint","_realFindNoneGraphicMarkMouseDownActiveData","xyPoints","tags","CANDLE_STICK_SERIES_TAG","contentBottom","contentTop","isOnGraphicMark","checkPointOnLine","isOnCircle","xPos","isOn","isOnLine","_waitingForMouseMoveAnimationFrame","_onePointGraphicMarkMouseMove","_twoPointGraphicMarkMouseMove","_threePointGraphicMarkMouseMove","_graphicMarkMouseMove","stepTwo","LineType","COMMON","HORIZONTAL","VERTICAL","GraphicMarkView","_drawHorizontalStraightLine","_drawVerticalStraightLine","_drawStraightLine","_drawHorizontalRayLine","_drawVerticalRayLine","_drawRayLine","_drawSegmentLine","_drawPriceLine","_drawPriceChannelLine","_drawParallelStraightLine","_drawFibonacciLine","_drawPointGraphicMark","generatedLinePoints","isDrawPrice","priceExtendsText","circlePoints","_drawGraphicMark","graphicMarkPoint","lineType","_getLineType","priceText","isCircleActive","circlePoint","circleRadius","circleColor","circleBorderColor","circleBorderSize","CandleStickWidget","CandleStickSeries","_chartType","XAxisView","xAxisOptions","xAxisLine","XAxisFloatLayerView","crossHairVerticalText","xAxisLabelX","rectTop","rectBottom","XAxisWidget","XAxis","_initMeasureCanvas","measureCanvas","_measureCtx","defaultLabelWidth","tickLabelFormatType","nextPos","nextTimestamp","nextX","xDif","timeDif","minuteDif","nextKLineData","XAxisSeries","SeparatorSeries","seriesIndex","dragEventHandler","_seriesIndex","_offsetLeft","_dragEventHandler","_wrapper","cursor","_dragEvent","_mouseDownEvent","_pressedMouseMoveEvent","_startY","startDrag","dragDistance","drag","offsetLeft","destroy","ZoomDragEventHandler","_startDragPoint","_touchPoint","_touchCancelCrossHair","_touchZoomed","_pinchScale","middlePoint","zoom","setCrossHairSeriesTag","real","_translateCrossHairRealY","setCrossHairPoint","deltaY","deltaMode","DOM_DELTA_PAGE","DOM_DELTA_LINE","sign","KeyBoardEventHandler","code","ChartEvent","_event","_pinchStartEvent","_pinchEvent","_mouseUpEvent","_mouseClickEvent","_mouseRightDownEvent","_mouseLeaveEvent","_mouseMoveEvent","_mouseWheelEvent","_longTapEvent","_boundKeyBoardDownEvent","_keyBoardDownEvent","_boundContextMenuEvent","_zoomDragEventHandler","_graphicMarkEventHandler","_keyBoardEventHandler","keyBoardDownEvent","_checkZoomDrag","dragGraphicMarkFlag","setSeriesSize","DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT","TECHNICAL_INDICATOR_NAME_PREFIX","ChartSeries","_initChartContainer","_technicalIndicatorBaseId","_technicalIndicatorSeries","_separatorSeries","_separatorDragStartTechnicalIndicatorHeight","_updateSeries","_xAxisSeries","_chartContainer","_candleStickSeries","_chartEvent","measureSeriesSize","outline","borderStyle","tabIndex","setTempHeight","invalidateLevel","series","technicalIndicatorTypeArray","technicalIndicatorSeriesTechnicalIndicatorType","isYAxisLeft","isYAxisTextOutsize","seriesWidth","seriesHeight","separatorHeight","_measureSeparatorHeight","xAxisHeight","_measureXAxisHeight","yAxisWidth","_measureYAxisWidth","seriesExcludeXAxisSeparatorHeight","mainWidthWidth","yAxisOffsetLeft","mainOffsetLeft","technicalIndicatorSeriesTotalHeight","candleStickSeriesHeight","setTotalDataSpace","technicalIndicatorSeries","separatorSeries","technicalIndicatorSeriesHeight","applyStyleOptions","applyTechnicalIndicatorParams","candleStickSeriesTechnicalIndicatorType","seriesTechnicalIndicatorType","clearDataList","addData","_calcAllSeriesTechnicalIndicator","lastDataTimestamp","setChartType","technicalIndicatorSeriesCount","_separatorStartDrag","_separatorDrag","seriesPos","updateSeriesIndex","setTechnicalIndicatorType","s","removeTechnicalIndicator","Error","separatorSeriesHeight","toDataURL","Chart","_chartSeries","applyPrecision","setTimezone","setOffsetRightSpace","setDataSpace","applyNewData","applyMoreData","updateData","cb","loadMore","setCandleStickSeriesType","createTechnicalIndicator","newGraphicMarkDatas","getConvertPictureUrl","instances","idBase","errorMessage","version","init","ds","getElementById","getElementsByClassName","instance","chart_id","console","warn","chart","dispose","dcs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,SAASA,KAAT,CAAgBC,MAAhB,EAAwBC,MAAxB,EAAgC;MACjC,CAACC,QAAQ,CAACF,MAAD,CAAT,IAAqB,CAACE,QAAQ,CAACD,MAAD,CAAlC,EAA4C;;;;OAGvC,IAAME,GAAX,IAAkBF,MAAlB,EAA0B;QACpBD,MAAM,CAACI,cAAP,CAAsBD,GAAtB,CAAJ,EAAgC;UACxBE,UAAU,GAAGL,MAAM,CAACG,GAAD,CAAzB;UACMG,UAAU,GAAGL,MAAM,CAACE,GAAD,CAAzB;;UACID,QAAQ,CAACI,UAAD,CAAR,IACFJ,QAAQ,CAACG,UAAD,CADN,IAEF,CAACE,OAAO,CAACD,UAAD,CAFN,IAGF,CAACC,OAAO,CAACF,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CAACysB,cAAT,CAAwBQ,GAAxB,KAAgCjtB,QAAQ,CAAC0sB,sBAAT,CAAgCO,GAAhC,CAAtC;MACAhqB,EAAE,GAAGgqB,GAAG,CAACL,QAAT;;;QAEE,CAAC3pB,EAAL,EAAS;MACPA,EAAE,GAAGgqB,GAAG,CAACL,QAAT;;;QAEE,CAAC3pB,EAAD,IAAOgqB,GAAG,YAAY7B,KAA1B,EAAiC;MAC/BnoB,EAAE,GAAGgqB,GAAG,CAAChqB,EAAT;;;QAEEA,EAAJ,EAAQ;MACNkpB,SAAS,CAAClpB,EAAD,CAAT,CAAc4hB,OAAd;aACOsH,SAAS,CAAClpB,EAAD,CAAhB;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/klinecharts.production.min.js b/dist/klinecharts.production.min.js index ec4ffed18..ea088852e 100644 --- a/dist/klinecharts.production.min.js +++ b/dist/klinecharts.production.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).klinecharts={})}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;e.length>i;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function n(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),t}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t,e,i){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(a){var n=Object.getOwnPropertyDescriptor(a,e);return n.get?n.get.call(i):n.value}})(t,e,i||t)}function _(t,e){if(p(t)&&p(e))for(var i in e)if(t.hasOwnProperty(i)){var a=t[i],n=e[i];p(n)&&p(a)&&!d(n)&&!d(a)?_(a,n):(e[i]||0===e[i]||!1===e[i])&&(t[i]=e[i])}}function u(t){if(!t||!p(t))return t;var e,i,a;for(i in e=d(t)?[]:{},t)t.hasOwnProperty(i)&&(e[i]=(a=t[i])&&p(a)?u(a):a);return e}function d(t){return"[object Array]"===Object.prototype.toString.call(t)}function v(t){return"function"==typeof t}function p(t){var i=e(t);return"function"===i||!!t&&"object"===i}function f(t){return"number"==typeof t&&!isNaN(t)}var y,x,g="dash",m="left",k="right",D="inside",M="outside",w={REAL_TIME:"real_time",CANDLE_STICK:"candle_stick"},S="solid",T="stroke",E="up_stroke",L="down_stroke",A="ohlc",I="always",b="follow_cross",P="standard",C={grid:{display:!0,horizontal:{display:!0,size:1,color:"#393939",style:g,dashValue:[2,2]},vertical:{display:!1,size:1,color:"#393939",style:g,dashValue:[2,2]}},candleStick:{bar:{style:S,upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666"},priceMark:{display:!0,high:{display:!0,color:"#D9D9D9",textMargin:5,textSize:10},low:{display:!0,color:"#D9D9D9",textMargin:5,textSize:10},last:{display:!0,upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666",line:{display:!0,style:g,dashValue:[4,4],size:1},text:{display:!0,size:12,paddingLeft:2,paddingTop:2,paddingRight:2,paddingBottom:2,color:"#FFFFFF"}}}},realTime:{timeLine:{color:"#1e88e5",size:1,areaFillColor:"rgba(30, 136, 229, 0.08)"},averageLine:{display:!0,color:"#F5A623",size:1}},technicalIndicator:{bar:{upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666"},line:{size:1,colors:["#D9D9D9","#F5A623","#F601FF","#1587DD","#1e88e5"]}},xAxis:{display:!0,maxHeight:50,minHeight:30,axisLine:{display:!0,color:"#888888",size:1},tickText:{display:!0,color:"#D9D9D9",size:12,margin:3},tickLine:{display:!0,size:1,length:3,color:"#888888"}},yAxis:{display:!0,maxWidth:100,minWidth:60,position:k,axisLine:{display:!0,color:"#888888",size:1},tickText:{position:M,display:!0,color:"#D9D9D9",size:12,margin:3},tickLine:{display:!0,size:1,length:3,color:"#888888"}},separator:{size:1,color:"#888888",fill:!0},floatLayer:{crossHair:{display:!0,horizontal:{display:!0,line:{display:!0,style:g,dashValue:[4,2],size:1,color:"#888888"},text:{display:!0,color:"#D9D9D9",size:12,paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderColor:"#505050",backgroundColor:"#505050"}},vertical:{display:!0,line:{display:!0,style:g,dashValue:[4,2],size:1,color:"#888888"},text:{display:!0,color:"#D9D9D9",size:12,paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderColor:"#505050",backgroundColor:"#505050"}}},prompt:{displayRule:I,candleStick:{showType:P,labels:["时间","开","收","高","低","成交量"],values:null,rect:{paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:6,left:8,top:8,right:8,borderRadius:4,borderSize:1,borderColor:"#3f4254",fillColor:"rgba(17, 17, 17, .3)"},text:{size:12,color:"#D9D9D9",marginLeft:8,marginTop:6,marginRight:8,marginBottom:0}},technicalIndicator:{text:{size:12,color:"#D9D9D9",marginTop:6,marginRight:8,marginBottom:0,marginLeft:8}}}},graphicMark:{line:{color:"#1e88e5",size:1},point:{backgroundColor:"#1e88e5",borderColor:"#1e88e5",borderSize:1,radius:4,activeBackgroundColor:"#1e88e5",activeBorderColor:"#1e88e5",activeBorderSize:1,activeRadius:6},text:{color:"#1e88e5",size:12,marginLeft:2,marginRight:2,marginTop:2,marginBottom:6}}},R={NO:"NO",AVERAGE:"AVERAGE",MA:"MA",VOL:"VOL",MACD:"MACD",BOLL:"BOLL",KDJ:"KDJ",RSI:"RSI",BIAS:"BIAS",BRAR:"BRAR",CCI:"CCI",DMI:"DMI",CR:"CR",PSY:"PSY",DMA:"DMA",TRIX:"TRIX",OBV:"OBV",VR:"VR",WR:"WR",MTM:"MTM",EMV:"EMV",SAR:"SAR"},O=(r(y={},R.MA,[5,10,30,60]),r(y,R.VOL,[5,10,20]),r(y,R.MACD,[12,26,9]),r(y,R.BOLL,[20]),r(y,R.KDJ,[9,3,3]),r(y,R.RSI,[6,12,24]),r(y,R.BIAS,[6,12,24]),r(y,R.BRAR,[26]),r(y,R.CCI,[13]),r(y,R.DMI,[14,6]),r(y,R.CR,[26,10,20,40,60]),r(y,R.PSY,[12]),r(y,R.DMA,[10,50,10]),r(y,R.TRIX,[12,20]),r(y,R.OBV,[30]),r(y,R.VR,[24,30]),r(y,R.WR,[13,34,89]),r(y,R.MTM,[6,10]),r(y,R.EMV,[14,9]),r(y,R.SAR,[2,2,20]),y),H=(r(x={price:2,volume:0},R.NO,2),r(x,R.MA,2),r(x,R.VOL,0),r(x,R.MACD,2),r(x,R.BOLL,2),r(x,R.KDJ,2),r(x,R.RSI,2),r(x,R.BIAS,2),r(x,R.BRAR,4),r(x,R.CCI,4),r(x,R.DMI,4),r(x,R.CR,2),r(x,R.PSY,2),r(x,R.DMA,4),r(x,R.TRIX,4),r(x,R.OBV,4),r(x,R.VR,4),r(x,R.WR,4),r(x,R.MTM,4),r(x,R.EMV,4),r(x,R.SAR,2),x),N={};function z(t,e){for(var i=t.length,a=0;i>a;a++)e(a);return t}function G(t,e){for(var i=0,a=0;t.length>a;a++){var n=t[a].close-e;i+=n*n}var r=i>0,s=Math.sqrt((i=Math.abs(i))/t.length);return r?s:-1*s}function Y(t){var e=0;if(t&&t.length>0){var i=t.length;e=t[0].high;for(var a=1;i>a;a++)e=Math.max(t[a].high,e)}return e}function V(t){var e=0;if(t&&t.length>0){var i=t.length;e=t[0].low;for(var a=1;i>a;a++)e=Math.min(t[a].low,e)}return e}function F(t){var e=0,i=0;if(t&&t.length>0){var a=t.length;e=t[0].high,i=t[0].low;for(var n=1;a>n;n++)e=Math.max(t[n].high,e),i=Math.min(t[n].low,i)}return[e,i]}function B(t){return t&&d(t)}function W(t,e){return B(t)&&t.length===e}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"--";if(t&&p(t)){var a=t[e];if(a||0===a||!1===a)return a}return i}N[R.AVERAGE]=function(t){var e=0,i=0;return z(t,(function(a){e+=t[a].turnover||0,t[a].average=0!==(i+=t[a].volume||0)?e/i:0}))},N[R.MA]=function(t,e){if(!B(e))return t;var i=[],a=e.length;return z(t,(function(n){for(var r={},s=t[n].close,o=0;a>o;o++){i[o]=(i[o]||0)+s;var c=e[o];c>n?r["ma".concat(c)]=i[o]/(n+1):(i[o]-=t[n-c].close,r["ma".concat(c)]=i[o]/c)}t[n].ma=r}))},N[R.VOL]=function(t,e){if(!B(e))return t;var i=[],a=e.length;return z(t,(function(n){for(var r=t[n].volume,s={},o=0;a>o;o++){i[o]=(i[o]||0)+r;var c=e[o];c>n?s["ma".concat(c)]=i[o]/(n+1):(i[o]-=t[n-c].volume,s["ma".concat(c)]=i[o]/c)}s.num=r,t[n].vol=s}))},N[R.MACD]=function(t,e){if(!W(e,3))return t;var i,a,n=0,r=0,s=0,o=0,c=0;return z(t,(function(h){var l=t[h].close;0===h?(i=l,a=l):(i=(2*l+(e[0]-1)*n)/(e[0]+1),a=(2*l+(e[1]-1)*r)/(e[1]+1)),n=i,r=a,c=o=(2*(s=i-a)+c*(e[2]-1))/(e[2]+1),t[h].macd={diff:s,dea:o,macd:2*(s-o)}}))},N[R.BOLL]=function(t,e){if(!W(e,1))return t;var i,a,n=0;return z(t,(function(r){n+=t[r].close,e[0]>r?(i=n/(r+1),a=G(t.slice(0,r+1),i)):(i=(n-=t[r-e[0]].close)/e[0],a=G(t.slice(r-(e[0]-1),r+1),i)),t[r].boll={up:i+2*a,mid:i,dn:i-2*a}}))},N[R.KDJ]=function(t,e){return W(e,3)?z(t,(function(s){var o=t[s].close;e[0]-1>s?(n=V(t.slice(0,s+1)),r=Y(t.slice(0,s+1))):(n=V(t.slice(s-(e[0]-1),s+1)),r=Y(t.slice(s-(e[0]-1),s+1))),t[s].kdj={k:i=(e[1]-1)/e[1]*(e[0]-1>s?50:t[s-1].kdj.k)+1/e[1]*((o-n)/(r-n==0?1:r-n)*100),d:a=(e[2]-1)/e[2]*(e[0]-1>s?50:t[s-1].kdj.d)+1/e[2]*i,j:3*i-2*a}})):t;var i,a,n,r},N[R.RSI]=function(t,e){if(!W(e,3))return t;var i,a,n,s,o,c,h=0,l=0,_=0,u=0,d=0,v=0;return z(t,(function(p){var f,y=(r(f={},"rsi".concat(e[0]),0),r(f,"rsi".concat(e[1]),0),r(f,"rsi".concat(e[2]),0),f);if(p>0){var x=t[p].close-t[p-1].close;if(x>0)h+=x,_+=x,d+=x;else{var g=Math.abs(x);l+=g,u+=g,v+=g}if(e[0]>p)i=h/(p+1),a=(h+l)/(p+1);else{if(p>e[0]){var m=t[p-e[0]].close-t[p-e[0]-1].close;m>0?h-=m:l-=Math.abs(m)}i=h/e[0],a=(h+l)/e[0]}if(y["rsi".concat(e[0])]=0!==a?i/a*100:0,e[1]>p)n=_/(p+1),s=(_+u)/(p+1);else{if(p>e[1]){var k=t[p-e[1]].close-t[p-e[1]-1].close;k>0?_-=k:u-=Math.abs(k)}n=_/e[1],s=(_+u)/e[1]}if(y["rsi".concat(e[1])]=0!==s?n/s*100:0,e[2]>p)o=d/(p+1),c=(d+v)/(p+1);else{if(p>e[2]){var D=t[p-e[2]].close-t[p-e[2]-1].close;D>0?d-=D:v-=Math.abs(D)}o=d/e[2],c=(d+v)/e[2]}y["rsi".concat(e[2])]=0!==c?o/c*100:0}t[p].rsi=y}))},N[R.BIAS]=function(t,e){if(!W(e,3))return t;var i,a,n,r=0,s=0,o=0;return z(t,(function(c){var h={},l=t[c].close;r+=l,s+=l,o+=l,i=e[0]>c?r/(c+1):(r-=t[c-e[0]].close)/e[0],h["bias".concat(e[0])]=(l-i)/i*100,a=e[1]>c?s/(c+1):(s-=t[c-e[1]].close)/e[1],h["bias".concat(e[1])]=(l-a)/a*100,n=e[2]>c?o/(c+1):(o-=t[c-e[2]].close)/e[2],h["bias".concat(e[2])]=(l-n)/n*100,t[c].bias=h}))},N[R.BRAR]=function(t,e){if(!W(e,1))return t;var i=0,a=0,n=0,r=0,s=0,o=0;return z(t,(function(c){var h=t[c].high,l=t[c].low,_=t[c].open;if(s+=h-_,o+=_-l,c>0){var u=t[c-1].close;if(n+=h-u,r+=u-l,c>e[0]-1){var d=t[c-e[0]].high,v=t[c-e[0]].low,p=t[c-e[0]].open;if(c>e[0]){var f=t[c-e[0]-1].close;n-=d-f,r-=f-v}s-=d-p,o-=p-v}a=0!==o?s/o*100:0,i=0!==r?n/r*100:0}t[c].brar={br:i,ar:a}}))},N[R.CCI]=function(t,e){if(!W(e,1))return t;var i,a,n=0,r=[],s=0;return z(t,(function(o){var c=t[o].close;n+=c;var h=(t[o].high+t[o].low+c)/3;if(e[0]>o)s+=Math.abs((i=n/(o+1))-c),r.push(i),a=s/(o+1);else{var l=t[o-e[0]].close;r.push(i=(n-=l)/e[0]),s+=Math.abs(i-c),a=(s-=Math.abs(r[o-e[0]]-l))/e[0]}t[o].cci={cci:0!==a?(h-i)/a/.015:0}}))},N[R.DMI]=function(t,e){if(!W(e,2))return t;var i=0,a=0,n=0,r=0,s=[0],o=0,c=[0],h=0,l=[0],_=0,u=[0],d=0;return z(t,(function(v){if(v>0){var p=t[v-1].close,f=t[v].high,y=t[v].low,x=f-y,g=Math.abs(f-p),m=Math.abs(y-p),k=f-t[v-1].high,D=t[v-1].low-y,M=Math.max(Math.max(x,g),m);o+=M,s.push(M);var w=k>0&&k>D?k:0;h+=w,c.push(w);var S=D>0&&D>k?D:0;_+=S,l.push(S),v>e[0]-1&&(o-=s[v-e[0]],h-=c[v-e[0]],_-=l[v-e[0]]),0===o?(i=0,a=0):(i=100*h/o,a=100*_/o);var T=Math.abs(a-i)/(a+i)*100;if(d+=T,u.push(T),e[1]>v)r=n=d/(v+1);else{var E=u[v-e[1]];r=((n=(d-=E)/e[1])+E)/2}}t[v].dmi={pdi:i,mdi:a,adx:n,adxr:r}}))},N[R.CR]=function(t,e){if(!W(e,5))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=[],_=0,u=[],d=0,v=[],p=0,f=[];return z(t,(function(y){if(y>0){var x=(t[y-1].high+t[y-1].close+t[y-1].low+t[y-1].open)/4,g=t[y].high-x;0>g&&(g=0),o+=g;var m=x-t[y].low;if(0>m&&(m=0),c+=m,y>e[0]){var k=(t[y-e[0]-1].high+t[y-e[0]-1].low+t[y-e[0]-1].close+t[y-e[0]-1].open)/4,D=t[y-e[0]].high-k;0>D&&(D=0);var M=k-t[y-e[0]].low;0>M&&(M=0),o-=D,c-=M}0!==c&&(s=o/c*100);var w=(t[y-1].high+t[y-1].low+t[y-1].close)/3,S=t[y].high-w;o+=S>0?S:0;var T=w-t[y].low;c+=T>0?T:0}h+=s,_+=s,d+=s,p+=s,i=e[1]>y?h/(y+1):(h-=t[y-e[1]].cr.cr)/e[1],l.push(i),a=e[2]>y?_/(y+1):(_-=t[y-e[2]].cr.cr)/e[2],u.push(a),n=e[3]>y?d/(y+1):(d-=t[y-e[3]].cr.cr)/e[3],v.push(n),r=e[4]>y?p/(y+1):(p-=t[y-e[4]].cr.cr)/e[4],f.push(r),t[y].cr={cr:s,ma1:5>y?l[0]:l[y-5],ma2:9>y?u[0]:u[y-9],ma3:17>y?v[0]:v[y-17],ma4:25>y?f[0]:f[y-25]}}))},N[R.PSY]=function(t,e){if(!W(e,1))return t;var i=0,a=0;return z(t,(function(n){n>0&&(a+=t[n].close-t[n-1].close>0?1:0,e[0]>n?i=a/(n+1)*100:(n>e[0]&&(a-=t[n-e[0]+1].close-t[n-e[0]].close>0?1:0),i=a/e[0]*100)),t[n].psy={psy:i}}))},N[R.DMA]=function(t,e){if(!W(e,3))return t;var i,a,n,r,s=0,o=0,c=0;return z(t,(function(h){var l=t[h].close;s+=l,o+=l,n=e[0]>h?s/(h+1):(s-=t[h-e[0]].close)/e[0],r=e[1]>h?o/(h+1):(o-=t[h-e[1]].close)/e[1],c+=i=n-r,a=e[2]>h?c/(h+1):(c-=t[h-e[2]].dma.dif)/e[2],t[h].dma={dif:i,difMa:a}}))},N[R.TRIX]=function(t,e){if(!W(e,2))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=0,_=[];return z(t,(function(u){var d=t[u].close;if(0===u)r=n=a=d;else{r=(2*(n=(2*(a=(2*d+(e[0]-1)*c)/(e[0]+1))+(e[0]-1)*h)/(e[0]+1))+(e[0]-1)*l)/(e[0]+1);var v=_[u-1];s=0===v?0:(r-v)/v*100}c=a,h=n,l=r,_.push(r),o+=s,i=e[1]>u?o/(u+1):(o-=t[u-e[1]].trix.trix)/e[1],t[u].trix={trix:s,maTrix:i}}))},N[R.OBV]=function(t,e){if(!W(e,1))return t;var i,a,n=0,r=0;return z(t,(function(s){var o=t[s].volume;if(0===s)i=o,r+=o;else{var c=t[s-1].close,h=t[s].close;r+=h>c?o:-o,i=h===c?0:r}n+=i,a=e[0]>s?n/(s+1):(n-=t[s-e[0]].obv.obv)/e[0],t[s].obv={obv:i,maObv:a}}))},N[R.VR]=function(t,e){if(!W(e,2))return t;var i,a=0,n=0,r=0,s=0,o=0;return z(t,(function(c){var h=t[c].close,l=t[c].open,_=t[c].volume;if(h>l?a+=_:l>h?n+=_:r+=_,c>e[0]-1){var u=t[c-e[0]].close,d=t[c-e[0]].open,v=t[c-e[0]].volume;u>d?a-=v:d>u?n-=v:r-=v}var p=n+.5*r;0!==p&&(s=(a+.5*r)/p*100),o+=s,i=e[1]>c?o/(c+1):(o-=t[c-e[1]].vr.vr)/e[1],t[c].vr={vr:s,maVr:i}}))},N[R.WR]=function(t,e){if(!W(e,3))return t;var i,a,n,r,s,o=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER;return z(t,(function(d){var v=t[d].close,p=t[d].high,f=t[d].low;if(e[0]>d)o=Math.max(p,o),c=Math.min(f,c);else{var y=F(t.slice(d-e[0],d));o=y[0],c=y[1]}if(i=0!==(n=o-c)?(o-v)/n*100:0,e[1]>d)h=Math.max(p,h),l=Math.min(f,l);else{var x=F(t.slice(d-e[1],d));h=x[0],l=x[1]}if(a=0!==(r=h-l)?(h-v)/r*100:0,e[2]>d)_=Math.max(p,_),u=Math.min(f,u);else{var g=F(t.slice(d-e[2],d));_=g[0],u=g[1]}t[d].wr={wr1:i,wr2:a,wr3:0!==(s=_-u)?(_-v)/s*100:0}}))},N[R.MTM]=function(t,e){if(!W(e,2))return t;var i,a,n=0;return z(t,(function(r){e[0]>r?(i=0,a=0):(n+=i=t[r].close-t[r-e[0]].close,e[0]+e[1]>r?a=n/(r-e[0]+1):(a=n/e[1],n-=t[r-e[1]].mtm.mtm));t[r].mtm={mtm:i,mtmMa:a}}))},N[R.EMV]=function(t,e){if(!W(e,2))return t;var i,a=0,n=0,r=0,s=[];return z(t,(function(o){if(o>0){var c=t[o].high,h=t[o].low;r=((c+h)/2-(t[o-1].high+t[o-1].low)/2)*(c-h)/t[o].turnover}s.push(r),e[0]>o?a+=r:a-=s[o-e[0]],n+=a,i=e[1]>o?n/(o+1):(n-=t[o-e[1]].emv.emv)/e[1],t[o].emv={emv:a,maEmv:i}}))},N[R.SAR]=function(t,e){if(!W(e,3))return t;var i=e[0]/100,a=e[1]/100,n=e[2]/100,r=i,s=-100,o=!1,c=0;return z(t,(function(e){var h=c,l=t[e].high,_=t[e].low;if(o){(-100===s||l>s)&&(s=l,r=Math.min(r+a,n)),c=h+r*(s-h);var u=Math.min(t[Math.max(1,e)-1].low,_);c>t[e].low?(c=s,r=i,s=-100,o=!o):c>u&&(c=u)}else{(-100===s||s>_)&&(s=_,r=Math.min(r+a,n)),c=h+r*(s-h);var d=Math.max(t[Math.max(1,e)-1].high,l);t[e].high>c?(c=s,r=0,s=-100,o=!o):d>c&&(c=d)}t[e].sar={sar:c}}))};var j="en-us";function K(t,e,i){if(t&&f(t)){var a,n=new Date(t);try{a=new Intl.DateTimeFormat(j,{hour12:!1,timeZone:i,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}catch(t){a=new Intl.DateTimeFormat(j,{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}var r=a.match(/^[\d]{1,2}\/[\d]{1,2}\/[\d]{4}/)[0].split("/"),s="".concat(1===r[0].length?"0".concat(r[0]):r[0]),o="".concat(1===r[1].length?"0".concat(r[1]):r[1]),c=a.match(/[\d]{2}:[\d]{2}$/)[0];switch("24"===c.match(/^[\d]{2}/)[0]&&(c=c.replace(/^[\d]{2}/,"00")),e){case"YYYY":return r[2];case"YYYY-MM":return"".concat(r[2],"-").concat(s);case"YYYY-MM-DD":return"".concat(r[2],"-").concat(s,"-").concat(o);case"YYYY-MM-DD hh:mm":return"".concat(r[2],"-").concat(s,"-").concat(o," ").concat(c);case"MM-DD":return"".concat(s,"-").concat(o);case"hh:mm":return c;default:return"".concat(s,"-").concat(o," ").concat(c)}}return"--"}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=+t;return(i||0===i)&&f(i)?t.toFixed(e):"".concat(i)}var U=1,q=2,J=3,$={NONE:"none",HORIZONTAL_STRAIGHT_LINE:"horizontalStraightLine",VERTICAL_STRAIGHT_LINE:"verticalStraightLine",STRAIGHT_LINE:"straightLine",HORIZONTAL_RAY_LINE:"horizontalRayLine",VERTICAL_RAY_LINE:"verticalRayLine",RAY_LINE:"rayLine",HORIZONTAL_SEGMENT_LINE:"horizontalSegmentLine",VERTICAL_SEGMENT_LINE:"verticalSegmentLine",SEGMENT_LINE:"segmentLine",PRICE_LINE:"priceLine",PRICE_CHANNEL_LINE:"priceChannelLine",PARALLEL_STRAIGHT_LINE:"parallelStraightLine",FIBONACCI_LINE:"fibonacciLine"},Q=function(){function t(e,a){i(this,t),this._invalidateHandler=a,this._styleOptions=u(C),_(this._styleOptions,e),this._technicalIndicatorParamOptions=u(O),this._precisionOptions=u(H),this._timezone=null,this._dataList=[],this._loading=!0,this._loadMoreCallback=null,this._more=!0,this._totalDataSpace=0,this._offsetRightSpace=50,this._from=0,this._to=0,this._range=0,this._dataSpace=4,this._barSpace=this._calcBarSpace(),this._crossHairPoint=null,this._crossHairSeriesTag=null,this._preFrom=0,this._graphicMarkType=$.NONE,this._graphicMarkPoint=null,this._dragGraphicMarkFlag=!1,this._graphicMarkDatas={horizontalStraightLine:[],verticalStraightLine:[],straightLine:[],horizontalRayLine:[],verticalRayLine:[],rayLine:[],horizontalSegmentLine:[],verticalSegmentLine:[],segmentLine:[],priceLine:[],parallelStraightLine:[],priceChannelLine:[],fibonacciLine:[]}}return n(t,[{key:"_loadMoreHandler",value:function(){this._more&&!this._loading&&this._loadMoreCallback&&v(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(X(this._dataList[0],"timestamp")))}},{key:"_calcRange",value:function(){this._range=Math.floor(this._totalDataSpace/this._dataSpace),this.adjustFromTo()}},{key:"_calcBarSpace",value:function(){return.75*this._dataSpace}},{key:"_calcRangDif",value:function(){return this._range-Math.floor(this._offsetRightSpace/this._dataSpace)}},{key:"_innerSetDataSpace",value:function(t){return!(!t||2>t||t>30||this._dataSpace===t)&&(this._dataSpace=t,this._barSpace=this._calcBarSpace(),this._calcRange(),!0)}},{key:"styleOptions",value:function(){return this._styleOptions}},{key:"applyStyleOptions",value:function(t){_(this._styleOptions,t)}},{key:"technicalIndicatorParamOptions",value:function(){return this._technicalIndicatorParamOptions}},{key:"applyTechnicalIndicatorParams",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._technicalIndicatorParamOptions.hasOwnProperty(t)&&(this._technicalIndicatorParamOptions[t]=e)}},{key:"precisionOptions",value:function(){return this._precisionOptions}},{key:"setTimezone",value:function(t){this._timezone=t}},{key:"timezone",value:function(){return this._timezone}},{key:"applyPrecision",value:function(t,e){!t&&0!==t||0>t||(this._precisionOptions.price=t,this._precisionOptions[R.MA]=t,this._precisionOptions[R.BOLL]=t,this._precisionOptions[R.SAR]=t),!e&&0!==e||0>e||(this._precisionOptions.volume=e,this._precisionOptions[R.VOL]=e)}},{key:"calcTechnicalIndicator",value:function(t){if(t===R.NO)return!0;var e=N[t];return!!e&&(this._dataList=e(this._dataList,this._technicalIndicatorParamOptions[t]),!0)}},{key:"dataList",value:function(){return this._dataList}},{key:"clearDataList",value:function(){this._more=!0,this._loading=!0,this._dataList=[],this._from=0,this._to=0}},{key:"addData",value:function(t,e,i){if(p(t))if(d(t))if(0===this._dataList.length){this._loading=!1,this._more="boolean"!=typeof i||i,this._dataList=t.concat(this._dataList);var a=this._calcRangDif();this._from=this._dataList.length-a,this.adjustFromTo()}else this._loading=!1,this._more=i,this._dataList=t.concat(this._dataList),this._from+=t.length,this.adjustFromTo();else if(er&&(this._from+=1)}}else this._calcRangDif()>this._dataList.length?this._to=this._dataList.length:(this._from+=1,this._to+=1)}}},{key:"dataSpace",value:function(){return this._dataSpace}},{key:"barSpace",value:function(){return this._barSpace}},{key:"setDataSpace",value:function(t){this._innerSetDataSpace(t)&&this._invalidateHandler()}},{key:"setTotalDataSpace",value:function(t){this._totalDataSpace!==t&&(this._totalDataSpace=t,this._calcRange())}},{key:"setOffsetRightSpace",value:function(t){0>t&&(t=0),this._offsetRightSpace=t}},{key:"from",value:function(){return this._from}},{key:"to",value:function(){return this._to}},{key:"range",value:function(){return this._range}},{key:"crossHairPoint",value:function(){return this._crossHairPoint}},{key:"crossHairSeriesTag",value:function(){return this._crossHairSeriesTag}},{key:"setCrossHairSeriesTag",value:function(t){this._crossHairSeriesTag=t,this._invalidateHandler(U)}},{key:"setCrossHairPoint",value:function(t){this._crossHairPoint=t}},{key:"startDrag",value:function(){this._preFrom=this._from}},{key:"drag",value:function(t){if(Math.abs(t)>=this._dataSpace/2){var e=t/this._dataSpace;if(0!==(e=0>e?Math.floor(e):Math.ceil(e))){if(e>0){if(0===this._from)return this._loadMoreHandler(X(this._dataList[0],"timestamp")),void this._invalidateHandler(U)}else{var i=this._calcRangDif();if(this._from===this._dataList.length-i)return void this._invalidateHandler(U)}this._from=this._preFrom-e,this.adjustFromTo(),0===this._from&&this._loadMoreHandler(),this._invalidateHandler()}else this._loadMoreHandler()}}},{key:"zoom",value:function(t){this._innerSetDataSpace(this._dataSpace+t*(this._dataSpace/10))&&this._invalidateHandler()}},{key:"adjustFromTo",value:function(){var t=this._dataList.length,e=this._calcRangDif();this._from>t-e&&(this._from=t-e),0>this._from&&(this._from=0),this._to=this._from+this._range,this._to>t&&(this._to=t)}},{key:"graphicMarkType",value:function(){return this._graphicMarkType}},{key:"setGraphicMarkType",value:function(t){this._graphicMarkType=t}},{key:"dragGraphicMarkFlag",value:function(){return this._dragGraphicMarkFlag}},{key:"setDragGraphicMarkFlag",value:function(t){this._dragGraphicMarkFlag=t}},{key:"graphicMarkPoint",value:function(){return this._graphicMarkPoint}},{key:"setGraphicMarkPoint",value:function(t){this._graphicMarkPoint=t}},{key:"graphicMarkData",value:function(){return this._graphicMarkDatas}},{key:"setGraphicMarkData",value:function(t){this._graphicMarkDatas=t,this._invalidateHandler(q)}},{key:"loadMore",value:function(t){this._loadMoreCallback=t}}]),t}();function tt(t){return(window.devicePixelRatio||1)/(t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function et(t,e){return t.measureText(e).width}function it(t){return"".concat(t,"px Arial")}function at(t,e,i,a){t.beginPath();var n=t.lineWidth%2?.5:0;t.moveTo(i,e+n),t.lineTo(a,e+n),t.stroke(),t.closePath()}function nt(t,e,i,a){t.beginPath();var n=t.lineWidth%2?.5:0;t.moveTo(e+n,i),t.lineTo(e+n,a),t.stroke(),t.closePath()}function rt(t,e){t.save(),t.lineWidth%2&&t.translate(.5,.5),e(),t.restore()}var st=function(){function t(e){i(this,t),this._container=e.container,this._chartData=e.chartData,this._width=-1,this._height=-1,this._initBefore(e),this._initElement(),this._mainWidget=this._createMainWidget(this._mainWidgetCell,e),this._yAxisWidget=this._createYAxisWidget(this._yAxisWidgetCell,e)}return n(t,[{key:"_initBefore",value:function(t){}},{key:"_initElement",value:function(){this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.position="relative",this._element.style.overflow="hidden",this._element.style.width="100%",this._mainWidgetCell=this._createCell(),this._yAxisWidgetCell=this._createCell(),this._element.appendChild(this._mainWidgetCell),this._element.appendChild(this._yAxisWidgetCell);var t=this._container.lastChild;t?this._container.insertBefore(this._element,t):this._container.appendChild(this._element)}},{key:"_createCell",value:function(){var t=document.createElement("div");return t.style.display="table-cell",t.style.position="absolute",t.style.margin="0",t.style.padding="0",t.style.top="0",t.style.zIndex="1",t}},{key:"_createMainWidget",value:function(t,e){}},{key:"_createYAxisWidget",value:function(t,e){}},{key:"_setCellSize",value:function(t,e){t.style.left="".concat(e.left,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")}},{key:"_computeAxis",value:function(){}},{key:"width",value:function(){return this._element.offsetWidth}},{key:"height",value:function(){return this._height}},{key:"setTempHeight",value:function(t){this._height=t}},{key:"setSize",value:function(t,e){this._height=t.height,this._element.style.height="".concat(t.height,"px"),this._setCellSize(this._mainWidgetCell,t),this._setCellSize(this._yAxisWidgetCell,e),this._mainWidget.setSize(t.width,this._height),this._yAxisWidget&&this._yAxisWidget.setSize(e.width,e.height)}},{key:"invalidate",value:function(t){t===J&&this._computeAxis(),t!==q&&this._yAxisWidget&&this._yAxisWidget.invalidate(t),this._mainWidget.invalidate(t)}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=tt(a),r=this._element.offsetWidth,s=this._element.offsetHeight;i.style.width="".concat(r,"px"),i.style.height="".concat(s,"px"),i.width=r*n,i.height=s*n,a.scale(n,n);var o=this._mainWidgetCell.offsetWidth,c=this._mainWidgetCell.offsetHeight,h=parseInt(this._mainWidgetCell.style.left),l=this._yAxisWidgetCell.offsetWidth,_=this._yAxisWidgetCell.offsetHeight,u=parseInt(this._yAxisWidgetCell.style.left);return a.drawImage(this._mainWidget.getImage(t,e),h,0,o,c),this._yAxisWidget&&a.drawImage(this._yAxisWidget.getImage(t),u,0,l,_),i}},{key:"destroy",value:function(){this._container.removeChild(this._element)}}]),t}(),ot=function(){function t(e){i(this,t),this._width=0,this._height=0,this._initElement(e.container),this._mainView=this._createMainView(this._element,e),this._expandView=this._createExpandView(this._element,e),this._floatLayerView=this._createFloatLayerView(this._element,e)}return n(t,[{key:"_initElement",value:function(t){this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.width="100%",this._element.style.height="100%",this._element.style.position="relative",this._element.style.overflow="hidden",t.appendChild(this._element)}},{key:"_createMainView",value:function(t,e){}},{key:"_createExpandView",value:function(t,e){}},{key:"_createFloatLayerView",value:function(t,e){}},{key:"setSize",value:function(t,e){this._width=t,this._height=e,this._mainView.setSize(t,e),this._floatLayerView.setSize(t,e)}},{key:"invalidate",value:function(t){switch(t){case U:this._floatLayerView.flush();break;case J:this._mainView.flush(),this._floatLayerView.flush()}}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=tt(a);return i.style.width="".concat(this._width,"px"),i.style.height="".concat(this._height,"px"),i.width=this._width*n,i.height=this._height*n,a.scale(n,n),a.drawImage(this._mainView.getImage(),0,0,this._width,this._height),e&&this._expandView&&a.drawImage(this._expandView.getImage(),0,0,this._width,this._height),t&&a.drawImage(this._floatLayerView.getImage(),0,0,this._width,this._height),i}}]),t}();var ct=function(){function t(e,a){i(this,t),this._chartData=a,this._initCanvas(e)}return n(t,[{key:"_initCanvas",value:function(t){this._canvas=document.createElement("canvas"),this._canvas.style.position="absolute",this._canvas.style.right="0",this._canvas.style.left="0",this._canvas.style.zIndex="2",this._ctx=this._canvas.getContext("2d"),t.appendChild(this._canvas)}},{key:"_redraw",value:function(t){this._ctx.clearRect(0,0,this._width,this._height),t&&t(),this._draw()}},{key:"_draw",value:function(){}},{key:"setSize",value:function(t,e){var i=this;this._redraw((function(){var a=tt(i._ctx);i._width=t,i._height=e,i._canvas.style.top="0",i._canvas.style.width="".concat(t,"px"),i._canvas.style.height="".concat(e,"px"),i._canvas.width=t*a,i._canvas.height=e*a,i._ctx.scale(a,a)}))}},{key:"flush",value:function(){var t,e,i=this;this.requestAnimationId&&(t=this.requestAnimationId,window.cancelAnimationFrame||clearTimeout(t),window.cancelAnimationFrame(t)),this.requestAnimationId=(e=function(){i._redraw()},window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout((function(){e()}),1e3/60))}},{key:"getImage",value:function(){return this._canvas}}]),t}(),ht=function(t){function e(t,a,n,r,s){var c;return i(this,e),(c=h(this,o(e).call(this,t,a)))._xAxis=n,c._yAxis=r,c._additionalDataProvider=s,c}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawGrid(),this._drawTechnicalIndicator()}},{key:"_drawGrid",value:function(){var t=this,e=this._chartData.styleOptions().grid;if(e.display){var i=e.horizontal;i.display&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,i.style===g&&this._ctx.setLineDash(i.dashValue),this._yAxis.ticks().forEach((function(e){at(t._ctx,e.y,0,t._width)})));var a=e.vertical;a.display&&(this._ctx.strokeStyle=a.color,this._ctx.lineWidth=a.size,this._ctx.setLineDash(a.style===g?a.dashValue:[]),this._xAxis.ticks().forEach((function(e){nt(t._ctx,e.x,0,t._height)}))),this._ctx.setLineDash([])}}},{key:"_drawTechnicalIndicator",value:function(){var t,e=this,i=this._additionalDataProvider.technicalIndicatorType(),a=this._chartData.technicalIndicatorParamOptions()[i]||[],n=[],r=this._chartData.styleOptions().technicalIndicator;switch(i){case R.MA:var s=[];a.forEach((function(t){s.push("ma".concat(t))})),t=function(t,a,o,c){e._ohlcTechnicalIndicatorDrawing(a,t,c,r,o,i,s,e._yAxis.isCandleStickYAxis(),(function(i){e._prepareLinePoints(t,i,n)}))};break;case R.MACD:var o=this._chartData.dataList();t=function(t,i,a,s){var c=a.macd||{};e._prepareLinePoints(t,[c.diff,c.dea],n);var h=c.macd,l=((o[i-1]||{}).macd||{}).macd||-1/0;h>0?(e._ctx.strokeStyle=r.bar.upColor,e._ctx.fillStyle=r.bar.upColor):0>h?(e._ctx.strokeStyle=r.bar.downColor,e._ctx.fillStyle=r.bar.downColor):(e._ctx.strokeStyle=r.bar.noChangeColor,e._ctx.fillStyle=r.bar.noChangeColor),e._drawBars(t,s,h,!((l||0===l)&&h>l))};break;case R.VOL:var c=this._chartData.dataList();t=function(t,i,s,o){var h=s.vol||{},l=[];a.forEach((function(t){l.push(h["ma".concat(t)])})),e._prepareLinePoints(t,l,n);var _=s.close,u=(c[i-1]||{}||{}).close||_;e._ctx.fillStyle=_>u?r.bar.upColor:u>_?r.bar.downColor:r.bar.noChangeColor,e._drawBars(t,o,h.num,!0)};break;case R.BOLL:t=function(t,a,s,o){e._ohlcTechnicalIndicatorDrawing(a,t,o,r,s,i,["up","mid","dn"],e._yAxis.isCandleStickYAxis(),(function(i){e._prepareLinePoints(t,i,n)}))};break;case R.BIAS:t=function(t,i,r){var s=r.bias||{},o=[];a.forEach((function(t){o.push(s["bias".concat(t)])})),e._prepareLinePoints(t,o,n)};break;case R.BRAR:t=function(t,i,a){var r=a.brar||{};e._prepareLinePoints(t,[r.br,r.ar],n)};break;case R.CCI:t=function(t,i,a){e._prepareLinePoints(t,[(a.cci||{}).cci],n)};break;case R.CR:t=function(t,i,a){var r=a.cr||{};e._prepareLinePoints(t,[r.cr,r.ma1,r.ma2,r.ma3,r.ma4],n)};break;case R.DMA:t=function(t,i,a){var r=a.dma||{};e._prepareLinePoints(t,[r.dif,r.difMa],n)};break;case R.DMI:t=function(t,i,a){var r=a.dmi||{};e._prepareLinePoints(t,[r.mdi,r.pdi,r.adx,r.adxr],n)};break;case R.KDJ:t=function(t,i,a){var r=a.kdj||{};e._prepareLinePoints(t,[r.k,r.d,r.j],n)};break;case R.RSI:t=function(t,i,r){var s=r.rsi||{},o=[];a.forEach((function(t){o.push(s["rsi".concat(t)])})),e._prepareLinePoints(t,o,n)};break;case R.PSY:t=function(t,i,a){e._prepareLinePoints(t,[(a.psy||{}).psy],n)};break;case R.TRIX:t=function(t,i,a){var r=a.trix||{};e._prepareLinePoints(t,[r.trix,r.maTrix],n)};break;case R.OBV:t=function(t,i,a){var r=a.obv||{};e._prepareLinePoints(t,[r.obv,r.maObv],n)};break;case R.VR:t=function(t,i,a){var r=a.vr||{};e._prepareLinePoints(t,[r.vr,r.maVr],n)};break;case R.WR:t=function(t,i,a){var r=a.wr||{};e._prepareLinePoints(t,[r.wr1,r.wr2,r.wr3],n)};break;case R.MTM:t=function(t,i,a){var r=a.mtm||{};e._prepareLinePoints(t,[r.mtm,r.mtmMa],n)};break;case R.EMV:t=function(t,i,a){var r=a.emv||{};e._prepareLinePoints(t,[r.emv,r.maEmv],n)};break;case R.SAR:t=function(t,a,n,s){e._ohlcTechnicalIndicatorDrawing(a,t,s,r,n,i,["sar"],e._yAxis.isCandleStickYAxis(),(function(i){var a=i[0];if(a||0===a){var o=e._yAxis.convertToPixel(a);e._ctx.strokeStyle=(n.high+n.low)/2>a?r.bar.upColor:r.bar.downColor,e._ctx.beginPath(),e._ctx.arc(t,o,s,2*Math.PI,0,!0),e._ctx.stroke(),e._ctx.closePath()}}))}}this._drawGraphics(t,(function(){e._drawLines(n,r)}))}},{key:"_ohlcTechnicalIndicatorDrawing",value:function(t,e,i,a,n,r,s,o,c){var h=n[r.toLowerCase()]||{},l=[];s.forEach((function(t){l.push(h[t])})),c&&c(l);var _=this._chartData.dataList();o||this._drawOhlc(i,e,n,_[t-1]||{},a.bar.upColor,a.bar.downColor,a.bar.noChangeColor)}},{key:"_prepareLinePoints",value:function(t,e,i){for(var a=0;e.length>a;a++){var n=this._yAxis.convertToPixel(e[a]);i[a]?i[a].push({x:t,y:n}):i[a]=[{x:t,y:n}]}}},{key:"_drawLines",value:function(t,e){var i=this,a=e.line.colors,n=t.length,r=(a||[]).length;this._ctx.lineWidth=e.line.size,rt(this._ctx,(function(){for(var e=0;n>e;e++){var s=t[e];if(s.length>0){i._ctx.strokeStyle=a[e%r],i._ctx.beginPath(),i._ctx.moveTo(s[0].x,s[0].y);for(var o=1;s.length>o;o++)i._ctx.lineTo(s[o].x,s[o].y);i._ctx.stroke(),i._ctx.closePath()}}}))}},{key:"_drawBars",value:function(t,e,i,a){if(i||0===i){this._ctx.lineWidth=1;var n=this._yAxis.convertToPixel(i),r=this._yAxis.convertToPixel(0),s=n;0>i&&(s=r);var o=Math.abs(r-n);1>o&&(o=1,s=0>i?s+1:s-1),a?this._ctx.fillRect(t-e,s,2*e,o):this._ctx.strokeRect(t-e,s,2*e,o)}}},{key:"_drawOhlc",value:function(t,e,i,a,n,r,s){var o=i.close,c=this._yAxis.convertToPixel(i.open),h=this._yAxis.convertToPixel(o),l=this._yAxis.convertToPixel(i.high),_=this._yAxis.convertToPixel(i.low),u=(a||{}).close||o;this._ctx.strokeStyle=o>u?n:u>o?r:s,this._ctx.lineWidth=1,this._ctx.beginPath(),this._ctx.moveTo(e,l),this._ctx.lineTo(e,_),this._ctx.stroke(),this._ctx.closePath(),this._ctx.beginPath(),this._ctx.moveTo(e-t,c),this._ctx.lineTo(e,c),this._ctx.stroke(),this._ctx.closePath(),this._ctx.beginPath(),this._ctx.moveTo(e,h),this._ctx.lineTo(e+t,h),this._ctx.stroke(),this._ctx.closePath()}},{key:"_drawGraphics",value:function(t,e){for(var i=0,a=this._chartData.dataList(),n=this._chartData.barSpace(),r=this._chartData.dataSpace(),s=n/2,o=this._chartData.to(),c=this._chartData.from();o>c;c++){t&&t((i+(i+n))/2,c,a[c],s,n),i+=r}e&&e()}}]),e}(ct),lt=function(t){function e(t,a,n,r,s){var c;return i(this,e),(c=h(this,o(e).call(this,t,a)))._xAxis=n,c._yAxis=r,c._additionalDataProvider=s,c}return s(e,t),n(e,[{key:"_draw",value:function(){var t,e=this._chartData.crossHairPoint();t=e?this._xAxis.convertFromPixel(e.x):this._chartData.dataList().length-1;var i=this._chartData.dataList()[t],a=this._xAxis.convertToPixel(t);this._drawCrossHairHorizontalLine(),this._drawCrossHairVerticalLine(i,a);var n=this._chartData.styleOptions().floatLayer.prompt.displayRule;(n===I||n===b&&this._chartData.crossHairSeriesTag())&&this._drawPrompt(i,a)}},{key:"_drawPrompt",value:function(t,e){this._drawTechnicalIndicatorPrompt(t,e)}},{key:"_drawCrossHairHorizontalLine",value:function(){if(this._chartData.crossHairSeriesTag()===this._additionalDataProvider.tag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.horizontal,i=e.line;if(t.display&&e.display&&i.display){var a=this._chartData.crossHairPoint();a&&(this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color,i.style===g&&this._ctx.setLineDash(i.dashValue),at(this._ctx,a.y,0,this._width),this._ctx.setLineDash([]))}}}},{key:"_drawCrossHairVerticalLine",value:function(t,e){if(this._chartData.crossHairSeriesTag()){var i=this._chartData.styleOptions().floatLayer.crossHair,a=i.vertical,n=a.line;i.display&&a.display&&n.display&&t&&(this._ctx.lineWidth=n.size,this._ctx.strokeStyle=n.color,n.style===g&&this._ctx.setLineDash(n.dashValue),nt(this._ctx,e,0,this._height),this._ctx.setLineDash([]))}}},{key:"_drawTechnicalIndicatorPrompt",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=this._chartData.styleOptions().technicalIndicator,n=this._getTechnicalIndicatorPromptData(t),r=a.line.colors;this._drawTechnicalIndicatorPromptText(n,r,i),this._drawTechnicalIndicatorPromptPoint(n.values,r,e)}},{key:"_drawTechnicalIndicatorPromptText",value:function(t,e,i){var a=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.text,n=t.name,r=t.labels,s=t.values,o=a.marginLeft,c=a.marginRight,h=o,l=a.marginTop+i,_=a.size,u=a.color,d=e.length;this._ctx.textBaseline="top",this._ctx.font=it(_);var v=et(this._ctx,n);this._ctx.fillStyle=u,this._ctx.fillText(n,h,l),h+=o+v;for(var p=0;r.length>p;p++){var f="".concat(r[p].toUpperCase(),": ").concat(s[p]||"--"),y=et(this._ctx,f);this._ctx.fillStyle=e[p%d]||u,this._ctx.fillText(f,h,l),h+=o+c+y}}},{key:"_drawTechnicalIndicatorPromptPoint",value:function(t,e,i){var a=this._additionalDataProvider.technicalIndicatorType();if(this._chartData.crossHairSeriesTag()&&a!==R.SAR)for(var n=e.length,r=a===R.MACD||a===R.VOL?t.length-1:t.length,s=0;r>s;s++){var o=t[s];if(o||0===o){var c=this._yAxis.convertToPixel(o);this._ctx.fillStyle=e[s%n],this._ctx.beginPath(),this._ctx.arc(i,c,3,0,2*Math.PI),this._ctx.closePath(),this._ctx.fill()}}}},{key:"_getTechnicalIndicatorPromptData",value:function(t){var e=this._additionalDataProvider.technicalIndicatorType(),i=this._chartData.technicalIndicatorParamOptions()[e]||[],a=[],n=[];switch(e){case R.MA:i.forEach((function(t){n.push("ma".concat(t))}));break;case R.VOL:i.forEach((function(t){n.push("ma".concat(t))})),n.push("num");break;case R.MACD:n=["diff","dea","macd"];break;case R.BOLL:n=["up","mid","dn"];break;case R.BIAS:i.forEach((function(t){n.push("bias".concat(t))}));break;case R.BRAR:n=["br","ar"];break;case R.CCI:n=["cci"];break;case R.CR:n=["cr","ma1","ma2","ma3","ma4"];break;case R.DMA:n=["dif","difMa"];break;case R.DMI:n=["mdi","pdi","adx","adxr"];break;case R.KDJ:n=["k","d","j"];break;case R.RSI:i.forEach((function(t){n.push("rsi".concat(t))}));break;case R.PSY:n=["psy"];break;case R.TRIX:n=["trix","maTrix"];break;case R.OBV:n=["obv","maObv"];break;case R.VR:n=["vr","maVr"];break;case R.WR:n=["wr1","wr2","wr3"];break;case R.MTM:n=["mtm","mtmMa"];break;case R.EMV:n=["emv","maEmv"];break;case R.SAR:n=["sar"]}var r="";if(n.length>0){r="".concat(e),i&&d(i)&&i.length>0&&(r="".concat(r,"(").concat(i.join(","),")"));var s=X(t,e.toLowerCase());n.forEach((function(t){a.push(X(s,t))}));var o=this._chartData.precisionOptions()[e];a.forEach((function(t,e){a[e]=Z(t,o)}))}return{labels:n,values:a,name:r}}}]),e}(ct),_t=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new ht(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createFloatLayerView",value:function(t,e){return new lt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}}]),e}(ot),ut=function(t){function e(t,a,n){var r;return i(this,e),(r=h(this,o(e).call(this,t,a)))._yAxis=n,r}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().yAxis;t.display&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t),this._drawLastPriceLabel(t))}},{key:"_drawAxisLine",value:function(t){var e,i=t.axisLine;i.display&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,e=this._isDrawFromStart(t)?0:this._width,nt(this._ctx,e,0,this._height))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.display){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var a,n,r=i.length;this._isDrawFromStart(t)?(a=0,t.axisLine.display&&(a+=t.axisLine.size),n=a+r):(a=this._width,t.axisLine.display&&(a-=t.axisLine.size),n=a-r),this._yAxis.ticks().forEach((function(t){at(e._ctx,t.y,a,n)}))}}},{key:"_drawTickLabels",value:function(t){var e=this,i=t.tickText;if(i.display){var a,n=t.tickLine,r=n.display,s=n.length,o=i.margin;this._isDrawFromStart(t)?(a=o,t.axisLine.display&&(a+=t.axisLine.size),r&&(a+=s),this._ctx.textAlign="left"):(a=this._width-o,t.axisLine.display&&(a-=t.axisLine.size),r&&(a-=s),this._ctx.textAlign="right");var c=i.size;this._ctx.textBaseline="middle",this._ctx.font=it(c),this._ctx.fillStyle=i.color,this._yAxis.ticks().forEach((function(t){var i,n=f(+(i=t.v))?i>5e4?"".concat(+(i/1e3).toFixed(1),"K"):i>5e6?"".concat(+(i/1e6).toFixed(3),"M"):"".concat(i):"--";e._ctx.fillText(n,a,t.y)})),this._ctx.textAlign="left"}}},{key:"_drawLastPriceLabel",value:function(t){if(this._yAxis.isCandleStickYAxis()){var e=this._chartData.styleOptions().candleStick.priceMark,i=e.last,a=this._chartData.dataList(),n=a.length;if(e.display&&i.display&&i.text.display&&0!==n){var r,s=a[n-1].close,o=(a[n-2]||{}).close||s,c=this._yAxis.convertToPixel(s);c=+Math.max(.05*this._height,Math.min(c,.98*this._height)).toFixed(0),r=s>o?i.upColor:o>s?i.downColor:i.noChangeColor;var h=i.text,l=Z(s,this._chartData.precisionOptions().price),_=i.text.size;this._ctx.font=it(_);var u,d=et(this._ctx,l)+h.paddingLeft+h.paddingRight,v=h.paddingTop+_+h.paddingBottom;u=this._isDrawFromStart(t)?0:this._width-d,this._ctx.fillStyle=r,this._ctx.fillRect(u,c-h.paddingTop-_/2,d,v),this._ctx.fillStyle=h.color,this._ctx.textBaseline="middle",this._ctx.fillText(l,u+h.paddingLeft,c)}}}},{key:"_isDrawFromStart",value:function(t){return t.position===m&&t.tickText.position===D||t.position===k&&t.tickText.position===M}}]),e}(ct),dt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._axis=n,s._additionalDataProvider=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawCrossHairLabel()}},{key:"_drawCrossHairLabel",value:function(){}}]),e}(ct),vt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_drawCrossHairLabel",value:function(){if(this._chartData.crossHairSeriesTag()===this._additionalDataProvider.tag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.horizontal,i=e.text;if(t.display&&e.display&&i.display){var a=this._chartData.crossHairPoint();if(a){var n=Z(this._axis.convertFromPixel(a.y),this._chartData.precisionOptions()[this._axis.isCandleStickYAxis()?"price":this._additionalDataProvider.technicalIndicatorType()]),r=i.size;this._ctx.font=it(r);var s,o=et(this._ctx,n),c=i.paddingLeft,h=i.paddingTop,l=i.borderSize,_=o+2*l+c+i.paddingRight,u=r+2*l+h+i.paddingBottom,d=this._chartData.styleOptions().yAxis;s=d.position===m&&d.tickText.position===D||d.position===k&&d.tickText.position===M?0:this._width-_;var v=a.y-l-h-r/2;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(s,v,_,u),this._ctx.lineWidth=l,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(s,v,_,u),this._ctx.textBaseline="middle",this._ctx.fillStyle=i.color,this._ctx.fillText(n,s+l+c,a.y)}}}}}]),e}(dt),pt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new ut(t,e.chartData,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new vt(t,e.chartData,e.yAxis,e.additionalDataProvider)}}]),e}(ot),ft=function(){function t(e){i(this,t),this._chartData=e,this._width=0,this._height=0,this._minValue=0,this._maxValue=0,this._range=0,this._ticks=[]}return n(t,[{key:"setSize",value:function(t,e){this._width=t,this._height=e}},{key:"ticks",value:function(){return this._ticks}},{key:"computeAxis",value:function(){var t=this._computeMinMaxValue(),e=t.max,i=t.range;this._minValue=t.min,this._maxValue=e,this._range=i,this._ticks=this._computeOptimalTicks(this._computeTicks())}},{key:"_computeMinMaxValue",value:function(){}},{key:"_computeOptimalTicks",value:function(t){}},{key:"_computeTicks",value:function(){var t=[];if(this._range>=0){var e=+this._nice(this._range/8),i=this._getIntervalPrecision(e),a=+this._round(Math.ceil(this._minValue/e)*e,i),n=+this._round(Math.floor(this._maxValue/e)*e,i),r=0,s=a;if(0!==e)for(;+n>=s;)++r,s+=e;s=a;for(var o=0;r>o;o++)t[o]={v:s.toFixed(i)},s+=e}return t}},{key:"_nice",value:function(t){var e=Math.floor(Math.log(t)/Math.log(10)),i=Math.pow(10,e),a=t/i;return t=(1>a?1:2>a?2:3>a?3:5>a?5:10)*i,-20>e?t:+t.toFixed(0>e?-e:0)}},{key:"_getIntervalPrecision",value:function(t){var e=""+t,i=e.indexOf("e");if(i>0){var a=+e.slice(i+1);return 0>a?-a:0}var n=e.indexOf(".");return 0>n?0:e.length-1-n}},{key:"_round",value:function(t,e){return null==e&&(e=10),t=(+t).toFixed(e=Math.min(Math.max(0,e),20))}}]),t}(),yt="candle_stick",xt="technical_indicator",gt=function(t){function e(t,a){var n;return i(this,e),(n=h(this,o(e).call(this,t)))._yAxisType=a,n}return s(e,t),n(e,[{key:"_compareMinMax",value:function(t,e,i){var a=X(t,e.toLowerCase(),{});return Object.keys(a).forEach((function(t){var e=a[t];(e||0===e)&&(i[0]=Math.min(i[0],e),i[1]=Math.max(i[1],e))})),e!==R.BOLL&&e!==R.SAR||(i[0]=Math.min(i[0],t.low),i[1]=Math.max(i[1],t.high)),i}},{key:"_computeMinMaxValue",value:function(){var t=this._minValue,e=this._maxValue;if(t===1/0||e===-1/0)return{min:0,max:0,range:0};var i=Math.abs(e-t);return 0===i&&(i=Math.abs((e+=1)-t)),{min:t-=i/100*10,max:e+=i/100*20,range:i=Math.abs(e-t)}}},{key:"_computeOptimalTicks",value:function(t){var e=[],i=t.length;if(i>0){var a=this._chartData.styleOptions().xAxis.tickText.size,n=this.convertToPixel(+t[0].v),r=1;if(i>1){var s=this.convertToPixel(+t[1].v),o=Math.abs(s-n);2*a>o&&(r=Math.ceil(2*a/o))}for(var c=0;i>c;c+=r){var h=t[c].v,l=this.convertToPixel(+h);l>a&&this._height-a>l&&e.push({v:h,y:l})}}return e}},{key:"calcMinMaxValue",value:function(t,e){var i=this._chartData.dataList(),a=this._chartData.from(),n=this._chartData.to(),r=this._chartData.styleOptions().realTime.averageLine.display,s=[1/0,-1/0];if(e)for(var o=a;n>o;o++){var c=i[o],h=[c.close,s[0]],l=[c.close,s[1]];r&&(h.push(c.average),l.push(c.average)),s[0]=Math.min.apply(null,h),s[1]=Math.max.apply(null,l)}else{for(var _=a;n>_;_++){var u=i[_];this._compareMinMax(u,t,s),this.isCandleStickYAxis()&&(s[0]=Math.min(u.low,s[0]),s[1]=Math.max(u.high,s[1]))}t===R.VOL&&(s[0]=0)}s[0]!==1/0&&s[1]!==-1/0&&(this._minValue=s[0],this._maxValue=s[1])}},{key:"isCandleStickYAxis",value:function(){return this._yAxisType===yt}},{key:"convertFromPixel",value:function(t){return(1-t/this._height)*this._range+this._minValue}},{key:"convertToPixel",value:function(t){return Math.round((1-(t-this._minValue)/this._range)*this._height)}}]),e}(ft),mt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._technicalIndicatorType=t.technicalIndicatorType||R.MACD,a._calcTechnicalIndicator(),a}return s(e,t),n(e,[{key:"_initBefore",value:function(t){this._tag=t.tag,this._yAxis=this._createYAxis(t)}},{key:"_createYAxis",value:function(t){return new gt(t.chartData,xt)}},{key:"_createMainWidget",value:function(t,e){return new _t({container:t,chartData:e.chartData,xAxis:e.xAxis,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),tag:this.tag.bind(this)}})}},{key:"_createYAxisWidget",value:function(t,e){return new pt({container:t,chartData:e.chartData,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),tag:this.tag.bind(this)}})}},{key:"_computeAxis",value:function(){this._yAxis.calcMinMaxValue(this._technicalIndicatorType,this._isRealTime()),this._yAxis.computeAxis()}},{key:"_isRealTime",value:function(){return!1}},{key:"_calcTechnicalIndicator",value:function(){this._chartData.calcTechnicalIndicator(this._technicalIndicatorType)&&this.invalidate(J)}},{key:"tag",value:function(){return this._tag}},{key:"setSize",value:function(t,i){this._yAxis.setSize(i.width,i.height),this._computeAxis(),l(o(e.prototype),"setSize",this).call(this,t,i)}},{key:"yAxis",value:function(){return this._yAxis}},{key:"technicalIndicatorType",value:function(){return this._technicalIndicatorType}},{key:"setTechnicalIndicatorType",value:function(t){this._technicalIndicatorType!==t&&(this._technicalIndicatorType=t,this._calcTechnicalIndicator())}}]),e}(st),kt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawGrid(),this._additionalDataProvider.chartType()===w.REAL_TIME?this._drawRealTime():(this._drawCandleStick(),this._drawTechnicalIndicator(),this._drawHighestPriceMark(),this._drawLowestPriceMark()),this._drawLastPriceLine()}},{key:"_drawRealTime",value:function(){var t=this,e=[],i=[{x:0,y:this._height}],a=[],n=this._chartData.from(),r=this._chartData.range(),s=this._chartData.to();this._drawGraphics((function(r,s,o){var c=o.average,h=t._yAxis.convertToPixel(o.close),l=t._yAxis.convertToPixel(c);e.push({x:r,y:h}),(c||0===c)&&a.push({x:r,y:l}),s===n&&i.push({x:0,y:h}),i.push({x:r,y:h})}),(function(){var o=i.length;if(o>0){var c=i[o-1];!(r>n-s)?(i.push({x:t._width,y:c.y}),i.push({x:t._width,y:t._height})):i.push({x:c.x,y:t._height})}var h=t._chartData.styleOptions().realTime,l=h.timeLine;if(e.length>0&&(t._ctx.lineWidth=l.size,t._ctx.strokeStyle=l.color,rt(t._ctx,(function(){t._ctx.beginPath(),t._ctx.moveTo(e[0].x,e[0].y);for(var i=1;e.length>i;i++)t._ctx.lineTo(e[i].x,e[i].y);t._ctx.stroke(),t._ctx.closePath()}))),i.length>0){t._ctx.fillStyle=l.areaFillColor,t._ctx.beginPath(),t._ctx.moveTo(i[0].x,i[0].y);for(var _=1;i.length>_;_++)t._ctx.lineTo(i[_].x,i[_].y);t._ctx.closePath(),t._ctx.fill()}var u=h.averageLine;u.display&&a.length>0&&(t._ctx.lineWidth=u.size,t._ctx.strokeStyle=u.color,rt(t._ctx,(function(){t._ctx.beginPath(),t._ctx.moveTo(a[0].x,a[0].y);for(var e=1;a.length>e;e++)t._ctx.lineTo(a[e].x,a[e].y);t._ctx.stroke(),t._ctx.closePath()})))}))}},{key:"_drawCandleStick",value:function(){var t=this;this._ctx.lineWidth=1;var e=[],i=-1/0,a=-1,n=1/0,r=-1,s=this._chartData.dataList(),o=this._chartData.styleOptions().candleStick;this._drawGraphics((function(c,h,l,_,u){var d=l.close,v=s[h-1]||{},p=v.close||d,f=l.high,y=l.low,x=l.open;if(f>i&&(i=f,a=c),n>y&&(n=y,r=c),d>p?(t._ctx.strokeStyle=o.bar.upColor,t._ctx.fillStyle=o.bar.upColor):p>d?(t._ctx.strokeStyle=o.bar.downColor,t._ctx.fillStyle=o.bar.downColor):(t._ctx.strokeStyle=o.bar.noChangeColor,t._ctx.fillStyle=o.bar.noChangeColor),o.bar.style!==A){var g=t._yAxis.convertToPixel(x),m=t._yAxis.convertToPixel(d),k=t._yAxis.convertToPixel(f),D=t._yAxis.convertToPixel(y),M=[],w=[];switch(M[0]=k,w[1]=D,g>m?(M[1]=m,w[0]=g,e=[c-_,m,u,g-m]):m>g?(M[1]=g,w[0]=m,e=[c-_,g,u,m-g]):(M[1]=g,w[0]=m,e=[c-_,g,u,1]),t._ctx.beginPath(),t._ctx.moveTo(c,M[0]),t._ctx.lineTo(c,M[1]),t._ctx.stroke(),t._ctx.closePath(),t._ctx.beginPath(),t._ctx.moveTo(c,w[0]),t._ctx.lineTo(c,w[1]),t._ctx.stroke(),t._ctx.closePath(),1>e[3]&&(e[3]=1),o.bar.style){case S:t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case T:t._ctx.strokeRect(e[0],e[1],e[2],e[3]);break;case E:d>p?t._ctx.strokeRect(e[0],e[1],e[2],e[3]):t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case L:d>p?t._ctx.fillRect(e[0],e[1],e[2],e[3]):t._ctx.strokeRect(e[0],e[1],e[2],e[3])}}else t._drawOhlc(_,c,l,v,o.bar.upColor,o.bar.downColor,o.bar.noChangeColor)})),this._highestMarkData={x:a,price:i},this._lowestMarkData={x:r,price:n}}},{key:"_drawHighestPriceMark",value:function(t){if(this._highestMarkData){var e=this._highestMarkData.price,i=this._chartData.styleOptions().candleStick.priceMark,a=i.high;e!==-1/0&&i.display&&a.display&&this._drawLowestHighestPriceMark(a,this._highestMarkData.x,e,!0,this._chartData.precisionOptions().price)}}},{key:"_drawLowestPriceMark",value:function(){if(this._lowestMarkData){var t=this._lowestMarkData.price,e=this._chartData.styleOptions().candleStick.priceMark,i=e.low;t!==1/0&&e.display&&i.display&&this._drawLowestHighestPriceMark(i,this._lowestMarkData.x,t,!1,this._chartData.precisionOptions().price)}}},{key:"_drawLowestHighestPriceMark",value:function(t,e,i,a,n){var r=this,s=this._yAxis.convertToPixel(i),o=e,c=s+(a?-2:2);this._ctx.textAlign="left",this._ctx.lineWidth=1,this._ctx.strokeStyle=t.color,this._ctx.fillStyle=t.color,rt(this._ctx,(function(){r._ctx.beginPath(),r._ctx.moveTo(o,c),r._ctx.lineTo(o-2,c+(a?-2:2)),r._ctx.stroke(),r._ctx.closePath(),r._ctx.beginPath(),r._ctx.moveTo(o,c),r._ctx.lineTo(o+2,c+(a?-2:2)),r._ctx.stroke(),r._ctx.closePath()}));var h=c+(a?-5:5);nt(this._ctx,o,c,h),at(this._ctx,h,o,o+5),this._ctx.font=it(t.textSize);var l=Z(i,n);this._ctx.textBaseline="middle",this._ctx.fillText(l,o+5+t.textMargin,h)}},{key:"_drawLastPriceLine",value:function(){var t=this._chartData.dataList(),e=t.length,i=this._chartData.styleOptions().candleStick.priceMark,a=i.last;if(i.display&&a.display&&a.line.display&&0!==e){var n=t[e-1].close,r=(t[e-2]||{}).close||n,s=this._yAxis.convertToPixel(n);s=+Math.max(.05*this._height,Math.min(s,.98*this._height)).toFixed(0);var o=a.line;this._ctx.strokeStyle=n>r?a.upColor:r>n?a.downColor:a.noChangeColor,this._ctx.lineWidth=o.size,o.style===g&&this._ctx.setLineDash(o.dashValue),at(this._ctx,s,0,this._width),this._ctx.setLineDash([])}}}]),e}(ht),Dt=function(t){function a(){return i(this,a),h(this,o(a).apply(this,arguments))}return s(a,t),n(a,[{key:"_drawPrompt",value:function(t,e){var i=this._chartData.styleOptions().floatLayer.prompt.candleStick,a=this._getCandleStickPromptData(t,i);i.showType===P?(this._drawCandleStickStandardPromptText(i,a),this._additionalDataProvider.chartType()===w.CANDLE_STICK&&this._drawTechnicalIndicatorPrompt(t,e,i.text.size+i.text.marginTop)):this._drawCandleStickRectPromptText(t,e,i,a)}},{key:"_drawCandleStickStandardPromptText",value:function(t,i){var a=this,n=i,r=t.text.marginLeft,s=t.text.marginRight,o=t.text.size,c=t.text.color,h=t.labels;this._ctx.textBaseline="top",this._ctx.font=it(o);var l=r,_=t.text.marginTop;h.forEach((function(t,i){var o=t?"".concat(t,": "):"",h=et(a._ctx,o);a._ctx.fillStyle=c,a._ctx.fillText(o,l,_),l+=h;var u,d=n[i]||"--";"object"===e(d)?(u=d.value||"--",a._ctx.fillStyle=d.color||c):(a._ctx.fillStyle=c,u=d);var v=et(a._ctx,u);a._ctx.fillText(u,l,_),l+=v+r+s}))}},{key:"_drawCandleStickRectPromptText",value:function(t,i,a,n){var r=this,s=a.labels,o=n,c=a.text.marginLeft,h=a.text.marginRight,l=a.text.marginTop,_=a.text.marginBottom,u=a.text.size,d=a.text.color;this._ctx.textBaseline="top",this._ctx.font=it(u);var v=0;s.forEach((function(t,i){var a=o[i]||"--",n=a;"object"===e(a)&&(n=a.value||"--");var s="".concat(t,": ").concat(n),l=et(r._ctx,s)+c+h;v=Math.max(v,l)}));var p=a.rect,f=p.borderSize,y=p.paddingLeft,x=p.paddingRight,g=p.paddingTop,m=p.left,k=p.right,D=2*f+g+p.paddingBottom+(_+l+u)*s.length,M=this._getTechnicalIndicatorPromptData(t),S=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator,T=S.text.marginLeft,E=S.text.marginRight,L=S.text.marginTop,A=S.text.marginBottom,I=S.text.size,b=this._additionalDataProvider.chartType()===w.CANDLE_STICK,P=M.labels||[],C=M.values||[];b&&(this._ctx.font=it(I),P.forEach((function(t,e){var i=C[e]||"--",a="".concat(t,": ").concat(i),n=et(r._ctx,a)+T+E;v=Math.max(v,n)})),D+=(L+A+I)*P.length);var R,O=2*f+v+y+x;R=this._width/2>i?this._width-k-O:m;var H=p.top,N=p.borderRadius;if(this._ctx.lineWidth=f,this._ctx.strokeStyle=p.borderColor,this._ctx.fillStyle=p.fillColor,this._drawRoundRect(R,H,O,D,N),this._ctx.stroke(),this._drawRoundRect(R,H,O,D,N),this._ctx.fill(),b){var z=R+f+y+c,G=H+f+g;this._ctx.font=it(u),s.forEach((function(t,i){G+=l,r._ctx.textAlign="left",r._ctx.fillStyle=d,r._ctx.fillText("".concat(t,": "),z,G);var a,n=o[i]||"--";r._ctx.fillStyle=n.color||d,a="object"===e(n)?n.value||"--":n,r._ctx.textAlign="right",r._ctx.fillText(a,R+O-f-h-x,G),G+=u+_}));var Y=this._chartData.styleOptions().technicalIndicator,V=Y.line.colors,F=R+f+y+T,B=V.length;this._ctx.font=it(I),P.forEach((function(t,e){G+=L,r._ctx.textAlign="left",r._ctx.fillStyle=V[e%B]||Y.text.color,r._ctx.fillText("".concat(t.toUpperCase(),": "),F,G),r._ctx.textAlign="right",r._ctx.fillText(C[e]||"--",R+O-f-E-x,G),G+=I+A}))}this._ctx.textAlign="left"}},{key:"_drawRoundRect",value:function(t,e,i,a,n){this._ctx.beginPath(),this._ctx.moveTo(t+n,e),this._ctx.arcTo(t+i,e,t+i,e+a,n),this._ctx.arcTo(t+i,e+a,t,e+a,n),this._ctx.arcTo(t,e+a,t,e,n),this._ctx.arcTo(t,e,t+i,e,n),this._ctx.closePath()}},{key:"_getCandleStickPromptData",value:function(t,e){var i=this,a=e.values,n=[];if(a)n=v(a)?a(t)||[]:a;else{var r=this._chartData.precisionOptions();(n=[X(t,"timestamp"),X(t,"open"),X(t,"close"),X(t,"high"),X(t,"low"),X(t,"volume")]).forEach((function(t,e){switch(e){case 0:n[e]=K(t,"YYYY-MM-DD hh:mm",i._chartData.timezone());break;case n.length-1:n[e]=Z(t,r.volume);break;default:n[e]=Z(t,r.price)}}))}return n}}]),a}(lt);function Mt(t,e,i){var a=[];if(t&&e&&i.length>0){var n=t.x-e.x;if(0===n)i.forEach((function(t){a.push(t.y)}));else{var r=(t.y-e.y)/n,s=t.y-r*t.x;i.forEach((function(t){a.push(t.x*r+s)}))}}return a}function wt(t,e,i){return!!(i&&t&&e)&&(t.x===e.x?1>Math.abs(i.x-t.x):t.y===e.y?1>Math.abs(i.y-t.y):1>Math.abs(i.y-Mt(t,e,[i])[0]))}function St(t,e,i){return!!(i&&t&&e)&&(!!wt(t,e,i)&&(t.x===e.x?e.y>t.y?i.y>t.y-2:t.y+2>i.y:e.x>t.x?i.x>t.x-2:t.x+2>i.x))}function Tt(t,e,i){return!!(i&&t&&e)&&(!!wt(t,e,i)&&2>Math.abs(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))+Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))-Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))))}function Et(t,e,i){if(!i)return!1;var a=i.x-t.x,n=i.y-t.y;return!(a*a+n*n>e*e)}function Lt(t,e,i){var a=[];if(t.length>1)if(t[0].x===t[1].x){var n=e.height;if(a.push([{x:t[0].x,y:0},{x:t[0].x,y:n}]),t.length>2&&(a.push([{x:t[2].x,y:0},{x:t[2].x,y:n}]),i)){var r=t[0].x-t[2].x;a.push([{x:t[0].x+r,y:0},{x:t[0].x+r,y:n}])}}else{var s=e.width;if(t[0].y===t[1].y){if(a.push([{x:0,y:t[0].y},{x:s,y:t[0].y}]),t.length>2&&(a.push([{x:0,y:t[2].y},{x:s,y:t[2].y}]),i)){var o=t[0].y-t[2].y;a.push([{x:0,y:t[0].y+o},{x:s,y:t[0].y+o}])}}else{var c=(t[0].y-t[1].y)/(t[0].x-t[1].x),h=t[0].y-c*t[0].x;if(a.push([{x:0,y:0*c+h},{x:s,y:s*c+h}]),t.length>2){var l=t[2].y-c*t[2].x;if(a.push([{x:0,y:0*c+l},{x:s,y:s*c+l}]),i){var _=h+(h-l);a.push([{x:0,y:0*c+_},{x:s,y:s*c+_}])}}}}return a}function At(t,e){var i=[];if(t.length>0){var a=e.width;if(i.push([{x:0,y:t[0].y},{x:a,y:t[0].y}]),t.length>1){var n=t[0].y-t[1].y;i.push([{x:0,y:t[1].y+.786*n},{x:a,y:t[1].y+.786*n}]),i.push([{x:0,y:t[1].y+.618*n},{x:a,y:t[1].y+.618*n}]),i.push([{x:0,y:t[1].y+.5*n},{x:a,y:t[1].y+.5*n}]),i.push([{x:0,y:t[1].y+.382*n},{x:a,y:t[1].y+.382*n}]),i.push([{x:0,y:t[1].y+.236*n},{x:a,y:t[1].y+.236*n}]),i.push([{x:0,y:t[1].y},{x:a,y:t[1].y}])}}return i}var It=0,bt=2;function Pt(t){return t.getBoundingClientRect()||{left:0,top:0}}function Ct(t){return!!t.touches}function Rt(t){t.cancelable&&t.preventDefault()}var Ot=!!navigator.maxTouchPoints||!!navigator.msMaxTouchPoints||"ontouchstart"in window||!!(window.DocumentTouch&&document instanceof window.DocumentTouch),Ht="onorientationchange"in window&&Ot;function Nt(t,e){var i=t.clientX-e.clientX,a=t.clientY-e.clientY;return Math.sqrt(i*i+a*a)}var zt={MOUSE:"mouse",TOUCH:"touch"},Gt=function(){function t(e,a,n){i(this,t),this._target=e,this._handler=a,this._options=n,this._clickCount=0,this._clickTimeoutId=null,this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._moveExceededManhattanDistance=!1,this._cancelClick=!1,this._unsubscribeOutsideEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRoot=null,this._startPinchMiddlePoint=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventDragProcess=!1,this._mousePressed=!1,this._init()}return n(t,[{key:"destroy",value:function(){null!==this._unsubscribeOutsideEvents&&(this._unsubscribeOutsideEvents(),this._unsubscribeOutsideEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),this._clearLongTapTimeout(),this._resetClickTimeout()}},{key:"_mouseEnterHandler",value:function(t){var e=this;this._unsubscribeMousemove&&this._unsubscribeMousemove();var i=this._mouseMoveHandler.bind(this),a=this._mouseWheelHandler.bind(this);this._unsubscribeMousemove=function(){e._target.removeEventListener("mousemove",i),e._target.removeEventListener("wheel",a)},this._target.addEventListener("mousemove",i),this._target.addEventListener("wheel",a,{passive:!1}),Ct(t)&&this._mouseMoveHandler(t);var n=this._makeCompatEvent(t);this._processEvent(n,this._handler.mouseEnterEvent)}},{key:"_resetClickTimeout",value:function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null}},{key:"_mouseMoveHandler",value:function(t){if(!this._mousePressed||Ct(t)){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseMoveEvent)}}},{key:"_mouseWheelHandler",value:function(t){var e=this._makeCompatEvent(t);t.localX=e.localX,t.localY=e.localY,this._processEvent(t,this._handler.mouseWheelEvent)}},{key:"_mouseMoveWithDownHandler",value:function(t){if(!("button"in t&&t.button!==It)&&null===this._startPinchMiddlePoint){var e=Ct(t);if(!this._preventDragProcess||!e){this._pinchPrevented=!0;var i=this._makeCompatEvent(t),a=this._mouseMoveStartPosition,n=Math.abs(a.x-i.pageX),r=Math.abs(a.y-i.pageY),s=n+r>5;if(s||!e){if(s&&!this._moveExceededManhattanDistance&&e){var o=.5*n;r>=o&&!this._options.treatVertTouchDragAsPageScroll||o>r&&!this._options.treatHorzTouchDragAsPageScroll||(this._preventDragProcess=!0)}s&&(this._moveExceededManhattanDistance=!0,this._cancelClick=!0,e&&this._clearLongTapTimeout()),this._preventDragProcess||(this._processEvent(i,this._handler.pressedMouseMoveEvent),e&&Rt(t))}}}}},{key:"_mouseUpHandler",value:function(t){if(!("button"in t&&t.button!==It)){var e=this._makeCompatEvent(t);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),Ct(t)&&this._mouseLeaveHandler(t),this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent),Ct(t)&&(Rt(t),this._mouseLeaveHandler(t),0===t.touches.length&&(this._longTapActive=!1))}}},{key:"_clearLongTapTimeout",value:function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}},{key:"_mouseDownHandler",value:function(t){if(!("button"in t&&t.button!==It&&t.button!==bt)){var e=this._makeCompatEvent(t);if("button"in t&&t.button===bt)this._processEvent(e,this._handler.mouseRightDownEvent);else{this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,Ct(t)&&this._mouseEnterHandler(t),this._mouseMoveStartPosition={x:e.pageX,y:e.pageY},this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null);var i=this._mouseMoveWithDownHandler.bind(this),a=this._mouseUpHandler.bind(this),n=this._target.ownerDocument.documentElement;this._unsubscribeRoot=function(){n.removeEventListener("touchmove",i),n.removeEventListener("touchend",a),n.removeEventListener("mousemove",i),n.removeEventListener("mouseup",a)},n.addEventListener("touchmove",i,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),this._clearLongTapTimeout(),Ct(t)&&1===t.touches.length?this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),600):(n.addEventListener("mousemove",i),n.addEventListener("mouseup",a)),this._mousePressed=!0,this._processEvent(e,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))}}}},{key:"_init",value:function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e=this._target.ownerDocument,i=function(e){t._handler.mouseDownOutsideEvent&&(e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent())};this._unsubscribeOutsideEvents=function(){e.removeEventListener("mousedown",i),e.removeEventListener("touchstart",i)},e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._mouseDownHandler.bind(this),{passive:!0}),Ht||this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(function(){}),{passive:!1})}},{key:"_initPinch",value:function(){var t=this;void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",(function(e){return t._checkPinchState(e.touches)}),{passive:!0}),this._target.addEventListener("touchmove",(function(e){if(2===e.touches.length&&null!==t._startPinchMiddlePoint&&void 0!==t._handler.pinchEvent){var i=Nt(e.touches[0],e.touches[1]);t._handler.pinchEvent(t._startPinchMiddlePoint,i/t._startPinchDistance),Rt(e)}}),{passive:!1}),this._target.addEventListener("touchend",(function(e){t._checkPinchState(e.touches)})))}},{key:"_checkPinchState",value:function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)}},{key:"_startPinch",value:function(t){var e=Pt(this._target);this._startPinchMiddlePoint={x:(t[0].clientX-e.left+(t[1].clientX-e.left))/2,y:(t[0].clientY-e.top+(t[1].clientY-e.top))/2},this._startPinchDistance=Nt(t[0],t[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()}},{key:"_stopPinch",value:function(){null!==this._startPinchMiddlePoint&&(this._startPinchMiddlePoint=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())}},{key:"_mouseLeaveHandler",value:function(t){this._unsubscribeMousemove&&this._unsubscribeMousemove();var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseLeaveEvent)}},{key:"_longTapHandler",value:function(t){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.longTapEvent),this._cancelClick=!0,this._longTapActive=!0}},{key:"_processEvent",value:function(t,e){e&&e.call(this._handler,t)}},{key:"_makeCompatEvent",value:function(t){var e;e="touches"in t&&t.touches.length?t.touches[0]:"changedTouches"in t&&t.changedTouches.length?t.changedTouches[0]:t;var i=Pt(this._target);return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,localX:e.clientX-i.left,localY:e.clientY-i.top,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,type:t.type.startsWith("mouse")?zt.MOUSE:zt.TOUCH,target:e.target,view:t.view}}}]),t}();function Yt(t){return t.type===zt.TOUCH}function Vt(t){return t.type===zt.MOUSE}var Ft=function(){function t(e){i(this,t),this._chartData=e,this._seriesSize={}}return n(t,[{key:"_checkEventPointX",value:function(t){return t>this._seriesSize.contentLeft&&this._seriesSize.contentRight>t}},{key:"setSeriesSize",value:function(t){this._seriesSize=t}}]),t}(),Bt="step_1",Wt="step_2",Xt="step_3",jt="step_done",Kt=function(t){function a(t,e,n){var r;return i(this,a),(r=h(this,o(a).call(this,t)))._xAxis=e,r._yAxis=n,r._noneGraphicMarkMouseDownFlag=!1,r._noneGraphicMarkMouseDownActiveData={markKey:null,dataIndex:-1,onLine:!1,onCircle:!1,pointIndex:-1},r}return s(a,t),n(a,[{key:"mouseUpEvent",value:function(t){this._chartData.setDragGraphicMarkFlag(!1),this._noneGraphicMarkMouseDownFlag=!1,this._noneGraphicMarkMouseDownActiveData={markKey:null,dataIndex:-1,onLine:!1,onCircle:!1,pointIndex:-1}}},{key:"mouseDownEvent",value:function(t){if(this._checkEventPointX(t.localX)&&this._checkEventPointY(t.localY)){this._chartData.setGraphicMarkPoint({x:t.localX,y:t.localY});var e=this._chartData.graphicMarkType();switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.STRAIGHT_LINE:case $.HORIZONTAL_RAY_LINE:case $.VERTICAL_RAY_LINE:case $.RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:case $.VERTICAL_SEGMENT_LINE:case $.SEGMENT_LINE:case $.PRICE_LINE:case $.FIBONACCI_LINE:this._twoStepGraphicMarkMouseDown(t,e);break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:this._threeStepGraphicMarkMouseDown(t,e);break;case $.NONE:this._noneGraphicMarkMouseLeftDown(t)}}}},{key:"mouseRightDownEvent",value:function(t){if(this._chartData.graphicMarkType()===$.NONE){this._findNoneGraphicMarkMouseDownActiveData(t);var e=this._noneGraphicMarkMouseDownActiveData.markKey,i=this._noneGraphicMarkMouseDownActiveData.dataIndex;if(e&&-1!==i){var a=this._chartData.graphicMarkData(),n=a[e];n.splice(i,1),a[e]=n,this._chartData.setGraphicMarkData(a),this.mouseUpEvent(t)}}}},{key:"_twoStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Bt:t.drawStep=Wt;break;case Wt:t.drawStep=jt,i._chartData.setGraphicMarkType($.NONE)}}))}},{key:"_threeStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Bt:t.drawStep=Wt;break;case Wt:t.drawStep=Xt;break;case Xt:t.drawStep=jt,i._chartData.setGraphicMarkType($.NONE)}}))}},{key:"_graphicMarkMouseDown",value:function(t,e,i){var a=this._chartData.graphicMarkData(),n=a[e];if(2===t.button)n.splice(n.length-1,1),this._chartData.setGraphicMarkType($.NONE);else{var r=n[n.length-1];i(r),n[n.length-1]=r}a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_noneGraphicMarkMouseLeftDown",value:function(t){this._findNoneGraphicMarkMouseDownActiveData(t),this._noneGraphicMarkMouseDownActiveData.markKey&&-1!==this._noneGraphicMarkMouseDownActiveData.dataIndex&&this._noneGraphicMarkMouseDownActiveData.onCircle&&(this._noneGraphicMarkMouseDownFlag=!0,this._chartData.setDragGraphicMarkFlag(!0))}},{key:"_findNoneGraphicMarkMouseDownActiveData",value:function(t){for(var i=this,a={x:t.localX,y:t.localY},n=Object.keys(this._chartData.graphicMarkData()),r=function(t){var e=n[t];switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.PRICE_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],{x:i._seriesSize.contentRight,y:t[0].y},a)})))return{v:void 0};break;case $.VERTICAL_STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],{x:t[0].x,y:i._seriesSize.tags[he].contentBottom},a)})))return{v:void 0};break;case $.STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],t[1],a)})))return{v:void 0};break;case $.HORIZONTAL_RAY_LINE:case $.VERTICAL_RAY_LINE:case $.RAY_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return St(t[0],t[1],a)})))return{v:void 0};break;case $.HORIZONTAL_SEGMENT_LINE:case $.VERTICAL_SEGMENT_LINE:case $.SEGMENT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Tt(t[0],t[1],a)})))return{v:void 0};break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:case $.FIBONACCI_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){var n=[],r={width:i._seriesSize.contentRight-i._seriesSize.contentLeft,height:i._seriesSize.tags[he].contentBottom-i._seriesSize.tags[he].contentTop};switch(e){case $.PRICE_CHANNEL_LINE:n=Lt(t,r,!0);break;case $.PARALLEL_STRAIGHT_LINE:n=Lt(t,r);break;case $.FIBONACCI_LINE:n=At(t,r)}for(var s=!1,o=0;n.length>o;o++){var c=n[o];if(s=wt(c[0],c[1],a))return s}return s})))return{v:void 0}}},s=0;n.length>s;s++){var o=r(s);if("object"===e(o))return o.v}}},{key:"_realFindNoneGraphicMarkMouseDownActiveData",value:function(t,e,i){var a=this,n=this._chartData.graphicMarkData()[t],r=this._chartData.styleOptions().graphicMark;return n.forEach((function(n,s){var o=[],c=!1,h=-1;n.points.forEach((function(t,i){var n=a._xAxis.convertToPixel(t.xPos),s=a._yAxis.convertToPixel(t.price);o.push({x:n,y:s});var l=Et({x:n,y:s},r.point.radius,e);l&&(h=i),c||(c=l)}));var l=i(o,e);if(l||c)return a._noneGraphicMarkMouseDownActiveData={markKey:t,dataIndex:s,onLine:l,onCircle:c,pointIndex:h},!0})),!1}},{key:"mouseMoveEvent",value:function(t){if(this._checkEventPointX(t.localX)&&this._checkEventPointY(t.localY)){var e={x:t.localX,y:t.localY};if(this._chartData.setGraphicMarkPoint(e),!this._waitingForMouseMoveAnimationFrame){this._waitingForMouseMoveAnimationFrame=!0;var i=this._chartData.graphicMarkType();switch(i){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.PRICE_LINE:this._onePointGraphicMarkMouseMove(e,i);break;case $.STRAIGHT_LINE:case $.RAY_LINE:case $.SEGMENT_LINE:case $.FIBONACCI_LINE:this._twoPointGraphicMarkMouseMove(e,i);break;case $.HORIZONTAL_RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].price=e.price}));break;case $.VERTICAL_RAY_LINE:case $.VERTICAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].xPos=e.xPos}));break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:this._threePointGraphicMarkMouseMove(e,i);break;case $.NONE:this._chartData.setGraphicMarkData(this._chartData.graphicMarkData())}this._waitingForMouseMoveAnimationFrame=!1}}}},{key:"pressedMouseMoveEvent",value:function(t){var e=this._noneGraphicMarkMouseDownActiveData.markKey,i=this._noneGraphicMarkMouseDownActiveData.dataIndex;if(e&&-1!==i){var a=this._chartData.graphicMarkData(),n=a[e],r={x:t.localX,y:t.localY};switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.PRICE_LINE:case $.STRAIGHT_LINE:case $.RAY_LINE:case $.SEGMENT_LINE:case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:case $.FIBONACCI_LINE:var s=this._noneGraphicMarkMouseDownActiveData.pointIndex;-1!==s&&(n[i].points[s].xPos=this._xAxis.convertFromPixel(r.x),n[i].points[s].price=this._yAxis.convertFromPixel(r.y));break;case $.HORIZONTAL_RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:var o=this._noneGraphicMarkMouseDownActiveData.pointIndex;if(-1!==o){var c=this._yAxis.convertFromPixel(r.y);n[i].points[o].xPos=this._xAxis.convertFromPixel(r.x),n[i].points[0].price=c,n[i].points[1].price=c}break;case $.VERTICAL_RAY_LINE:case $.VERTICAL_SEGMENT_LINE:var h=this._noneGraphicMarkMouseDownActiveData.pointIndex;if(-1!==h){var l=this._xAxis.convertFromPixel(r.x);n[i].points[0].xPos=l,n[i].points[1].xPos=l,n[i].points[h].price=this._yAxis.convertFromPixel(r.y)}}a[e]=n,this._chartData.setGraphicMarkPoint({x:t.localX,y:t.localY}),this._chartData.setGraphicMarkData(a)}}},{key:"_onePointGraphicMarkMouseMove",value:function(t,e){var i=this;this._graphicMarkMouseMove(t,e,(function(e,a){var n=i._xAxis.convertFromPixel(t.x),r=i._yAxis.convertFromPixel(t.y);switch(a.drawStep){case jt:e.push({points:[{xPos:n,price:r}],drawStep:Bt});break;case Bt:case Wt:a.points[0].xPos=n,a.points[0].price=r,e[e.length-1]=a}}))}},{key:"_twoPointGraphicMarkMouseMove",value:function(t,e,i){var a=this;this._graphicMarkMouseMove(t,e,(function(e,n){var r=a._xAxis.convertFromPixel(t.x),s=a._yAxis.convertFromPixel(t.y);switch(n.drawStep){case jt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Bt});break;case Bt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Wt:n.points[1]={xPos:r,price:s},v(i)&&i(n,{xPos:r,price:s}),e[e.length-1]=n}}))}},{key:"_threePointGraphicMarkMouseMove",value:function(t,e,i){var a=this;this._graphicMarkMouseMove(t,e,(function(e,n){var r=a._xAxis.convertFromPixel(t.x),s=a._yAxis.convertFromPixel(t.y);switch(n.drawStep){case jt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Bt});break;case Bt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Wt:v(i)&&i(n,{xPos:r,price:s}),n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Xt:n.points[2]={xPos:r,price:s},e[e.length-1]=n}}))}},{key:"_graphicMarkMouseMove",value:function(t,e,i){var a=this._chartData.graphicMarkData(),n=a[e];i(n,n[n.length-1]||{drawStep:jt}),a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_checkEventPointY",value:function(t){var e=this._seriesSize.tags[he];return t>e.contentTop&&e.contentBottom>t}}]),a}(Ft),Zt=0,Ut=1,qt=2,Jt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._xAxis=n,s._yAxis=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().graphicMark,e=this._chartData.precisionOptions().price;this._drawHorizontalStraightLine(t),this._drawVerticalStraightLine(t),this._drawStraightLine(t),this._drawHorizontalRayLine(t),this._drawVerticalRayLine(t),this._drawRayLine(t),this._drawSegmentLine(t),this._drawPriceLine(t,e),this._drawPriceChannelLine(t),this._drawParallelStraightLine(t),this._drawFibonacciLine(t,e)}},{key:"_drawHorizontalStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.HORIZONTAL_STRAIGHT_LINE,t,wt,(function(t){return[[{x:0,y:t[0].y},{x:e._width,y:t[0].y}]]}))}},{key:"_drawVerticalStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.VERTICAL_STRAIGHT_LINE,t,wt,(function(t){return[[{x:t[0].x,y:0},{x:t[0].x,y:e._height}]]}))}},{key:"_drawStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.STRAIGHT_LINE,t,wt,(function(t){if(t[0].x===t[1].x)return[[{x:t[0].x,y:0},{x:t[0].x,y:e._height}]];var i=Mt(t[0],t[1],[{x:0,y:t[0].y},{x:e._width,y:t[0].y}]);return[[{x:0,y:i[0]},{x:e._width,y:i[1]}]]}))}},{key:"_drawHorizontalRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.HORIZONTAL_RAY_LINE,t,St,(function(t){var i={x:0,y:t[0].y};return t[1].x>t[0].x&&(i.x=e._width),[[t[0],i]]}))}},{key:"_drawVerticalRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.VERTICAL_RAY_LINE,t,St,(function(t){var i={x:t[0].x,y:0};return t[1].y>t[0].y&&(i.y=e._height),[[t[0],i]]}))}},{key:"_drawRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.RAY_LINE,t,St,(function(t){var i;return i=t[0].x===t[1].x&&t[0].y!==t[1].y?t[1].y>t[0].y?{x:t[0].x,y:e._height}:{x:t[0].x,y:0}:t[0].x>t[1].x?{x:0,y:Mt(t[0],t[1],[{x:0,y:t[0].y}])[0]}:{x:e._width,y:Mt(t[0],t[1],[{x:e._width,y:t[0].y}])[0]},[[t[0],i]]}))}},{key:"_drawSegmentLine",value:function(t){this._drawPointGraphicMark($.HORIZONTAL_SEGMENT_LINE,t,Tt),this._drawPointGraphicMark($.VERTICAL_SEGMENT_LINE,t,Tt),this._drawPointGraphicMark($.SEGMENT_LINE,t,Tt)}},{key:"_drawPriceLine",value:function(t,e){var i=this;this._drawPointGraphicMark($.PRICE_LINE,t,St,(function(t){return[[t[0],{x:i._width,y:t[0].y}]]}),!0,e)}},{key:"_drawPriceChannelLine",value:function(t){var e=this;this._drawPointGraphicMark($.PRICE_CHANNEL_LINE,t,wt,(function(t){return Lt(t,{width:e._width,height:e._height},!0)}))}},{key:"_drawParallelStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.PARALLEL_STRAIGHT_LINE,t,wt,(function(t){return Lt(t,{width:e._width,height:e._height})}))}},{key:"_drawFibonacciLine",value:function(t,e){var i=this;this._drawPointGraphicMark($.FIBONACCI_LINE,t,wt,(function(t){return At(t,{width:i._width,height:i._height})}),!0,e,["(100.0%)","(78.6%)","(61.8%)","(50.0%)","(38.2%)","(23.6%)","(0.0%)"])}},{key:"_drawPointGraphicMark",value:function(t,e,i,a,n,r,s){var o=this;this._chartData.graphicMarkData()[t].forEach((function(t){var c=t.drawStep,h=[];t.points.forEach((function(t){var e=t.price,i=o._xAxis.convertToPixel(t.xPos),a=o._yAxis.convertToPixel(e);h.push({x:i,y:a})}));var l=a?a(h):[h];o._drawGraphicMark(e,l,h,c,i,n,r,s)}))}},{key:"_drawGraphicMark",value:function(t,e,i,a,n,r,s){var o=this,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],h=this._chartData.graphicMarkPoint(),l=!1;e.forEach((function(e,i){if(e.length>1){var _=n(e[0],e[1],h);if(l||(l=_),a!==Bt){switch(o._ctx.strokeStyle=t.line.color,o._ctx.lineWidth=t.line.size,o._getLineType(e[0],e[1])){case Zt:rt(o._ctx,(function(){o._ctx.beginPath(),o._ctx.moveTo(e[0].x,e[0].y),o._ctx.lineTo(e[1].x,e[1].y),o._ctx.stroke(),o._ctx.closePath()}));break;case Ut:at(o._ctx,e[0].y,e[0].x,e[1].x);break;case qt:nt(o._ctx,e[0].x,e[0].y,e[1].y)}if(r){var u=Z(o._yAxis.convertFromPixel(e[0].y),s);o._ctx.font=it(t.text.size),o._ctx.fillStyle=t.text.color,o._ctx.fillText("".concat(u," ").concat(c[i]||""),e[0].x+t.text.marginLeft,e[0].y-t.text.marginBottom)}}}}));for(var _=t.point.radius,u=!1,d=0;i.length>d&&!(u=Et(i[d],_,h));d++);i.forEach((function(e){var i=Et(e,_,h);if(u||l){var a=_,n=t.point.backgroundColor,r=t.point.borderColor,s=t.point.borderSize;i&&(a=t.point.activeRadius,n=t.point.activeBackgroundColor,r=t.point.activeBorderColor,s=t.point.activeBorderSize),o._ctx.fillStyle=n,o._ctx.beginPath(),o._ctx.arc(e.x,e.y,a,0,2*Math.PI),o._ctx.closePath(),o._ctx.fill(),o._ctx.lineWidth=s,o._ctx.strokeStyle=r,o._ctx.beginPath(),o._ctx.arc(e.x,e.y,a,0,2*Math.PI),o._ctx.closePath(),o._ctx.stroke()}}))}},{key:"_getLineType",value:function(t,e){return t.x===e.x?qt:t.y===e.y?Ut:Zt}}]),e}(ct),$t=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new kt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createExpandView",value:function(t,e){return new Jt(t,e.chartData,e.xAxis,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new Dt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"invalidate",value:function(t){t===q?this._expandView.flush():l(o(e.prototype),"invalidate",this).call(this,t)}},{key:"setSize",value:function(t,i){l(o(e.prototype),"setSize",this).call(this,t,i),this._expandView.setSize(t,i)}}]),e}(_t),Qt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._chartType=w.CANDLE_STICK,a}return s(e,t),n(e,[{key:"_createYAxis",value:function(t){return new gt(t.chartData,yt)}},{key:"_createMainWidget",value:function(t,e){return new $t({container:t,chartData:e.chartData,xAxis:e.xAxis,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),chartType:this.chartType.bind(this),tag:this.tag.bind(this)}})}},{key:"_isRealTime",value:function(){return this._chartType===w.REAL_TIME}},{key:"chartType",value:function(){return this._chartType}},{key:"setChartType",value:function(t){this._chartType!==t&&(this._chartType=t,this._chartData.styleOptions().realTime.averageLine.display&&this._isRealTime()&&this._chartData.calcTechnicalIndicator(R.AVERAGE),this.invalidate(J))}}]),e}(mt),te=function(t){function e(t,a,n){var r;return i(this,e),(r=h(this,o(e).call(this,t,a)))._xAxis=n,r}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().xAxis;t.display&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t))}},{key:"_drawAxisLine",value:function(t){var e=t.axisLine;e.display&&(this._ctx.strokeStyle=e.color,this._ctx.lineWidth=e.size,at(this._ctx,0,0,this._width))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.display){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var a=t.axisLine.display?t.axisLine.size:0,n=a+i.length;this._xAxis.ticks().forEach((function(t){nt(e._ctx,t.x,a,n)}))}}},{key:"_drawTickLabels",value:function(t){var e=t.tickText;if(e.display){var i=t.tickLine;this._ctx.textBaseline="top",this._ctx.font=it(e.size),this._ctx.textAlign="center",this._ctx.fillStyle=e.color;var a=e.margin;t.axisLine.display&&(a+=t.axisLine.size),i.display&&(a+=i.length);for(var n=this._xAxis.ticks(),r=n.length,s=0;r>s;s++)this._ctx.fillText(n[s].v,n[s].x,a)}}}]),e}(ct),ee=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_drawCrossHairLabel",value:function(){if(this._chartData.crossHairSeriesTag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.vertical,i=e.text;if(t.display&&e.display&&i.display){var a,n=this._chartData.crossHairPoint();a=n?this._axis.convertFromPixel(n.x):this._chartData.dataList().length-1;var r=this._chartData.dataList()[a];if(r){var s=this._axis.convertToPixel(a),o=K(r.timestamp,"YYYY-MM-DD hh:mm",this._chartData.timezone()),c=i.size;this._ctx.font=it(c);var h=et(this._ctx,o),l=s-h/2,_=i.paddingLeft,u=i.paddingRight,d=i.paddingTop,v=i.borderSize;_+v>l?l=_+v:l>this._width-h-v-u&&(l=this._width-h-v-u);var p=l-v-_,f=l+h+v+u,y=0+c+2*v+d+i.paddingBottom;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(p,0,f-p,y-0),this._ctx.lineWidth=v,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(p,0,f-p,y-0),this._ctx.textBaseline="top",this._ctx.fillStyle=i.color,this._ctx.fillText(o,l,v+d)}}}}}]),e}(dt),ie=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new te(t,e.chartData,e.xAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new ee(t,e.chartData,e.xAxis)}}]),e}(ot),ae=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._initMeasureCanvas(),a}return s(e,t),n(e,[{key:"_initMeasureCanvas",value:function(){var t=document.createElement("canvas");this._measureCtx=t.getContext("2d");var e=tt(this._measureCtx);this._measureCtx.scale(e,e)}},{key:"_computeMinMaxValue",value:function(){var t=this._chartData.from(),e=this._chartData.to()-1;return{min:t,max:e,range:e-t}}},{key:"_computeOptimalTicks",value:function(t){var e=[],i=t.length,a=this._chartData.dataList();if(i>0){var n=this._chartData.timezone(),r=this._chartData.styleOptions().xAxis.tickText.size;this._measureCtx.font=it(r);var s=et(this._measureCtx,"00-00 00:00"),o=parseInt(t[0].v),c=X(a[o],"timestamp",0),h=this.convertToPixel(o),l=1,_="MM:DD hh:mm";if(i>1){var u=parseInt(t[1].v),d=X(a[u],"timestamp",0),v=this.convertToPixel(u),p=Math.abs(v-h);s>p&&(l=Math.ceil(s/p));var f=(d-c)/1e3/60;_=720>f?"hh:mm":21600>f?"MM-DD":259200>f?"YYYY-MM":"YYYY"}for(var y=0;i>y;y+=l){var x=parseInt(t[y].v),g=a[x].timestamp,m=K(g,_,n);if(i-1-l>=y){var k=a[parseInt(t[y+l].v)].timestamp,D=K(g,"YYYY",n),M=K(g,"YYYY-MM",n),w=K(g,"MM-DD",n);D!==K(k,"YYYY",n)?m=D:M!==K(k,"YYYY-MM",n)?m=M:w!==K(k,"MM-DD",n)&&(m=w)}var S=this.convertToPixel(x);S>s/2&&this._width-s/2>S&&e.push({v:m,x:S})}if(0===e.length){var T=parseInt(t[t.length-1].v),E=a[T].timestamp,L=this.convertToPixel(T);e.push({v:K(E,"MM-DD",n),x:L})}}return e}},{key:"convertFromPixel",value:function(t){var e=this._chartData.dataSpace(),i=Math.ceil(t/e),a=this._chartData.from()+i-1,n=this._chartData.to();return a>n-1&&(a=n-1),a}},{key:"convertToPixel",value:function(t){var e=this._chartData.dataSpace();return Math.round((t-this._chartData.from())*e+this._chartData.barSpace()/2)}}]),e}(ft),ne=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_initBefore",value:function(){this._xAxis=new ae(this._chartData)}},{key:"_createMainWidget",value:function(t,e){return new ie({container:t,chartData:e.chartData,xAxis:this._xAxis})}},{key:"_computeAxis",value:function(){this._xAxis.computeAxis()}},{key:"xAxis",value:function(){return this._xAxis}},{key:"setSize",value:function(t,i){this._xAxis.setSize(t.width,t.height),this._computeAxis(),l(o(e.prototype),"setSize",this).call(this,t,i)}}]),e}(st),re=function(){function t(e,a,n,r){i(this,t),this._chartData=a,this._seriesIndex=n,this._width=0,this._offsetLeft=0,this._dragEventHandler=r,this._initElement(e)}return n(t,[{key:"_initElement",value:function(t){this._container=t,this._wrapper=document.createElement("div"),this._wrapper.style.margin="0",this._wrapper.style.padding="0",this._wrapper.style.position="relative",this._wrapper.style.overflow="hidden",this._wrapper.style.zIndex="10",this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.cursor="ns-resize",this._element.style.height="6px",this._wrapper.appendChild(this._element);var e=t.lastChild;e?t.insertBefore(this._wrapper,e):t.appendChild(this._wrapper),this._dragEvent=new Gt(this._element,{mouseDownEvent:this._mouseDownEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this)},{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0})}},{key:"_mouseDownEvent",value:function(t){this._startY=t.pageY,this._dragEventHandler.startDrag(this._seriesIndex)}},{key:"_pressedMouseMoveEvent",value:function(t){this._dragEventHandler.drag(t.pageY-this._startY,this._seriesIndex)}},{key:"height",value:function(){return this._wrapper.offsetHeight}},{key:"setSize",value:function(t,e){this._offsetLeft=t,this._width=e,this.invalidate()}},{key:"updateSeriesIndex",value:function(t){this._seriesIndex=t}},{key:"invalidate",value:function(){var t=this._chartData.styleOptions().separator;this._wrapper.style.backgroundColor=t.color,this._wrapper.style.height="".concat(t.size,"px"),this._wrapper.style.marginLeft="".concat(t.fill?0:this._offsetLeft,"px"),this._wrapper.style.width=t.fill?"100%":"".concat(this._width,"px")}},{key:"getImage",value:function(){var t=this._chartData.styleOptions().separator,e=document.createElement("canvas"),i=e.getContext("2d"),a=tt(i),n=this._wrapper.offsetWidth,r=t.size;return e.style.width="".concat(n,"px"),e.style.height="".concat(r,"px"),e.width=n*a,e.height=r*a,i.scale(a,a),i.fillStyle=t.color,i.fillRect(this._offsetLeft,0,n,r),e}},{key:"destroy",value:function(){this._dragEvent.destroy(),this._container.removeChild(this._wrapper)}}]),t}(),se=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._startDragPoint={},a._touchPoint={},a._touchCancelCrossHair=!1,a._touchZoomed=!1,a._pinchScale=1,a}return s(e,t),n(e,[{key:"pinchStartEvent",value:function(){this._pinchScale=1,this._touchZoomed=!0}},{key:"pinchEvent",value:function(t,e){var i=5*(e-this._pinchScale);this._pinchScale=e,this._chartData.zoom(i)}},{key:"mouseLeaveEvent",value:function(t){Vt(t)&&this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseMoveEvent",value:function(t){if(Vt(t))if(this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e?(this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag)):this._chartData.setCrossHairSeriesTag(null)}else this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseWheelEvent",value:function(t){if(this._checkEventPointX(t.localX)){var e=-t.deltaY/100;if(0!==e){switch(t.cancelable&&t.preventDefault(),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._chartData.zoom(i)}}}}},{key:"mouseClickEvent",value:function(t){if(Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e&&(this._touchPoint||this._touchCancelCrossHair||this._touchZoomed||(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag)))}}},{key:"mouseDownEvent",value:function(t){if(this._startDragPoint={x:t.localX,y:t.localY},this._chartData.startDrag(),Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);if(e){var i={x:t.localX,y:e.y};if(this._touchZoomed=!1,this._touchPoint){var a=t.localX-this._touchPoint.x,n=t.localY-this._touchPoint.y;10>Math.sqrt(a*a+n*n)?(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint(i),this._chartData.setCrossHairSeriesTag(e.tag)):(this._touchCancelCrossHair=!0,this._touchPoint=null,this._chartData.setCrossHairPoint(i),this._chartData.setCrossHairSeriesTag(null))}else this._touchCancelCrossHair=!1}}}},{key:"pressedMouseMoveEvent",value:function(t){if(this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);if(e){var i={x:t.localX,y:e.y};if(Yt(t)&&this._touchPoint)return this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint(i),void this._chartData.setCrossHairSeriesTag(e.tag);var a=t.localX-this._startDragPoint.x;this._chartData.setCrossHairPoint(i),this._chartData.drag(a)}}}},{key:"longTapEvent",value:function(t){if(Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e&&(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag))}}},{key:"_translateCrossHairRealY",value:function(t){var e=this._seriesSize.tags||{};for(var i in e){var a=e[i];if(t>a.contentTop&&a.contentBottom>t)return{tag:i,y:t-a.contentTop}}return null}}]),e}(Ft),oe=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"keyBoardDownEvent",value:function(t){if(t.shiftKey)switch(t.code){case"ArrowUp":this._chartData.zoom(-.05);break;case"ArrowDown":this._chartData.zoom(.05);break;case"ArrowLeft":this._chartData.startDrag(),this._chartData.drag(-this._chartData.dataSpace());break;case"ArrowRight":this._chartData.startDrag(),this._chartData.drag(this._chartData.dataSpace())}}}]),e}(Ft),ce=function(){function t(e,a,n,r){i(this,t),this._target=e,this._chartData=a,this._seriesSize={},this._event=new Gt(this._target,{pinchStartEvent:this._pinchStartEvent.bind(this),pinchEvent:this._pinchEvent.bind(this),mouseUpEvent:this._mouseUpEvent.bind(this),mouseClickEvent:this._mouseClickEvent.bind(this),mouseDownEvent:this._mouseDownEvent.bind(this),mouseRightDownEvent:this._mouseRightDownEvent.bind(this),mouseLeaveEvent:this._mouseLeaveEvent.bind(this),mouseMoveEvent:this._mouseMoveEvent.bind(this),mouseWheelEvent:this._mouseWheelEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this),longTapEvent:this._longTapEvent.bind(this)},{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!1}),this._boundKeyBoardDownEvent=this._keyBoardDownEvent.bind(this),this._target.addEventListener("keydown",this._boundKeyBoardDownEvent),this._boundContextMenuEvent=function(t){t.preventDefault()},this._target.addEventListener("contextmenu",this._boundContextMenuEvent,!1),this._zoomDragEventHandler=new se(a),this._graphicMarkEventHandler=new Kt(a,n,r),this._keyBoardEventHandler=new oe(a)}return n(t,[{key:"_keyBoardDownEvent",value:function(t){this._keyBoardEventHandler.keyBoardDownEvent(t)}},{key:"_pinchStartEvent",value:function(){this._zoomDragEventHandler.pinchStartEvent()}},{key:"_pinchEvent",value:function(t,e){this._zoomDragEventHandler.pinchEvent(t,e)}},{key:"_mouseUpEvent",value:function(t){this._graphicMarkEventHandler.mouseUpEvent(t)}},{key:"_mouseLeaveEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseLeaveEvent(t)}},{key:"_mouseMoveEvent",value:function(t){this._graphicMarkEventHandler.mouseMoveEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseMoveEvent(t)}},{key:"_mouseWheelEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseWheelEvent(t)}},{key:"_mouseClickEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseClickEvent(t)}},{key:"_mouseDownEvent",value:function(t){this._graphicMarkEventHandler.mouseDownEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseDownEvent(t)}},{key:"_mouseRightDownEvent",value:function(t){this._graphicMarkEventHandler.mouseRightDownEvent(t)}},{key:"_pressedMouseMoveEvent",value:function(t){this._chartData.dragGraphicMarkFlag()&&(this._graphicMarkEventHandler.pressedMouseMoveEvent(t),null!==this._chartData.crossHairSeriesTag()&&this._chartData.setCrossHairSeriesTag(null)),this._checkZoomDrag()&&this._zoomDragEventHandler.pressedMouseMoveEvent(t)}},{key:"_longTapEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.longTapEvent(t)}},{key:"_checkZoomDrag",value:function(){return!this._chartData.dragGraphicMarkFlag()&&this._chartData.graphicMarkType()===$.NONE}},{key:"setSeriesSize",value:function(t){this._zoomDragEventHandler.setSeriesSize(t),this._graphicMarkEventHandler.setSeriesSize(t)}},{key:"destroy",value:function(){this._event.destroy(),this._target.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._target.removeEventListener("contextmenu",this._boundContextMenuEvent)}}]),t}(),he="candle_stick_series_tag",le=function(){function t(e,a){i(this,t),this._initChartContainer(e),this._technicalIndicatorBaseId=0,this._technicalIndicatorSeries=[],this._separatorSeries=[],this._separatorDragStartTechnicalIndicatorHeight=0,this._chartData=new Q(a,this._updateSeries.bind(this)),this._xAxisSeries=new ne({container:this._chartContainer,chartData:this._chartData}),this._candleStickSeries=new Qt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:R.MA,tag:he}),this._chartEvent=new ce(this._chartContainer,this._chartData,this._xAxisSeries.xAxis(),this._candleStickSeries.yAxis()),this.measureSeriesSize()}return n(t,[{key:"_initChartContainer",value:function(t){this._container=t,this._chartContainer=document.createElement("div"),this._chartContainer.style.position="relative",this._chartContainer.style.outline="none",this._chartContainer.style.borderStyle="none",this._chartContainer.style.width="100%",this._chartContainer.style.height="100%",this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)}},{key:"_separatorStartDrag",value:function(t){this._separatorDragStartTechnicalIndicatorHeight=this._technicalIndicatorSeries[t].height()}},{key:"_separatorDrag",value:function(t,e){this._technicalIndicatorSeries[e].setTempHeight(this._separatorDragStartTechnicalIndicatorHeight-t),this.measureSeriesSize()}},{key:"_measureXAxisHeight",value:function(){var t=this._chartData.styleOptions().xAxis,e=t.axisLine,i=t.tickText,a=t.tickLine,n=0;return t.display&&(e.display&&(n+=e.size),a.display&&(n+=a.length),i.display&&(n+=i.size+i.margin)),n>0&&(n=Math.ceil(Math.max(t.minHeight,Math.min(n,t.maxHeight)))),n}},{key:"_measureYAxisWidth",value:function(){var t=this._chartData.styleOptions().yAxis,e=t.tickText,i=0;return t.display&&(t.axisLine.display&&(i+=t.axisLine.size),t.tickLine.display&&(i+=t.tickLine.length),t.tickText.display&&(i+=e.margin+6*(e.size-2))),i>0&&(i=Math.ceil(Math.max(t.minWidth,Math.min(i,t.maxWidth)))),i}},{key:"_measureSeparatorHeight",value:function(){return this._chartData.styleOptions().separator.size*this._separatorSeries.length}},{key:"_updateSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J;if(t!==q){this._xAxisSeries.invalidate(t),this._candleStickSeries.invalidate(t);var e=!0,i=!1,a=void 0;try{for(var n,r=this._technicalIndicatorSeries[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){var s=n.value;s.invalidate(t)}}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}}this._candleStickSeries.invalidate(t)}},{key:"_calcAllSeriesTechnicalIndicator",value:function(){var t=[];this._candleStickSeries.chartType()===w.CANDLE_STICK?t.push(this._candleStickSeries.technicalIndicatorType()):this._chartData.calcTechnicalIndicator(R.AVERAGE);var e=!0,i=!1,a=void 0;try{for(var n,r=this._technicalIndicatorSeries[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){var s=n.value.technicalIndicatorType();0>t.indexOf(s)&&t.push(s)}}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}for(var o=0,c=t;c.length>o;o++){this._chartData.calcTechnicalIndicator(c[o])}this._updateSeries()}},{key:"chartData",value:function(){return this._chartData}},{key:"measureSeriesSize",value:function(){var t=this._chartData.styleOptions().yAxis,e=t.position===m,i=t.tickText.position===M,a=this._chartContainer.offsetWidth,n=this._chartContainer.offsetHeight,r=this._measureSeparatorHeight(),s=this._measureXAxisHeight(),o=this._measureYAxisWidth(),c=n-s-r,h=a-(i?o:0),l=a-o,_=0;e&&(l=0,i&&(_=o));var u=0,d=!0,v=!1,p=void 0;try{for(var f,y=this._technicalIndicatorSeries[Symbol.iterator]();!(d=(f=y.next()).done);d=!0){u+=f.value.height()}}catch(t){v=!0,p=t}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}var x=c-u;this._chartData.setTotalDataSpace(h);var g={};g.contentLeft=_,g.contentRight=_+h;var k={};k[he]={contentTop:0,contentBottom:x};var D=x,w=x;this._candleStickSeries.setSize({left:_,width:h,height:x},{left:l,width:o,height:x});for(var S=0;this._technicalIndicatorSeries.length>S;S++){var T=this._technicalIndicatorSeries[S],E=this._separatorSeries[S],L=T.height();T.setSize({left:_,width:h,height:L},{left:l,width:o,height:L}),E.setSize(_,h),w+=L,k[T.tag()]={contentTop:D,contentBottom:w},D=w}g.tags=k,this._xAxisSeries.setSize({left:_,width:h,height:s},{left:l,width:o,height:s}),this._chartEvent.setSeriesSize(g)}},{key:"applyStyleOptions",value:function(t){this._chartData.applyStyleOptions(t),this.measureSeriesSize()}},{key:"applyTechnicalIndicatorParams",value:function(t,e){if(this._chartData.applyTechnicalIndicatorParams(t,e),this._chartData.calcTechnicalIndicator(t)){this._candleStickSeries.technicalIndicatorType()===t&&this._candleStickSeries.invalidate(J);var i=!0,a=!1,n=void 0;try{for(var r,s=this._technicalIndicatorSeries[Symbol.iterator]();!(i=(r=s.next()).done);i=!0){var o=r.value;o.technicalIndicatorType()===t&&o.invalidate(J)}}catch(t){a=!0,n=t}finally{try{i||null==s.return||s.return()}finally{if(a)throw n}}}}},{key:"applyNewData",value:function(t,e){d(t)&&(this._chartData.clearDataList(),this._chartData.addData(t,0,e),this._calcAllSeriesTechnicalIndicator())}},{key:"applyMoreData",value:function(t,e){d(t)&&(this._chartData.addData(t,0,e),this._calcAllSeriesTechnicalIndicator())}},{key:"updateData",value:function(t){if(p(t)&&!d(t)){var e=this._chartData.dataList(),i=e.length,a=i;+X(t,"timestamp",0)===+X(e[i-1],"timestamp",0)&&(a=i-1),this._chartData.addData(t,a),this._calcAllSeriesTechnicalIndicator()}}},{key:"setCandleStickSeriesType",value:function(t){this._candleStickSeries.setChartType(t)}},{key:"createTechnicalIndicator",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=this._technicalIndicatorSeries.length;this._separatorSeries.push(new re(this._chartContainer,this._chartData,i,{startDrag:this._separatorStartDrag.bind(this),drag:this._separatorDrag.bind(this)})),this._technicalIndicatorBaseId++;var a="".concat("technical_indicator_").concat(this._technicalIndicatorBaseId),n=new mt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:t,tag:a});return n.setTempHeight(e),this._technicalIndicatorSeries.push(n),this.measureSeriesSize(),a}},{key:"removeTechnicalIndicator",value:function(t){for(var e=-1,i=0;this._technicalIndicatorSeries.length>i;i++){if(this._technicalIndicatorSeries[i].tag()===t){e=i;break}}if(-1!==e){this._technicalIndicatorSeries[e].destroy(),this._separatorSeries[e].destroy(),delete this._technicalIndicatorSeries[e],delete this._separatorSeries[e];for(var a=0;this._separatorSeries.length>a;a++)this._separatorSeries[a].updateSeriesIndex(a);this.measureSeriesSize()}}},{key:"setTechnicalIndicatorType",value:function(t,e){if(t===he)this._candleStickSeries.setTechnicalIndicatorType(e);else{var i,a=!0,n=!1,r=void 0;try{for(var s,o=this._technicalIndicatorSeries[Symbol.iterator]();!(a=(s=o.next()).done);a=!0){var c=s.value;if(c.tag()===t){i=c;break}}}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}i&&(e===R.NO?this.removeTechnicalIndicator(t):i.setTechnicalIndicatorType(e))}}},{key:"getConvertPictureUrl",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jpeg";if("png"!==i&&"jpeg"!==i&&"bmp"!==i)throw Error("Picture format only supports jpeg, png and bmp!!!");var a=document.createElement("canvas"),n=a.getContext("2d"),r=tt(n),s=this._chartContainer.offsetWidth,o=this._chartContainer.offsetHeight;a.style.width="".concat(s,"px"),a.style.height="".concat(o,"px"),a.width=s*r,a.height=o*r,n.scale(r,r);var c=0,h=this._candleStickSeries.height();n.drawImage(this._candleStickSeries.getImage(t,e),0,c,s,h),n.drawImage(this._candleStickSeries.getImage(t,e),0,c,s,h),c+=h;for(var l=0;this._separatorSeries.length>l;l++){var _=this._separatorSeries[l],u=_.height(),d=this._technicalIndicatorSeries[l],v=d.height();n.drawImage(_.getImage(),0,c,s,u),c+=u,n.drawImage(d.getImage(t),0,c,s,v),c+=v}return n.drawImage(this._xAxisSeries.getImage(t),0,c,s,this._xAxisSeries.height()),a.toDataURL("image/".concat(i))}},{key:"destroy",value:function(){this._candleStickSeries.destroy(),this._technicalIndicatorSeries.forEach((function(t){t.destroy()})),this._separatorSeries.forEach((function(t){t.destroy()})),this._xAxisSeries.destroy(),this._container.removeChild(this._chartContainer),this._chartEvent.destroy()}}]),t}(),_e=function(){function t(e,a){i(this,t),this._chartSeries=new le(e,a)}return n(t,[{key:"setStyleOptions",value:function(t){this._chartSeries.applyStyleOptions(t)}},{key:"getStyleOptions",value:function(){return this._chartSeries.chartData().styleOptions()}},{key:"setTechnicalIndicatorParams",value:function(t,e){this._chartSeries.applyTechnicalIndicatorParams(t,e)}},{key:"getTechnicalIndicatorParamOptions",value:function(){this._chartSeries.chartData().technicalIndicatorParamOptions()}},{key:"setPrecision",value:function(t,e){this._chartSeries.chartData().applyPrecision(t,e)}},{key:"setTimezone",value:function(t){this._chartSeries.chartData().setTimezone(t)}},{key:"resize",value:function(){this._chartSeries.chartData().adjustFromTo(),this._chartSeries.measureSeriesSize()}},{key:"setOffsetRightSpace",value:function(t){this._chartSeries.chartData().setOffsetRightSpace(t)}},{key:"setDataSpace",value:function(t){this._chartSeries.chartData().setDataSpace(t)}},{key:"clearData",value:function(){this._chartSeries.chartData().clearDataList()}},{key:"getDataList",value:function(){return this._chartSeries.chartData().dataList()}},{key:"applyNewData",value:function(t,e){this._chartSeries.applyNewData(t,e)}},{key:"applyMoreData",value:function(t,e){this._chartSeries.applyMoreData(t,e)}},{key:"updateData",value:function(t){this._chartSeries.updateData(t)}},{key:"loadMore",value:function(t){this._chartSeries.chartData().loadMore(t)}},{key:"setCandleStickChartType",value:function(t){this._chartSeries.setCandleStickSeriesType(t)}},{key:"setCandleStickTechnicalIndicatorType",value:function(t){this._chartSeries.setTechnicalIndicatorType(he,t)}},{key:"setTechnicalIndicatorType",value:function(t,e){this._chartSeries.setTechnicalIndicatorType(t,e)}},{key:"addTechnicalIndicator",value:function(t,e){return this._chartSeries.createTechnicalIndicator(t,e)}},{key:"removeTechnicalIndicator",value:function(t){this._chartSeries.removeTechnicalIndicator(t)}},{key:"addGraphicMark",value:function(t){var e=this._chartSeries.chartData().graphicMarkType();if(e!==t){var i=this._chartSeries.chartData().graphicMarkData(),a=i[e];a&&d(a)&&(a.splice(a.length-1,1),i[e]=a),i.hasOwnProperty(t)||(t=$.NONE),this._chartSeries.chartData().setGraphicMarkType(t),this._chartSeries.chartData().setGraphicMarkData(i)}}},{key:"removeAllGraphicMark",value:function(){var t=this._chartSeries.chartData().graphicMarkData(),e={};Object.keys(t).forEach((function(t){e[t]=[]})),this._chartSeries.chartData().setGraphicMarkType($.NONE),this._chartSeries.chartData().setGraphicMarkData(e)}},{key:"getConvertPictureUrl",value:function(t,e,i){return this._chartSeries.getConvertPictureUrl(t,e,i)}},{key:"destroy",value:function(){this._chartSeries.destroy()}}]),t}(),ue={},de=1,ve="Chart version is 5.0.0. Root dom is null, can not initialize the chart!!!";t.dispose=function(t){var e;t&&("string"==typeof t&&(e=(t=document.getElementById(t)||document.getElementsByClassName(t)).chart_id),e||(e=t.chart_id),!e&&t instanceof _e&&(e=t.id),e&&(ue[e].destroy(),delete ue[e]))},t.init=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t;if(!i)throw Error(ve);if("string"==typeof i&&(i=document.getElementById(t)||document.getElementsByClassName(t)),!i)throw Error(ve);var a=ue[i.chart_id||""];if(a)return a;var n="k_line_chart_".concat(de++),r=new _e(i,e);return r.id=n,i.chart_id=n,ue[n]=r,r},t.version=function(){return"5.0.0"},Object.defineProperty(t,"__esModule",{value:!0})})); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).klinecharts={})}(this,(function(t){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var i=0;e.length>i;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function n(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),t}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function l(t,e,i){return(l="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var a=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=o(t)););return t}(t,e);if(a){var n=Object.getOwnPropertyDescriptor(a,e);return n.get?n.get.call(i):n.value}})(t,e,i||t)}function _(t,e){if(p(t)&&p(e))for(var i in e)if(t.hasOwnProperty(i)){var a=t[i],n=e[i];p(n)&&p(a)&&!d(n)&&!d(a)?_(a,n):(e[i]||0===e[i]||!1===e[i])&&(t[i]=e[i])}}function u(t){if(!t||!p(t))return t;var e,i,a;for(i in e=d(t)?[]:{},t)t.hasOwnProperty(i)&&(e[i]=(a=t[i])&&p(a)?u(a):a);return e}function d(t){return"[object Array]"===Object.prototype.toString.call(t)}function v(t){return"function"==typeof t}function p(t){var i=e(t);return"function"===i||!!t&&"object"===i}function f(t){return"number"==typeof t&&!isNaN(t)}var y,x,g="dash",m="left",k="right",D="inside",M="outside",w={REAL_TIME:"real_time",CANDLE_STICK:"candle_stick"},S="solid",T="stroke",E="up_stroke",L="down_stroke",A="ohlc",I="always",b="follow_cross",P="standard",C={grid:{display:!0,horizontal:{display:!0,size:1,color:"#393939",style:g,dashValue:[2,2]},vertical:{display:!1,size:1,color:"#393939",style:g,dashValue:[2,2]}},candleStick:{bar:{style:S,upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666"},priceMark:{display:!0,high:{display:!0,color:"#D9D9D9",textMargin:5,textSize:10},low:{display:!0,color:"#D9D9D9",textMargin:5,textSize:10},last:{display:!0,upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666",line:{display:!0,style:g,dashValue:[4,4],size:1},text:{display:!0,size:12,paddingLeft:2,paddingTop:2,paddingRight:2,paddingBottom:2,color:"#FFFFFF"}}}},realTime:{timeLine:{color:"#1e88e5",size:1,areaFillColor:"rgba(30, 136, 229, 0.08)"},averageLine:{display:!0,color:"#F5A623",size:1}},technicalIndicator:{bar:{upColor:"#26A69A",downColor:"#EF5350",noChangeColor:"#666666"},line:{size:1,colors:["#D9D9D9","#F5A623","#F601FF","#1587DD","#1e88e5"]}},xAxis:{display:!0,maxHeight:50,minHeight:30,axisLine:{display:!0,color:"#888888",size:1},tickText:{display:!0,color:"#D9D9D9",size:12,margin:3},tickLine:{display:!0,size:1,length:3,color:"#888888"}},yAxis:{display:!0,maxWidth:100,minWidth:60,position:k,axisLine:{display:!0,color:"#888888",size:1},tickText:{position:M,display:!0,color:"#D9D9D9",size:12,margin:3},tickLine:{display:!0,size:1,length:3,color:"#888888"}},separator:{size:1,color:"#888888",fill:!0},floatLayer:{crossHair:{display:!0,horizontal:{display:!0,line:{display:!0,style:g,dashValue:[4,2],size:1,color:"#888888"},text:{display:!0,color:"#D9D9D9",size:12,paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderColor:"#505050",backgroundColor:"#505050"}},vertical:{display:!0,line:{display:!0,style:g,dashValue:[4,2],size:1,color:"#888888"},text:{display:!0,color:"#D9D9D9",size:12,paddingLeft:2,paddingRight:2,paddingTop:2,paddingBottom:2,borderSize:1,borderColor:"#505050",backgroundColor:"#505050"}}},prompt:{displayRule:I,candleStick:{showType:P,labels:["时间","开","收","高","低","成交量"],values:null,rect:{paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:6,left:8,top:8,right:8,borderRadius:4,borderSize:1,borderColor:"#3f4254",fillColor:"rgba(17, 17, 17, .3)"},text:{size:12,color:"#D9D9D9",marginLeft:8,marginTop:6,marginRight:8,marginBottom:0}},technicalIndicator:{text:{size:12,color:"#D9D9D9",marginTop:6,marginRight:8,marginBottom:0,marginLeft:8}}}},graphicMark:{line:{color:"#1e88e5",size:1},point:{backgroundColor:"#1e88e5",borderColor:"#1e88e5",borderSize:1,radius:4,activeBackgroundColor:"#1e88e5",activeBorderColor:"#1e88e5",activeBorderSize:1,activeRadius:6},text:{color:"#1e88e5",size:12,marginLeft:2,marginRight:2,marginTop:2,marginBottom:6}}},R={NO:"NO",AVERAGE:"AVERAGE",MA:"MA",VOL:"VOL",MACD:"MACD",BOLL:"BOLL",KDJ:"KDJ",RSI:"RSI",BIAS:"BIAS",BRAR:"BRAR",CCI:"CCI",DMI:"DMI",CR:"CR",PSY:"PSY",DMA:"DMA",TRIX:"TRIX",OBV:"OBV",VR:"VR",WR:"WR",MTM:"MTM",EMV:"EMV",SAR:"SAR"},O=(r(y={},R.MA,[5,10,30,60]),r(y,R.VOL,[5,10,20]),r(y,R.MACD,[12,26,9]),r(y,R.BOLL,[20]),r(y,R.KDJ,[9,3,3]),r(y,R.RSI,[6,12,24]),r(y,R.BIAS,[6,12,24]),r(y,R.BRAR,[26]),r(y,R.CCI,[13]),r(y,R.DMI,[14,6]),r(y,R.CR,[26,10,20,40,60]),r(y,R.PSY,[12]),r(y,R.DMA,[10,50,10]),r(y,R.TRIX,[12,20]),r(y,R.OBV,[30]),r(y,R.VR,[24,30]),r(y,R.WR,[13,34,89]),r(y,R.MTM,[6,10]),r(y,R.EMV,[14,9]),r(y,R.SAR,[2,2,20]),y),H=(r(x={price:2,volume:0},R.NO,2),r(x,R.MA,2),r(x,R.VOL,0),r(x,R.MACD,2),r(x,R.BOLL,2),r(x,R.KDJ,2),r(x,R.RSI,2),r(x,R.BIAS,2),r(x,R.BRAR,4),r(x,R.CCI,4),r(x,R.DMI,4),r(x,R.CR,2),r(x,R.PSY,2),r(x,R.DMA,4),r(x,R.TRIX,4),r(x,R.OBV,4),r(x,R.VR,4),r(x,R.WR,4),r(x,R.MTM,4),r(x,R.EMV,4),r(x,R.SAR,2),x),N={};function z(t,e){for(var i=t.length,a=0;i>a;a++)e(a);return t}function G(t,e){for(var i=0,a=0;t.length>a;a++){var n=t[a].close-e;i+=n*n}var r=i>0,s=Math.sqrt((i=Math.abs(i))/t.length);return r?s:-1*s}function Y(t){var e=0;if(t&&t.length>0){var i=t.length;e=t[0].high;for(var a=1;i>a;a++)e=Math.max(t[a].high,e)}return e}function V(t){var e=0;if(t&&t.length>0){var i=t.length;e=t[0].low;for(var a=1;i>a;a++)e=Math.min(t[a].low,e)}return e}function F(t){var e=0,i=0;if(t&&t.length>0){var a=t.length;e=t[0].high,i=t[0].low;for(var n=1;a>n;n++)e=Math.max(t[n].high,e),i=Math.min(t[n].low,i)}return[e,i]}function B(t){return t&&d(t)}function W(t,e){return B(t)&&t.length===e}function X(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"--";if(t&&p(t)){var a=t[e];if(a||0===a||!1===a)return a}return i}N[R.AVERAGE]=function(t){var e=0,i=0;return z(t,(function(a){e+=t[a].turnover||0,t[a].average=0!==(i+=t[a].volume||0)?e/i:0}))},N[R.MA]=function(t,e){if(!B(e))return t;var i=[],a=e.length;return z(t,(function(n){for(var r={},s=t[n].close,o=0;a>o;o++){i[o]=(i[o]||0)+s;var c=e[o];c>n?r["ma".concat(c)]=i[o]/(n+1):(i[o]-=t[n-c].close,r["ma".concat(c)]=i[o]/c)}t[n].ma=r}))},N[R.VOL]=function(t,e){if(!B(e))return t;var i=[],a=e.length;return z(t,(function(n){for(var r=t[n].volume,s={},o=0;a>o;o++){i[o]=(i[o]||0)+r;var c=e[o];c>n?s["ma".concat(c)]=i[o]/(n+1):(i[o]-=t[n-c].volume,s["ma".concat(c)]=i[o]/c)}s.num=r,t[n].vol=s}))},N[R.MACD]=function(t,e){if(!W(e,3))return t;var i,a,n=0,r=0,s=0,o=0,c=0;return z(t,(function(h){var l=t[h].close;0===h?(i=l,a=l):(i=(2*l+(e[0]-1)*n)/(e[0]+1),a=(2*l+(e[1]-1)*r)/(e[1]+1)),n=i,r=a,c=o=(2*(s=i-a)+c*(e[2]-1))/(e[2]+1),t[h].macd={diff:s,dea:o,macd:2*(s-o)}}))},N[R.BOLL]=function(t,e){if(!W(e,1))return t;var i,a,n=0;return z(t,(function(r){n+=t[r].close,e[0]>r?(i=n/(r+1),a=G(t.slice(0,r+1),i)):(i=(n-=t[r-e[0]].close)/e[0],a=G(t.slice(r-(e[0]-1),r+1),i)),t[r].boll={up:i+2*a,mid:i,dn:i-2*a}}))},N[R.KDJ]=function(t,e){return W(e,3)?z(t,(function(s){var o=t[s].close;e[0]-1>s?(n=V(t.slice(0,s+1)),r=Y(t.slice(0,s+1))):(n=V(t.slice(s-(e[0]-1),s+1)),r=Y(t.slice(s-(e[0]-1),s+1))),t[s].kdj={k:i=(e[1]-1)/e[1]*(e[0]-1>s?50:t[s-1].kdj.k)+1/e[1]*((o-n)/(r-n==0?1:r-n)*100),d:a=(e[2]-1)/e[2]*(e[0]-1>s?50:t[s-1].kdj.d)+1/e[2]*i,j:3*i-2*a}})):t;var i,a,n,r},N[R.RSI]=function(t,e){if(!W(e,3))return t;var i,a,n,s,o,c,h=0,l=0,_=0,u=0,d=0,v=0;return z(t,(function(p){var f,y=(r(f={},"rsi".concat(e[0]),0),r(f,"rsi".concat(e[1]),0),r(f,"rsi".concat(e[2]),0),f);if(p>0){var x=t[p].close-t[p-1].close;if(x>0)h+=x,_+=x,d+=x;else{var g=Math.abs(x);l+=g,u+=g,v+=g}if(e[0]>p)i=h/(p+1),a=(h+l)/(p+1);else{if(p>e[0]){var m=t[p-e[0]].close-t[p-e[0]-1].close;m>0?h-=m:l-=Math.abs(m)}i=h/e[0],a=(h+l)/e[0]}if(y["rsi".concat(e[0])]=0!==a?i/a*100:0,e[1]>p)n=_/(p+1),s=(_+u)/(p+1);else{if(p>e[1]){var k=t[p-e[1]].close-t[p-e[1]-1].close;k>0?_-=k:u-=Math.abs(k)}n=_/e[1],s=(_+u)/e[1]}if(y["rsi".concat(e[1])]=0!==s?n/s*100:0,e[2]>p)o=d/(p+1),c=(d+v)/(p+1);else{if(p>e[2]){var D=t[p-e[2]].close-t[p-e[2]-1].close;D>0?d-=D:v-=Math.abs(D)}o=d/e[2],c=(d+v)/e[2]}y["rsi".concat(e[2])]=0!==c?o/c*100:0}t[p].rsi=y}))},N[R.BIAS]=function(t,e){if(!W(e,3))return t;var i,a,n,r=0,s=0,o=0;return z(t,(function(c){var h={},l=t[c].close;r+=l,s+=l,o+=l,i=e[0]>c?r/(c+1):(r-=t[c-e[0]].close)/e[0],h["bias".concat(e[0])]=(l-i)/i*100,a=e[1]>c?s/(c+1):(s-=t[c-e[1]].close)/e[1],h["bias".concat(e[1])]=(l-a)/a*100,n=e[2]>c?o/(c+1):(o-=t[c-e[2]].close)/e[2],h["bias".concat(e[2])]=(l-n)/n*100,t[c].bias=h}))},N[R.BRAR]=function(t,e){if(!W(e,1))return t;var i=0,a=0,n=0,r=0,s=0,o=0;return z(t,(function(c){var h=t[c].high,l=t[c].low,_=t[c].open;if(s+=h-_,o+=_-l,c>0){var u=t[c-1].close;if(n+=h-u,r+=u-l,c>e[0]-1){var d=t[c-e[0]].high,v=t[c-e[0]].low,p=t[c-e[0]].open;if(c>e[0]){var f=t[c-e[0]-1].close;n-=d-f,r-=f-v}s-=d-p,o-=p-v}a=0!==o?s/o*100:0,i=0!==r?n/r*100:0}t[c].brar={br:i,ar:a}}))},N[R.CCI]=function(t,e){if(!W(e,1))return t;var i,a,n=0,r=[],s=0;return z(t,(function(o){var c=t[o].close;n+=c;var h=(t[o].high+t[o].low+c)/3;if(e[0]>o)s+=Math.abs((i=n/(o+1))-c),r.push(i),a=s/(o+1);else{var l=t[o-e[0]].close;r.push(i=(n-=l)/e[0]),s+=Math.abs(i-c),a=(s-=Math.abs(r[o-e[0]]-l))/e[0]}t[o].cci={cci:0!==a?(h-i)/a/.015:0}}))},N[R.DMI]=function(t,e){if(!W(e,2))return t;var i=0,a=0,n=0,r=0,s=[0],o=0,c=[0],h=0,l=[0],_=0,u=[0],d=0;return z(t,(function(v){if(v>0){var p=t[v-1].close,f=t[v].high,y=t[v].low,x=f-y,g=Math.abs(f-p),m=Math.abs(y-p),k=f-t[v-1].high,D=t[v-1].low-y,M=Math.max(Math.max(x,g),m);o+=M,s.push(M);var w=k>0&&k>D?k:0;h+=w,c.push(w);var S=D>0&&D>k?D:0;_+=S,l.push(S),v>e[0]-1&&(o-=s[v-e[0]],h-=c[v-e[0]],_-=l[v-e[0]]),0===o?(i=0,a=0):(i=100*h/o,a=100*_/o);var T=Math.abs(a-i)/(a+i)*100;if(d+=T,u.push(T),e[1]>v)r=n=d/(v+1);else{var E=u[v-e[1]];r=((n=(d-=E)/e[1])+E)/2}}t[v].dmi={pdi:i,mdi:a,adx:n,adxr:r}}))},N[R.CR]=function(t,e){if(!W(e,5))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=[],_=0,u=[],d=0,v=[],p=0,f=[];return z(t,(function(y){if(y>0){var x=(t[y-1].high+t[y-1].close+t[y-1].low+t[y-1].open)/4,g=t[y].high-x;0>g&&(g=0),o+=g;var m=x-t[y].low;if(0>m&&(m=0),c+=m,y>e[0]){var k=(t[y-e[0]-1].high+t[y-e[0]-1].low+t[y-e[0]-1].close+t[y-e[0]-1].open)/4,D=t[y-e[0]].high-k;0>D&&(D=0);var M=k-t[y-e[0]].low;0>M&&(M=0),o-=D,c-=M}0!==c&&(s=o/c*100);var w=(t[y-1].high+t[y-1].low+t[y-1].close)/3,S=t[y].high-w;o+=S>0?S:0;var T=w-t[y].low;c+=T>0?T:0}h+=s,_+=s,d+=s,p+=s,i=e[1]>y?h/(y+1):(h-=t[y-e[1]].cr.cr)/e[1],l.push(i),a=e[2]>y?_/(y+1):(_-=t[y-e[2]].cr.cr)/e[2],u.push(a),n=e[3]>y?d/(y+1):(d-=t[y-e[3]].cr.cr)/e[3],v.push(n),r=e[4]>y?p/(y+1):(p-=t[y-e[4]].cr.cr)/e[4],f.push(r),t[y].cr={cr:s,ma1:5>y?l[0]:l[y-5],ma2:9>y?u[0]:u[y-9],ma3:17>y?v[0]:v[y-17],ma4:25>y?f[0]:f[y-25]}}))},N[R.PSY]=function(t,e){if(!W(e,1))return t;var i=0,a=0;return z(t,(function(n){n>0&&(a+=t[n].close-t[n-1].close>0?1:0,e[0]>n?i=a/(n+1)*100:(n>e[0]&&(a-=t[n-e[0]+1].close-t[n-e[0]].close>0?1:0),i=a/e[0]*100)),t[n].psy={psy:i}}))},N[R.DMA]=function(t,e){if(!W(e,3))return t;var i,a,n,r,s=0,o=0,c=0;return z(t,(function(h){var l=t[h].close;s+=l,o+=l,n=e[0]>h?s/(h+1):(s-=t[h-e[0]].close)/e[0],r=e[1]>h?o/(h+1):(o-=t[h-e[1]].close)/e[1],c+=i=n-r,a=e[2]>h?c/(h+1):(c-=t[h-e[2]].dma.dif)/e[2],t[h].dma={dif:i,difMa:a}}))},N[R.TRIX]=function(t,e){if(!W(e,2))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=0,_=[];return z(t,(function(u){var d=t[u].close;if(0===u)r=n=a=d;else{r=(2*(n=(2*(a=(2*d+(e[0]-1)*c)/(e[0]+1))+(e[0]-1)*h)/(e[0]+1))+(e[0]-1)*l)/(e[0]+1);var v=_[u-1];s=0===v?0:(r-v)/v*100}c=a,h=n,l=r,_.push(r),o+=s,i=e[1]>u?o/(u+1):(o-=t[u-e[1]].trix.trix)/e[1],t[u].trix={trix:s,maTrix:i}}))},N[R.OBV]=function(t,e){if(!W(e,1))return t;var i,a,n=0,r=0;return z(t,(function(s){var o=t[s].volume;if(0===s)i=o,r+=o;else{var c=t[s-1].close,h=t[s].close;r+=h>c?o:-o,i=h===c?0:r}n+=i,a=e[0]>s?n/(s+1):(n-=t[s-e[0]].obv.obv)/e[0],t[s].obv={obv:i,maObv:a}}))},N[R.VR]=function(t,e){if(!W(e,2))return t;var i,a=0,n=0,r=0,s=0,o=0;return z(t,(function(c){var h=t[c].close,l=t[c].open,_=t[c].volume;if(h>l?a+=_:l>h?n+=_:r+=_,c>e[0]-1){var u=t[c-e[0]].close,d=t[c-e[0]].open,v=t[c-e[0]].volume;u>d?a-=v:d>u?n-=v:r-=v}var p=n+.5*r;0!==p&&(s=(a+.5*r)/p*100),o+=s,i=e[1]>c?o/(c+1):(o-=t[c-e[1]].vr.vr)/e[1],t[c].vr={vr:s,maVr:i}}))},N[R.WR]=function(t,e){if(!W(e,3))return t;var i,a,n,r,s,o=Number.MIN_SAFE_INTEGER,c=Number.MAX_SAFE_INTEGER,h=Number.MIN_SAFE_INTEGER,l=Number.MAX_SAFE_INTEGER,_=Number.MIN_SAFE_INTEGER,u=Number.MAX_SAFE_INTEGER;return z(t,(function(d){var v=t[d].close,p=t[d].high,f=t[d].low;if(e[0]>d)o=Math.max(p,o),c=Math.min(f,c);else{var y=F(t.slice(d-e[0],d));o=y[0],c=y[1]}if(i=0!==(n=o-c)?(o-v)/n*100:0,e[1]>d)h=Math.max(p,h),l=Math.min(f,l);else{var x=F(t.slice(d-e[1],d));h=x[0],l=x[1]}if(a=0!==(r=h-l)?(h-v)/r*100:0,e[2]>d)_=Math.max(p,_),u=Math.min(f,u);else{var g=F(t.slice(d-e[2],d));_=g[0],u=g[1]}t[d].wr={wr1:i,wr2:a,wr3:0!==(s=_-u)?(_-v)/s*100:0}}))},N[R.MTM]=function(t,e){if(!W(e,2))return t;var i,a,n=0;return z(t,(function(r){e[0]>r?(i=0,a=0):(n+=i=t[r].close-t[r-e[0]].close,e[0]+e[1]>r?a=n/(r-e[0]+1):(a=n/e[1],n-=t[r-e[1]].mtm.mtm));t[r].mtm={mtm:i,mtmMa:a}}))},N[R.EMV]=function(t,e){if(!W(e,2))return t;var i,a=0,n=0,r=0,s=[];return z(t,(function(o){if(o>0){var c=t[o].high,h=t[o].low;r=((c+h)/2-(t[o-1].high+t[o-1].low)/2)*(c-h)/t[o].turnover}s.push(r),e[0]>o?a+=r:a-=s[o-e[0]],n+=a,i=e[1]>o?n/(o+1):(n-=t[o-e[1]].emv.emv)/e[1],t[o].emv={emv:a,maEmv:i}}))},N[R.SAR]=function(t,e){if(!W(e,3))return t;var i=e[0]/100,a=e[1]/100,n=e[2]/100,r=i,s=-100,o=!1,c=0;return z(t,(function(e){var h=c,l=t[e].high,_=t[e].low;if(o){(-100===s||l>s)&&(s=l,r=Math.min(r+a,n)),c=h+r*(s-h);var u=Math.min(t[Math.max(1,e)-1].low,_);c>t[e].low?(c=s,r=i,s=-100,o=!o):c>u&&(c=u)}else{(-100===s||s>_)&&(s=_,r=Math.min(r+a,n)),c=h+r*(s-h);var d=Math.max(t[Math.max(1,e)-1].high,l);t[e].high>c?(c=s,r=0,s=-100,o=!o):d>c&&(c=d)}t[e].sar={sar:c}}))};var j="en-us";function K(t,e,i){if(t&&f(t)){var a,n=new Date(t);try{a=new Intl.DateTimeFormat(j,{hour12:!1,timeZone:i,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}catch(t){a=new Intl.DateTimeFormat(j,{hour12:!1,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}var r=a.match(/^[\d]{1,2}\/[\d]{1,2}\/[\d]{4}/)[0].split("/"),s="".concat(1===r[0].length?"0".concat(r[0]):r[0]),o="".concat(1===r[1].length?"0".concat(r[1]):r[1]),c=a.match(/[\d]{2}:[\d]{2}$/)[0];switch("24"===c.match(/^[\d]{2}/)[0]&&(c=c.replace(/^[\d]{2}/,"00")),e){case"YYYY":return r[2];case"YYYY-MM":return"".concat(r[2],"-").concat(s);case"YYYY-MM-DD":return"".concat(r[2],"-").concat(s,"-").concat(o);case"YYYY-MM-DD hh:mm":return"".concat(r[2],"-").concat(s,"-").concat(o," ").concat(c);case"MM-DD":return"".concat(s,"-").concat(o);case"hh:mm":return c;default:return"".concat(s,"-").concat(o," ").concat(c)}}return"--"}function Z(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=+t;return(i||0===i)&&f(i)?t.toFixed(e):"".concat(i)}var U=1,q=2,J=3,$={NONE:"none",HORIZONTAL_STRAIGHT_LINE:"horizontalStraightLine",VERTICAL_STRAIGHT_LINE:"verticalStraightLine",STRAIGHT_LINE:"straightLine",HORIZONTAL_RAY_LINE:"horizontalRayLine",VERTICAL_RAY_LINE:"verticalRayLine",RAY_LINE:"rayLine",HORIZONTAL_SEGMENT_LINE:"horizontalSegmentLine",VERTICAL_SEGMENT_LINE:"verticalSegmentLine",SEGMENT_LINE:"segmentLine",PRICE_LINE:"priceLine",PRICE_CHANNEL_LINE:"priceChannelLine",PARALLEL_STRAIGHT_LINE:"parallelStraightLine",FIBONACCI_LINE:"fibonacciLine"},Q=function(){function t(e,a){i(this,t),this._invalidateHandler=a,this._styleOptions=u(C),_(this._styleOptions,e),this._technicalIndicatorParamOptions=u(O),this._precisionOptions=u(H),this._timezone=null,this._dataList=[],this._loading=!0,this._loadMoreCallback=null,this._more=!0,this._totalDataSpace=0,this._offsetRightSpace=50,this._from=0,this._to=0,this._range=0,this._dataSpace=4,this._barSpace=this._calcBarSpace(),this._crossHairPoint=null,this._crossHairSeriesTag=null,this._preFrom=0,this._graphicMarkType=$.NONE,this._graphicMarkPoint=null,this._dragGraphicMarkFlag=!1,this._graphicMarkDatas={horizontalStraightLine:[],verticalStraightLine:[],straightLine:[],horizontalRayLine:[],verticalRayLine:[],rayLine:[],horizontalSegmentLine:[],verticalSegmentLine:[],segmentLine:[],priceLine:[],parallelStraightLine:[],priceChannelLine:[],fibonacciLine:[]}}return n(t,[{key:"_loadMoreHandler",value:function(){this._more&&!this._loading&&this._loadMoreCallback&&v(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(X(this._dataList[0],"timestamp")))}},{key:"_calcRange",value:function(){this._range=Math.floor(this._totalDataSpace/this._dataSpace),this.adjustFromTo()}},{key:"_calcBarSpace",value:function(){return.75*this._dataSpace}},{key:"_calcRangDif",value:function(){return this._range-Math.floor(this._offsetRightSpace/this._dataSpace)}},{key:"_innerSetDataSpace",value:function(t){return!(!t||2>t||t>30||this._dataSpace===t)&&(this._dataSpace=t,this._barSpace=this._calcBarSpace(),this._calcRange(),!0)}},{key:"styleOptions",value:function(){return this._styleOptions}},{key:"applyStyleOptions",value:function(t){_(this._styleOptions,t)}},{key:"technicalIndicatorParamOptions",value:function(){return this._technicalIndicatorParamOptions}},{key:"applyTechnicalIndicatorParams",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this._technicalIndicatorParamOptions.hasOwnProperty(t)&&(this._technicalIndicatorParamOptions[t]=e)}},{key:"precisionOptions",value:function(){return this._precisionOptions}},{key:"setTimezone",value:function(t){this._timezone=t}},{key:"timezone",value:function(){return this._timezone}},{key:"applyPrecision",value:function(t,e){!t&&0!==t||0>t||(this._precisionOptions.price=t,this._precisionOptions[R.MA]=t,this._precisionOptions[R.BOLL]=t,this._precisionOptions[R.SAR]=t),!e&&0!==e||0>e||(this._precisionOptions.volume=e,this._precisionOptions[R.VOL]=e)}},{key:"calcTechnicalIndicator",value:function(t){if(t===R.NO)return!0;var e=N[t];return!!e&&(this._dataList=e(this._dataList,this._technicalIndicatorParamOptions[t]),!0)}},{key:"dataList",value:function(){return this._dataList}},{key:"clearDataList",value:function(){this._more=!0,this._loading=!0,this._dataList=[],this._from=0,this._to=0}},{key:"addData",value:function(t,e,i){if(p(t))if(d(t))if(0===this._dataList.length){this._loading=!1,this._more="boolean"!=typeof i||i,this._dataList=t.concat(this._dataList);var a=this._calcRangDif();this._from=this._dataList.length-a,this.adjustFromTo()}else this._loading=!1,this._more=i,this._dataList=t.concat(this._dataList),this._from+=t.length,this.adjustFromTo();else if(er&&(this._from+=1)}}else this._calcRangDif()>this._dataList.length?this._to=this._dataList.length:(this._from+=1,this._to+=1)}}},{key:"dataSpace",value:function(){return this._dataSpace}},{key:"barSpace",value:function(){return this._barSpace}},{key:"setDataSpace",value:function(t){this._innerSetDataSpace(t)&&this._invalidateHandler()}},{key:"setTotalDataSpace",value:function(t){this._totalDataSpace!==t&&(this._totalDataSpace=t,this._calcRange())}},{key:"setOffsetRightSpace",value:function(t){0>t&&(t=0),this._offsetRightSpace=t}},{key:"from",value:function(){return this._from}},{key:"to",value:function(){return this._to}},{key:"range",value:function(){return this._range}},{key:"crossHairPoint",value:function(){return this._crossHairPoint}},{key:"crossHairSeriesTag",value:function(){return this._crossHairSeriesTag}},{key:"setCrossHairSeriesTag",value:function(t){this._crossHairSeriesTag=t,this._invalidateHandler(U)}},{key:"setCrossHairPoint",value:function(t){this._crossHairPoint=t}},{key:"startDrag",value:function(){this._preFrom=this._from}},{key:"drag",value:function(t){if(Math.abs(t)>=this._dataSpace/2){var e=t/this._dataSpace;if(0!==(e=0>e?Math.floor(e):Math.ceil(e))){if(e>0){if(0===this._from)return this._loadMoreHandler(X(this._dataList[0],"timestamp")),void this._invalidateHandler(U)}else{var i=this._calcRangDif();if(this._from===this._dataList.length-i)return void this._invalidateHandler(U)}this._from=this._preFrom-e,this.adjustFromTo(),0===this._from&&this._loadMoreHandler(),this._invalidateHandler()}else this._loadMoreHandler()}}},{key:"zoom",value:function(t){this._innerSetDataSpace(this._dataSpace+t*(this._dataSpace/10))&&this._invalidateHandler()}},{key:"adjustFromTo",value:function(){var t=this._dataList.length,e=this._calcRangDif();this._from>t-e&&(this._from=t-e),0>this._from&&(this._from=0),this._to=this._from+this._range,this._to>t&&(this._to=t)}},{key:"graphicMarkType",value:function(){return this._graphicMarkType}},{key:"setGraphicMarkType",value:function(t){this._graphicMarkType=t}},{key:"dragGraphicMarkFlag",value:function(){return this._dragGraphicMarkFlag}},{key:"setDragGraphicMarkFlag",value:function(t){this._dragGraphicMarkFlag=t}},{key:"graphicMarkPoint",value:function(){return this._graphicMarkPoint}},{key:"setGraphicMarkPoint",value:function(t){this._graphicMarkPoint=t}},{key:"graphicMarkData",value:function(){return this._graphicMarkDatas}},{key:"setGraphicMarkData",value:function(t){this._graphicMarkDatas=t,this._invalidateHandler(q)}},{key:"loadMore",value:function(t){this._loadMoreCallback=t}}]),t}();function tt(t){return(window.devicePixelRatio||1)/(t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function et(t,e){return t.measureText(e).width}function it(t){return"".concat(t,"px Arial")}function at(t,e,i,a){t.beginPath();var n=t.lineWidth%2?.5:0;t.moveTo(i,e+n),t.lineTo(a,e+n),t.stroke(),t.closePath()}function nt(t,e,i,a){t.beginPath();var n=t.lineWidth%2?.5:0;t.moveTo(e+n,i),t.lineTo(e+n,a),t.stroke(),t.closePath()}function rt(t,e){t.save(),t.lineWidth%2&&t.translate(.5,.5),e(),t.restore()}var st=function(){function t(e){i(this,t),this._container=e.container,this._chartData=e.chartData,this._width=-1,this._height=-1,this._initBefore(e),this._initElement(),this._mainWidget=this._createMainWidget(this._mainWidgetCell,e),this._yAxisWidget=this._createYAxisWidget(this._yAxisWidgetCell,e)}return n(t,[{key:"_initBefore",value:function(t){}},{key:"_initElement",value:function(){this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.position="relative",this._element.style.overflow="hidden",this._element.style.width="100%",this._mainWidgetCell=this._createCell(),this._yAxisWidgetCell=this._createCell(),this._element.appendChild(this._mainWidgetCell),this._element.appendChild(this._yAxisWidgetCell);var t=this._container.lastChild;t?this._container.insertBefore(this._element,t):this._container.appendChild(this._element)}},{key:"_createCell",value:function(){var t=document.createElement("div");return t.style.display="table-cell",t.style.position="absolute",t.style.margin="0",t.style.padding="0",t.style.top="0",t.style.zIndex="1",t}},{key:"_createMainWidget",value:function(t,e){}},{key:"_createYAxisWidget",value:function(t,e){}},{key:"_setCellSize",value:function(t,e){t.style.left="".concat(e.left,"px"),t.style.width="".concat(e.width,"px"),t.style.height="".concat(e.height,"px")}},{key:"_computeAxis",value:function(){}},{key:"width",value:function(){return this._element.offsetWidth}},{key:"height",value:function(){return this._height}},{key:"setTempHeight",value:function(t){this._height=t}},{key:"setSize",value:function(t,e){this._height=t.height,this._element.style.height="".concat(t.height,"px"),this._setCellSize(this._mainWidgetCell,t),this._setCellSize(this._yAxisWidgetCell,e),this._mainWidget.setSize(t.width,this._height),this._yAxisWidget&&this._yAxisWidget.setSize(e.width,e.height)}},{key:"invalidate",value:function(t){t===J&&this._computeAxis(),t!==q&&this._yAxisWidget&&this._yAxisWidget.invalidate(t),this._mainWidget.invalidate(t)}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=tt(a),r=this._element.offsetWidth,s=this._element.offsetHeight;i.style.width="".concat(r,"px"),i.style.height="".concat(s,"px"),i.width=r*n,i.height=s*n,a.scale(n,n);var o=this._mainWidgetCell.offsetWidth,c=this._mainWidgetCell.offsetHeight,h=parseInt(this._mainWidgetCell.style.left),l=this._yAxisWidgetCell.offsetWidth,_=this._yAxisWidgetCell.offsetHeight,u=parseInt(this._yAxisWidgetCell.style.left);return a.drawImage(this._mainWidget.getImage(t,e),h,0,o,c),this._yAxisWidget&&a.drawImage(this._yAxisWidget.getImage(t),u,0,l,_),i}},{key:"destroy",value:function(){this._container.removeChild(this._element)}}]),t}(),ot=function(){function t(e){i(this,t),this._width=0,this._height=0,this._initElement(e.container),this._mainView=this._createMainView(this._element,e),this._expandView=this._createExpandView(this._element,e),this._floatLayerView=this._createFloatLayerView(this._element,e)}return n(t,[{key:"_initElement",value:function(t){this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.width="100%",this._element.style.height="100%",this._element.style.position="relative",this._element.style.overflow="hidden",t.appendChild(this._element)}},{key:"_createMainView",value:function(t,e){}},{key:"_createExpandView",value:function(t,e){}},{key:"_createFloatLayerView",value:function(t,e){}},{key:"setSize",value:function(t,e){this._width=t,this._height=e,this._mainView.setSize(t,e),this._floatLayerView.setSize(t,e)}},{key:"invalidate",value:function(t){switch(t){case U:this._floatLayerView.flush();break;case J:this._mainView.flush(),this._floatLayerView.flush()}}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=tt(a);return i.style.width="".concat(this._width,"px"),i.style.height="".concat(this._height,"px"),i.width=this._width*n,i.height=this._height*n,a.scale(n,n),a.drawImage(this._mainView.getImage(),0,0,this._width,this._height),e&&this._expandView&&a.drawImage(this._expandView.getImage(),0,0,this._width,this._height),t&&a.drawImage(this._floatLayerView.getImage(),0,0,this._width,this._height),i}}]),t}();var ct=function(){function t(e,a){i(this,t),this._chartData=a,this._initCanvas(e)}return n(t,[{key:"_initCanvas",value:function(t){this._canvas=document.createElement("canvas"),this._canvas.style.position="absolute",this._canvas.style.right="0",this._canvas.style.left="0",this._canvas.style.zIndex="2",this._ctx=this._canvas.getContext("2d"),t.appendChild(this._canvas)}},{key:"_redraw",value:function(t){this._ctx.clearRect(0,0,this._width,this._height),t&&t(),this._draw()}},{key:"_draw",value:function(){}},{key:"setSize",value:function(t,e){var i=this;this._width===t&&this._height===e||this._redraw((function(){var a=tt(i._ctx);i._width=t,i._height=e,i._canvas.style.top="0",i._canvas.style.width="".concat(t,"px"),i._canvas.style.height="".concat(e,"px"),i._canvas.width=t*a,i._canvas.height=e*a,i._ctx.scale(a,a)}))}},{key:"flush",value:function(){var t,e,i=this;this.requestAnimationId&&(t=this.requestAnimationId,window.cancelAnimationFrame||clearTimeout(t),window.cancelAnimationFrame(t)),this.requestAnimationId=(e=function(){i._redraw()},window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout((function(){e()}),1e3/60))}},{key:"getImage",value:function(){return this._canvas}}]),t}(),ht=function(t){function e(t,a,n,r,s){var c;return i(this,e),(c=h(this,o(e).call(this,t,a)))._xAxis=n,c._yAxis=r,c._additionalDataProvider=s,c}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawGrid(),this._drawTechnicalIndicator()}},{key:"_drawGrid",value:function(){var t=this,e=this._chartData.styleOptions().grid;if(e.display){var i=e.horizontal;i.display&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,i.style===g&&this._ctx.setLineDash(i.dashValue),this._yAxis.ticks().forEach((function(e){at(t._ctx,e.y,0,t._width)})));var a=e.vertical;a.display&&(this._ctx.strokeStyle=a.color,this._ctx.lineWidth=a.size,this._ctx.setLineDash(a.style===g?a.dashValue:[]),this._xAxis.ticks().forEach((function(e){nt(t._ctx,e.x,0,t._height)}))),this._ctx.setLineDash([])}}},{key:"_drawTechnicalIndicator",value:function(){var t,e=this,i=this._additionalDataProvider.technicalIndicatorType(),a=this._chartData.technicalIndicatorParamOptions()[i]||[],n=[],r=this._chartData.styleOptions().technicalIndicator;switch(i){case R.MA:var s=[];a.forEach((function(t){s.push("ma".concat(t))})),t=function(t,a,o,c){e._ohlcTechnicalIndicatorDrawing(a,t,c,r,o,i,s,e._yAxis.isCandleStickYAxis(),(function(i){e._prepareLinePoints(t,i,n)}))};break;case R.MACD:var o=this._chartData.dataList();t=function(t,i,a,s){var c=a.macd||{};e._prepareLinePoints(t,[c.diff,c.dea],n);var h=c.macd,l=((o[i-1]||{}).macd||{}).macd||-1/0;h>0?(e._ctx.strokeStyle=r.bar.upColor,e._ctx.fillStyle=r.bar.upColor):0>h?(e._ctx.strokeStyle=r.bar.downColor,e._ctx.fillStyle=r.bar.downColor):(e._ctx.strokeStyle=r.bar.noChangeColor,e._ctx.fillStyle=r.bar.noChangeColor),e._drawBars(t,s,h,!((l||0===l)&&h>l))};break;case R.VOL:var c=this._chartData.dataList();t=function(t,i,s,o){var h=s.vol||{},l=[];a.forEach((function(t){l.push(h["ma".concat(t)])})),e._prepareLinePoints(t,l,n);var _=s.close,u=(c[i-1]||{}||{}).close||_;e._ctx.fillStyle=_>u?r.bar.upColor:u>_?r.bar.downColor:r.bar.noChangeColor,e._drawBars(t,o,h.num,!0)};break;case R.BOLL:t=function(t,a,s,o){e._ohlcTechnicalIndicatorDrawing(a,t,o,r,s,i,["up","mid","dn"],e._yAxis.isCandleStickYAxis(),(function(i){e._prepareLinePoints(t,i,n)}))};break;case R.BIAS:t=function(t,i,r){var s=r.bias||{},o=[];a.forEach((function(t){o.push(s["bias".concat(t)])})),e._prepareLinePoints(t,o,n)};break;case R.BRAR:t=function(t,i,a){var r=a.brar||{};e._prepareLinePoints(t,[r.br,r.ar],n)};break;case R.CCI:t=function(t,i,a){e._prepareLinePoints(t,[(a.cci||{}).cci],n)};break;case R.CR:t=function(t,i,a){var r=a.cr||{};e._prepareLinePoints(t,[r.cr,r.ma1,r.ma2,r.ma3,r.ma4],n)};break;case R.DMA:t=function(t,i,a){var r=a.dma||{};e._prepareLinePoints(t,[r.dif,r.difMa],n)};break;case R.DMI:t=function(t,i,a){var r=a.dmi||{};e._prepareLinePoints(t,[r.mdi,r.pdi,r.adx,r.adxr],n)};break;case R.KDJ:t=function(t,i,a){var r=a.kdj||{};e._prepareLinePoints(t,[r.k,r.d,r.j],n)};break;case R.RSI:t=function(t,i,r){var s=r.rsi||{},o=[];a.forEach((function(t){o.push(s["rsi".concat(t)])})),e._prepareLinePoints(t,o,n)};break;case R.PSY:t=function(t,i,a){e._prepareLinePoints(t,[(a.psy||{}).psy],n)};break;case R.TRIX:t=function(t,i,a){var r=a.trix||{};e._prepareLinePoints(t,[r.trix,r.maTrix],n)};break;case R.OBV:t=function(t,i,a){var r=a.obv||{};e._prepareLinePoints(t,[r.obv,r.maObv],n)};break;case R.VR:t=function(t,i,a){var r=a.vr||{};e._prepareLinePoints(t,[r.vr,r.maVr],n)};break;case R.WR:t=function(t,i,a){var r=a.wr||{};e._prepareLinePoints(t,[r.wr1,r.wr2,r.wr3],n)};break;case R.MTM:t=function(t,i,a){var r=a.mtm||{};e._prepareLinePoints(t,[r.mtm,r.mtmMa],n)};break;case R.EMV:t=function(t,i,a){var r=a.emv||{};e._prepareLinePoints(t,[r.emv,r.maEmv],n)};break;case R.SAR:t=function(t,a,n,s){e._ohlcTechnicalIndicatorDrawing(a,t,s,r,n,i,["sar"],e._yAxis.isCandleStickYAxis(),(function(i){var a=i[0];if(a||0===a){var o=e._yAxis.convertToPixel(a);e._ctx.strokeStyle=(n.high+n.low)/2>a?r.bar.upColor:r.bar.downColor,e._ctx.beginPath(),e._ctx.arc(t,o,s,2*Math.PI,0,!0),e._ctx.stroke(),e._ctx.closePath()}}))}}this._drawGraphics(t,(function(){e._drawLines(n,r)}))}},{key:"_ohlcTechnicalIndicatorDrawing",value:function(t,e,i,a,n,r,s,o,c){var h=n[r.toLowerCase()]||{},l=[];s.forEach((function(t){l.push(h[t])})),c&&c(l);var _=this._chartData.dataList();o||this._drawOhlc(i,e,n,_[t-1]||{},a.bar.upColor,a.bar.downColor,a.bar.noChangeColor)}},{key:"_prepareLinePoints",value:function(t,e,i){for(var a=0;e.length>a;a++){var n=this._yAxis.convertToPixel(e[a]);i[a]?i[a].push({x:t,y:n}):i[a]=[{x:t,y:n}]}}},{key:"_drawLines",value:function(t,e){var i=this,a=e.line.colors,n=t.length,r=(a||[]).length;this._ctx.lineWidth=e.line.size,rt(this._ctx,(function(){for(var e=0;n>e;e++){var s=t[e];if(s.length>0){i._ctx.strokeStyle=a[e%r],i._ctx.beginPath(),i._ctx.moveTo(s[0].x,s[0].y);for(var o=1;s.length>o;o++)i._ctx.lineTo(s[o].x,s[o].y);i._ctx.stroke(),i._ctx.closePath()}}}))}},{key:"_drawBars",value:function(t,e,i,a){if(i||0===i){this._ctx.lineWidth=1;var n=this._yAxis.convertToPixel(i),r=this._yAxis.convertToPixel(0),s=n;0>i&&(s=r);var o=Math.abs(r-n);1>o&&(o=1,s=0>i?s+1:s-1),a?this._ctx.fillRect(t-e,s,2*e,o):this._ctx.strokeRect(t-e,s,2*e,o)}}},{key:"_drawOhlc",value:function(t,e,i,a,n,r,s){var o=i.close,c=this._yAxis.convertToPixel(i.open),h=this._yAxis.convertToPixel(o),l=this._yAxis.convertToPixel(i.high),_=this._yAxis.convertToPixel(i.low),u=(a||{}).close||o;this._ctx.strokeStyle=o>u?n:u>o?r:s,this._ctx.lineWidth=1,this._ctx.beginPath(),this._ctx.moveTo(e,l),this._ctx.lineTo(e,_),this._ctx.stroke(),this._ctx.closePath(),this._ctx.beginPath(),this._ctx.moveTo(e-t,c),this._ctx.lineTo(e,c),this._ctx.stroke(),this._ctx.closePath(),this._ctx.beginPath(),this._ctx.moveTo(e,h),this._ctx.lineTo(e+t,h),this._ctx.stroke(),this._ctx.closePath()}},{key:"_drawGraphics",value:function(t,e){for(var i=0,a=this._chartData.dataList(),n=this._chartData.barSpace(),r=this._chartData.dataSpace(),s=n/2,o=this._chartData.to(),c=this._chartData.from();o>c;c++){t&&t((i+(i+n))/2,c,a[c],s,n),i+=r}e&&e()}}]),e}(ct),lt=function(t){function e(t,a,n,r,s){var c;return i(this,e),(c=h(this,o(e).call(this,t,a)))._xAxis=n,c._yAxis=r,c._additionalDataProvider=s,c}return s(e,t),n(e,[{key:"_draw",value:function(){var t,e=this._chartData.crossHairPoint();t=e?this._xAxis.convertFromPixel(e.x):this._chartData.dataList().length-1;var i=this._chartData.dataList()[t],a=this._xAxis.convertToPixel(t);this._drawCrossHairHorizontalLine(),this._drawCrossHairVerticalLine(i,a);var n=this._chartData.styleOptions().floatLayer.prompt.displayRule;(n===I||n===b&&this._chartData.crossHairSeriesTag())&&this._drawPrompt(i,a)}},{key:"_drawPrompt",value:function(t,e){this._drawTechnicalIndicatorPrompt(t,e)}},{key:"_drawCrossHairHorizontalLine",value:function(){if(this._chartData.crossHairSeriesTag()===this._additionalDataProvider.tag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.horizontal,i=e.line;if(t.display&&e.display&&i.display){var a=this._chartData.crossHairPoint();a&&(this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color,i.style===g&&this._ctx.setLineDash(i.dashValue),at(this._ctx,a.y,0,this._width),this._ctx.setLineDash([]))}}}},{key:"_drawCrossHairVerticalLine",value:function(t,e){if(this._chartData.crossHairSeriesTag()){var i=this._chartData.styleOptions().floatLayer.crossHair,a=i.vertical,n=a.line;i.display&&a.display&&n.display&&t&&(this._ctx.lineWidth=n.size,this._ctx.strokeStyle=n.color,n.style===g&&this._ctx.setLineDash(n.dashValue),nt(this._ctx,e,0,this._height),this._ctx.setLineDash([]))}}},{key:"_drawTechnicalIndicatorPrompt",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=this._chartData.styleOptions().technicalIndicator,n=this._getTechnicalIndicatorPromptData(t),r=a.line.colors;this._drawTechnicalIndicatorPromptText(n,r,i),this._drawTechnicalIndicatorPromptPoint(n.values,r,e)}},{key:"_drawTechnicalIndicatorPromptText",value:function(t,e,i){var a=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.text,n=t.name,r=t.labels,s=t.values,o=a.marginLeft,c=a.marginRight,h=o,l=a.marginTop+i,_=a.size,u=a.color,d=e.length;this._ctx.textBaseline="top",this._ctx.font=it(_);var v=et(this._ctx,n);this._ctx.fillStyle=u,this._ctx.fillText(n,h,l),h+=o+v;for(var p=0;r.length>p;p++){var f="".concat(r[p].toUpperCase(),": ").concat(s[p]||"--"),y=et(this._ctx,f);this._ctx.fillStyle=e[p%d]||u,this._ctx.fillText(f,h,l),h+=o+c+y}}},{key:"_drawTechnicalIndicatorPromptPoint",value:function(t,e,i){var a=this._additionalDataProvider.technicalIndicatorType();if(this._chartData.crossHairSeriesTag()&&a!==R.SAR)for(var n=e.length,r=a===R.MACD||a===R.VOL?t.length-1:t.length,s=0;r>s;s++){var o=t[s];if(o||0===o){var c=this._yAxis.convertToPixel(o);this._ctx.fillStyle=e[s%n],this._ctx.beginPath(),this._ctx.arc(i,c,3,0,2*Math.PI),this._ctx.closePath(),this._ctx.fill()}}}},{key:"_getTechnicalIndicatorPromptData",value:function(t){var e=this._additionalDataProvider.technicalIndicatorType(),i=this._chartData.technicalIndicatorParamOptions()[e]||[],a=[],n=[];switch(e){case R.MA:i.forEach((function(t){n.push("ma".concat(t))}));break;case R.VOL:i.forEach((function(t){n.push("ma".concat(t))})),n.push("num");break;case R.MACD:n=["diff","dea","macd"];break;case R.BOLL:n=["up","mid","dn"];break;case R.BIAS:i.forEach((function(t){n.push("bias".concat(t))}));break;case R.BRAR:n=["br","ar"];break;case R.CCI:n=["cci"];break;case R.CR:n=["cr","ma1","ma2","ma3","ma4"];break;case R.DMA:n=["dif","difMa"];break;case R.DMI:n=["mdi","pdi","adx","adxr"];break;case R.KDJ:n=["k","d","j"];break;case R.RSI:i.forEach((function(t){n.push("rsi".concat(t))}));break;case R.PSY:n=["psy"];break;case R.TRIX:n=["trix","maTrix"];break;case R.OBV:n=["obv","maObv"];break;case R.VR:n=["vr","maVr"];break;case R.WR:n=["wr1","wr2","wr3"];break;case R.MTM:n=["mtm","mtmMa"];break;case R.EMV:n=["emv","maEmv"];break;case R.SAR:n=["sar"]}var r="";if(n.length>0){r="".concat(e),i&&d(i)&&i.length>0&&(r="".concat(r,"(").concat(i.join(","),")"));var s=X(t,e.toLowerCase());n.forEach((function(t){a.push(X(s,t))}));var o=this._chartData.precisionOptions()[e];a.forEach((function(t,e){a[e]=Z(t,o)}))}return{labels:n,values:a,name:r}}}]),e}(ct),_t=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new ht(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createFloatLayerView",value:function(t,e){return new lt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}}]),e}(ot),ut=function(t){function e(t,a,n){var r;return i(this,e),(r=h(this,o(e).call(this,t,a)))._yAxis=n,r}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().yAxis;t.display&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t),this._drawLastPriceLabel(t))}},{key:"_drawAxisLine",value:function(t){var e,i=t.axisLine;i.display&&(this._ctx.strokeStyle=i.color,this._ctx.lineWidth=i.size,e=this._isDrawFromStart(t)?0:this._width,nt(this._ctx,e,0,this._height))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.display){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var a,n,r=i.length;this._isDrawFromStart(t)?(a=0,t.axisLine.display&&(a+=t.axisLine.size),n=a+r):(a=this._width,t.axisLine.display&&(a-=t.axisLine.size),n=a-r),this._yAxis.ticks().forEach((function(t){at(e._ctx,t.y,a,n)}))}}},{key:"_drawTickLabels",value:function(t){var e=this,i=t.tickText;if(i.display){var a,n=t.tickLine,r=n.display,s=n.length,o=i.margin;this._isDrawFromStart(t)?(a=o,t.axisLine.display&&(a+=t.axisLine.size),r&&(a+=s),this._ctx.textAlign="left"):(a=this._width-o,t.axisLine.display&&(a-=t.axisLine.size),r&&(a-=s),this._ctx.textAlign="right");var c=i.size;this._ctx.textBaseline="middle",this._ctx.font=it(c),this._ctx.fillStyle=i.color,this._yAxis.ticks().forEach((function(t){var i,n=f(+(i=t.v))?i>5e4?"".concat(+(i/1e3).toFixed(1),"K"):i>5e6?"".concat(+(i/1e6).toFixed(3),"M"):"".concat(i):"--";e._ctx.fillText(n,a,t.y)})),this._ctx.textAlign="left"}}},{key:"_drawLastPriceLabel",value:function(t){if(this._yAxis.isCandleStickYAxis()){var e=this._chartData.styleOptions().candleStick.priceMark,i=e.last,a=this._chartData.dataList(),n=a.length;if(e.display&&i.display&&i.text.display&&0!==n){var r,s=a[n-1].close,o=(a[n-2]||{}).close||s,c=this._yAxis.convertToPixel(s);c=+Math.max(.05*this._height,Math.min(c,.98*this._height)).toFixed(0),r=s>o?i.upColor:o>s?i.downColor:i.noChangeColor;var h=i.text,l=Z(s,this._chartData.precisionOptions().price),_=i.text.size;this._ctx.font=it(_);var u,d=et(this._ctx,l)+h.paddingLeft+h.paddingRight,v=h.paddingTop+_+h.paddingBottom;u=this._isDrawFromStart(t)?0:this._width-d,this._ctx.fillStyle=r,this._ctx.fillRect(u,c-h.paddingTop-_/2,d,v),this._ctx.fillStyle=h.color,this._ctx.textBaseline="middle",this._ctx.fillText(l,u+h.paddingLeft,c)}}}},{key:"_isDrawFromStart",value:function(t){return t.position===m&&t.tickText.position===D||t.position===k&&t.tickText.position===M}}]),e}(ct),dt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._axis=n,s._additionalDataProvider=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawCrossHairLabel()}},{key:"_drawCrossHairLabel",value:function(){}}]),e}(ct),vt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_drawCrossHairLabel",value:function(){if(this._chartData.crossHairSeriesTag()===this._additionalDataProvider.tag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.horizontal,i=e.text;if(t.display&&e.display&&i.display){var a=this._chartData.crossHairPoint();if(a){var n=Z(this._axis.convertFromPixel(a.y),this._chartData.precisionOptions()[this._axis.isCandleStickYAxis()?"price":this._additionalDataProvider.technicalIndicatorType()]),r=i.size;this._ctx.font=it(r);var s,o=et(this._ctx,n),c=i.paddingLeft,h=i.paddingTop,l=i.borderSize,_=o+2*l+c+i.paddingRight,u=r+2*l+h+i.paddingBottom,d=this._chartData.styleOptions().yAxis;s=d.position===m&&d.tickText.position===D||d.position===k&&d.tickText.position===M?0:this._width-_;var v=a.y-l-h-r/2;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(s,v,_,u),this._ctx.lineWidth=l,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(s,v,_,u),this._ctx.textBaseline="middle",this._ctx.fillStyle=i.color,this._ctx.fillText(n,s+l+c,a.y)}}}}}]),e}(dt),pt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new ut(t,e.chartData,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new vt(t,e.chartData,e.yAxis,e.additionalDataProvider)}}]),e}(ot),ft=function(){function t(e){i(this,t),this._chartData=e,this._width=0,this._height=0,this._minValue=0,this._maxValue=0,this._range=0,this._ticks=[]}return n(t,[{key:"setSize",value:function(t,e){this._width=t,this._height=e}},{key:"ticks",value:function(){return this._ticks}},{key:"computeAxis",value:function(){var t=this._computeMinMaxValue(),e=t.max,i=t.range;this._minValue=t.min,this._maxValue=e,this._range=i,this._ticks=this._computeOptimalTicks(this._computeTicks())}},{key:"_computeMinMaxValue",value:function(){}},{key:"_computeOptimalTicks",value:function(t){}},{key:"_computeTicks",value:function(){var t=[];if(this._range>=0){var e=+this._nice(this._range/8),i=this._getIntervalPrecision(e),a=+this._round(Math.ceil(this._minValue/e)*e,i),n=+this._round(Math.floor(this._maxValue/e)*e,i),r=0,s=a;if(0!==e)for(;+n>=s;)++r,s+=e;s=a;for(var o=0;r>o;o++)t[o]={v:s.toFixed(i)},s+=e}return t}},{key:"_nice",value:function(t){var e=Math.floor(Math.log(t)/Math.log(10)),i=Math.pow(10,e),a=t/i;return t=(1>a?1:2>a?2:3>a?3:5>a?5:10)*i,-20>e?t:+t.toFixed(0>e?-e:0)}},{key:"_getIntervalPrecision",value:function(t){var e=""+t,i=e.indexOf("e");if(i>0){var a=+e.slice(i+1);return 0>a?-a:0}var n=e.indexOf(".");return 0>n?0:e.length-1-n}},{key:"_round",value:function(t,e){return null==e&&(e=10),t=(+t).toFixed(e=Math.min(Math.max(0,e),20))}}]),t}(),yt="candle_stick",xt="technical_indicator",gt=function(t){function e(t,a){var n;return i(this,e),(n=h(this,o(e).call(this,t)))._yAxisType=a,n}return s(e,t),n(e,[{key:"_compareMinMax",value:function(t,e,i){var a=X(t,e.toLowerCase(),{});return Object.keys(a).forEach((function(t){var e=a[t];(e||0===e)&&(i[0]=Math.min(i[0],e),i[1]=Math.max(i[1],e))})),e!==R.BOLL&&e!==R.SAR||(i[0]=Math.min(i[0],t.low),i[1]=Math.max(i[1],t.high)),i}},{key:"_computeMinMaxValue",value:function(){var t=this._minValue,e=this._maxValue;if(t===1/0||e===-1/0)return{min:0,max:0,range:0};var i=Math.abs(e-t);return 0===i&&(i=Math.abs((e+=1)-t)),{min:t-=i/100*10,max:e+=i/100*20,range:i=Math.abs(e-t)}}},{key:"_computeOptimalTicks",value:function(t){var e=[],i=t.length;if(i>0){var a=this._chartData.styleOptions().xAxis.tickText.size,n=this.convertToPixel(+t[0].v),r=1;if(i>1){var s=this.convertToPixel(+t[1].v),o=Math.abs(s-n);2*a>o&&(r=Math.ceil(2*a/o))}for(var c=0;i>c;c+=r){var h=t[c].v,l=this.convertToPixel(+h);l>a&&this._height-a>l&&e.push({v:h,y:l})}}return e}},{key:"calcMinMaxValue",value:function(t,e){var i=this._chartData.dataList(),a=this._chartData.from(),n=this._chartData.to(),r=this._chartData.styleOptions().realTime.averageLine.display,s=[1/0,-1/0];if(e)for(var o=a;n>o;o++){var c=i[o],h=[c.close,s[0]],l=[c.close,s[1]];r&&(h.push(c.average),l.push(c.average)),s[0]=Math.min.apply(null,h),s[1]=Math.max.apply(null,l)}else{for(var _=a;n>_;_++){var u=i[_];this._compareMinMax(u,t,s),this.isCandleStickYAxis()&&(s[0]=Math.min(u.low,s[0]),s[1]=Math.max(u.high,s[1]))}t===R.VOL&&(s[0]=0)}s[0]!==1/0&&s[1]!==-1/0&&(this._minValue=s[0],this._maxValue=s[1])}},{key:"isCandleStickYAxis",value:function(){return this._yAxisType===yt}},{key:"convertFromPixel",value:function(t){return(1-t/this._height)*this._range+this._minValue}},{key:"convertToPixel",value:function(t){return Math.round((1-(t-this._minValue)/this._range)*this._height)}}]),e}(ft),mt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._technicalIndicatorType=t.technicalIndicatorType||R.MACD,a._calcTechnicalIndicator(),a}return s(e,t),n(e,[{key:"_initBefore",value:function(t){this._tag=t.tag,this._yAxis=this._createYAxis(t)}},{key:"_createYAxis",value:function(t){return new gt(t.chartData,xt)}},{key:"_createMainWidget",value:function(t,e){return new _t({container:t,chartData:e.chartData,xAxis:e.xAxis,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),tag:this.tag.bind(this)}})}},{key:"_createYAxisWidget",value:function(t,e){return new pt({container:t,chartData:e.chartData,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),tag:this.tag.bind(this)}})}},{key:"_computeAxis",value:function(){this._yAxis.calcMinMaxValue(this._technicalIndicatorType,this._isRealTime()),this._yAxis.computeAxis()}},{key:"_isRealTime",value:function(){return!1}},{key:"_calcTechnicalIndicator",value:function(){this._chartData.calcTechnicalIndicator(this._technicalIndicatorType)&&this.invalidate(J)}},{key:"tag",value:function(){return this._tag}},{key:"setSize",value:function(t,i){this._yAxis.setSize(i.width,i.height),this._computeAxis(),l(o(e.prototype),"setSize",this).call(this,t,i)}},{key:"yAxis",value:function(){return this._yAxis}},{key:"technicalIndicatorType",value:function(){return this._technicalIndicatorType}},{key:"setTechnicalIndicatorType",value:function(t){this._technicalIndicatorType!==t&&(this._technicalIndicatorType=t,this._calcTechnicalIndicator())}}]),e}(st),kt=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawGrid(),this._additionalDataProvider.chartType()===w.REAL_TIME?this._drawRealTime():(this._drawCandleStick(),this._drawTechnicalIndicator(),this._drawHighestPriceMark(),this._drawLowestPriceMark()),this._drawLastPriceLine()}},{key:"_drawRealTime",value:function(){var t=this,e=[],i=[{x:0,y:this._height}],a=[],n=this._chartData.from(),r=this._chartData.range(),s=this._chartData.to();this._drawGraphics((function(r,s,o){var c=o.average,h=t._yAxis.convertToPixel(o.close),l=t._yAxis.convertToPixel(c);e.push({x:r,y:h}),(c||0===c)&&a.push({x:r,y:l}),s===n&&i.push({x:0,y:h}),i.push({x:r,y:h})}),(function(){var o=i.length;if(o>0){var c=i[o-1];!(r>n-s)?(i.push({x:t._width,y:c.y}),i.push({x:t._width,y:t._height})):i.push({x:c.x,y:t._height})}var h=t._chartData.styleOptions().realTime,l=h.timeLine;if(e.length>0&&(t._ctx.lineWidth=l.size,t._ctx.strokeStyle=l.color,rt(t._ctx,(function(){t._ctx.beginPath(),t._ctx.moveTo(e[0].x,e[0].y);for(var i=1;e.length>i;i++)t._ctx.lineTo(e[i].x,e[i].y);t._ctx.stroke(),t._ctx.closePath()}))),i.length>0){t._ctx.fillStyle=l.areaFillColor,t._ctx.beginPath(),t._ctx.moveTo(i[0].x,i[0].y);for(var _=1;i.length>_;_++)t._ctx.lineTo(i[_].x,i[_].y);t._ctx.closePath(),t._ctx.fill()}var u=h.averageLine;u.display&&a.length>0&&(t._ctx.lineWidth=u.size,t._ctx.strokeStyle=u.color,rt(t._ctx,(function(){t._ctx.beginPath(),t._ctx.moveTo(a[0].x,a[0].y);for(var e=1;a.length>e;e++)t._ctx.lineTo(a[e].x,a[e].y);t._ctx.stroke(),t._ctx.closePath()})))}))}},{key:"_drawCandleStick",value:function(){var t=this;this._ctx.lineWidth=1;var e=[],i=-1/0,a=-1,n=1/0,r=-1,s=this._chartData.dataList(),o=this._chartData.styleOptions().candleStick;this._drawGraphics((function(c,h,l,_,u){var d=l.close,v=s[h-1]||{},p=v.close||d,f=l.high,y=l.low,x=l.open;if(f>i&&(i=f,a=c),n>y&&(n=y,r=c),d>p?(t._ctx.strokeStyle=o.bar.upColor,t._ctx.fillStyle=o.bar.upColor):p>d?(t._ctx.strokeStyle=o.bar.downColor,t._ctx.fillStyle=o.bar.downColor):(t._ctx.strokeStyle=o.bar.noChangeColor,t._ctx.fillStyle=o.bar.noChangeColor),o.bar.style!==A){var g=t._yAxis.convertToPixel(x),m=t._yAxis.convertToPixel(d),k=t._yAxis.convertToPixel(f),D=t._yAxis.convertToPixel(y),M=[],w=[];switch(M[0]=k,w[1]=D,g>m?(M[1]=m,w[0]=g,e=[c-_,m,u,g-m]):m>g?(M[1]=g,w[0]=m,e=[c-_,g,u,m-g]):(M[1]=g,w[0]=m,e=[c-_,g,u,1]),t._ctx.beginPath(),t._ctx.moveTo(c,M[0]),t._ctx.lineTo(c,M[1]),t._ctx.stroke(),t._ctx.closePath(),t._ctx.beginPath(),t._ctx.moveTo(c,w[0]),t._ctx.lineTo(c,w[1]),t._ctx.stroke(),t._ctx.closePath(),1>e[3]&&(e[3]=1),o.bar.style){case S:t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case T:t._ctx.strokeRect(e[0],e[1],e[2],e[3]);break;case E:d>p?t._ctx.strokeRect(e[0],e[1],e[2],e[3]):t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case L:d>p?t._ctx.fillRect(e[0],e[1],e[2],e[3]):t._ctx.strokeRect(e[0],e[1],e[2],e[3])}}else t._drawOhlc(_,c,l,v,o.bar.upColor,o.bar.downColor,o.bar.noChangeColor)})),this._highestMarkData={x:a,price:i},this._lowestMarkData={x:r,price:n}}},{key:"_drawHighestPriceMark",value:function(t){if(this._highestMarkData){var e=this._highestMarkData.price,i=this._chartData.styleOptions().candleStick.priceMark,a=i.high;e!==-1/0&&i.display&&a.display&&this._drawLowestHighestPriceMark(a,this._highestMarkData.x,e,!0,this._chartData.precisionOptions().price)}}},{key:"_drawLowestPriceMark",value:function(){if(this._lowestMarkData){var t=this._lowestMarkData.price,e=this._chartData.styleOptions().candleStick.priceMark,i=e.low;t!==1/0&&e.display&&i.display&&this._drawLowestHighestPriceMark(i,this._lowestMarkData.x,t,!1,this._chartData.precisionOptions().price)}}},{key:"_drawLowestHighestPriceMark",value:function(t,e,i,a,n){var r=this,s=this._yAxis.convertToPixel(i),o=e,c=s+(a?-2:2);this._ctx.textAlign="left",this._ctx.lineWidth=1,this._ctx.strokeStyle=t.color,this._ctx.fillStyle=t.color,rt(this._ctx,(function(){r._ctx.beginPath(),r._ctx.moveTo(o,c),r._ctx.lineTo(o-2,c+(a?-2:2)),r._ctx.stroke(),r._ctx.closePath(),r._ctx.beginPath(),r._ctx.moveTo(o,c),r._ctx.lineTo(o+2,c+(a?-2:2)),r._ctx.stroke(),r._ctx.closePath()}));var h=c+(a?-5:5);nt(this._ctx,o,c,h),at(this._ctx,h,o,o+5),this._ctx.font=it(t.textSize);var l=Z(i,n);this._ctx.textBaseline="middle",this._ctx.fillText(l,o+5+t.textMargin,h)}},{key:"_drawLastPriceLine",value:function(){var t=this._chartData.dataList(),e=t.length,i=this._chartData.styleOptions().candleStick.priceMark,a=i.last;if(i.display&&a.display&&a.line.display&&0!==e){var n=t[e-1].close,r=(t[e-2]||{}).close||n,s=this._yAxis.convertToPixel(n);s=+Math.max(.05*this._height,Math.min(s,.98*this._height)).toFixed(0);var o=a.line;this._ctx.strokeStyle=n>r?a.upColor:r>n?a.downColor:a.noChangeColor,this._ctx.lineWidth=o.size,o.style===g&&this._ctx.setLineDash(o.dashValue),at(this._ctx,s,0,this._width),this._ctx.setLineDash([])}}}]),e}(ht),Dt=function(t){function a(){return i(this,a),h(this,o(a).apply(this,arguments))}return s(a,t),n(a,[{key:"_drawPrompt",value:function(t,e){var i=this._chartData.styleOptions().floatLayer.prompt.candleStick,a=this._getCandleStickPromptData(t,i);i.showType===P?(this._drawCandleStickStandardPromptText(i,a),this._additionalDataProvider.chartType()===w.CANDLE_STICK&&this._drawTechnicalIndicatorPrompt(t,e,i.text.size+i.text.marginTop)):this._drawCandleStickRectPromptText(t,e,i,a)}},{key:"_drawCandleStickStandardPromptText",value:function(t,i){var a=this,n=i,r=t.text.marginLeft,s=t.text.marginRight,o=t.text.size,c=t.text.color,h=t.labels;this._ctx.textBaseline="top",this._ctx.font=it(o);var l=r,_=t.text.marginTop;h.forEach((function(t,i){var o=t?"".concat(t,": "):"",h=et(a._ctx,o);a._ctx.fillStyle=c,a._ctx.fillText(o,l,_),l+=h;var u,d=n[i]||"--";"object"===e(d)?(u=d.value||"--",a._ctx.fillStyle=d.color||c):(a._ctx.fillStyle=c,u=d);var v=et(a._ctx,u);a._ctx.fillText(u,l,_),l+=v+r+s}))}},{key:"_drawCandleStickRectPromptText",value:function(t,i,a,n){var r=this,s=a.labels,o=n,c=a.text.marginLeft,h=a.text.marginRight,l=a.text.marginTop,_=a.text.marginBottom,u=a.text.size,d=a.text.color;this._ctx.textBaseline="top",this._ctx.font=it(u);var v=0;s.forEach((function(t,i){var a=o[i]||"--",n=a;"object"===e(a)&&(n=a.value||"--");var s="".concat(t,": ").concat(n),l=et(r._ctx,s)+c+h;v=Math.max(v,l)}));var p=a.rect,f=p.borderSize,y=p.paddingLeft,x=p.paddingRight,g=p.paddingTop,m=p.left,k=p.right,D=2*f+g+p.paddingBottom+(_+l+u)*s.length,M=this._getTechnicalIndicatorPromptData(t),S=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator,T=S.text.marginLeft,E=S.text.marginRight,L=S.text.marginTop,A=S.text.marginBottom,I=S.text.size,b=this._additionalDataProvider.chartType()===w.CANDLE_STICK,P=M.labels||[],C=M.values||[];b&&(this._ctx.font=it(I),P.forEach((function(t,e){var i=C[e]||"--",a="".concat(t,": ").concat(i),n=et(r._ctx,a)+T+E;v=Math.max(v,n)})),D+=(L+A+I)*P.length);var R,O=2*f+v+y+x;R=this._width/2>i?this._width-k-O:m;var H=p.top,N=p.borderRadius;if(this._ctx.lineWidth=f,this._ctx.strokeStyle=p.borderColor,this._ctx.fillStyle=p.fillColor,this._drawRoundRect(R,H,O,D,N),this._ctx.stroke(),this._drawRoundRect(R,H,O,D,N),this._ctx.fill(),b){var z=R+f+y+c,G=H+f+g;this._ctx.font=it(u),s.forEach((function(t,i){G+=l,r._ctx.textAlign="left",r._ctx.fillStyle=d,r._ctx.fillText("".concat(t,": "),z,G);var a,n=o[i]||"--";r._ctx.fillStyle=n.color||d,a="object"===e(n)?n.value||"--":n,r._ctx.textAlign="right",r._ctx.fillText(a,R+O-f-h-x,G),G+=u+_}));var Y=this._chartData.styleOptions().technicalIndicator,V=Y.line.colors,F=R+f+y+T,B=V.length;this._ctx.font=it(I),P.forEach((function(t,e){G+=L,r._ctx.textAlign="left",r._ctx.fillStyle=V[e%B]||Y.text.color,r._ctx.fillText("".concat(t.toUpperCase(),": "),F,G),r._ctx.textAlign="right",r._ctx.fillText(C[e]||"--",R+O-f-E-x,G),G+=I+A}))}this._ctx.textAlign="left"}},{key:"_drawRoundRect",value:function(t,e,i,a,n){this._ctx.beginPath(),this._ctx.moveTo(t+n,e),this._ctx.arcTo(t+i,e,t+i,e+a,n),this._ctx.arcTo(t+i,e+a,t,e+a,n),this._ctx.arcTo(t,e+a,t,e,n),this._ctx.arcTo(t,e,t+i,e,n),this._ctx.closePath()}},{key:"_getCandleStickPromptData",value:function(t,e){var i=this,a=e.values,n=[];if(a)n=v(a)?a(t)||[]:a;else{var r=this._chartData.precisionOptions();(n=[X(t,"timestamp"),X(t,"open"),X(t,"close"),X(t,"high"),X(t,"low"),X(t,"volume")]).forEach((function(t,e){switch(e){case 0:n[e]=K(t,"YYYY-MM-DD hh:mm",i._chartData.timezone());break;case n.length-1:n[e]=Z(t,r.volume);break;default:n[e]=Z(t,r.price)}}))}return n}}]),a}(lt);function Mt(t,e,i){var a=[];if(t&&e&&i.length>0){var n=t.x-e.x;if(0===n)i.forEach((function(t){a.push(t.y)}));else{var r=(t.y-e.y)/n,s=t.y-r*t.x;i.forEach((function(t){a.push(t.x*r+s)}))}}return a}function wt(t,e,i){return!!(i&&t&&e)&&(t.x===e.x?1>Math.abs(i.x-t.x):t.y===e.y?1>Math.abs(i.y-t.y):1>Math.abs(i.y-Mt(t,e,[i])[0]))}function St(t,e,i){return!!(i&&t&&e)&&(!!wt(t,e,i)&&(t.x===e.x?e.y>t.y?i.y>t.y-2:t.y+2>i.y:e.x>t.x?i.x>t.x-2:t.x+2>i.x))}function Tt(t,e,i){return!!(i&&t&&e)&&(!!wt(t,e,i)&&2>Math.abs(Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))+Math.sqrt(Math.pow(i.x-e.x,2)+Math.pow(i.y-e.y,2))-Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))))}function Et(t,e,i){if(!i)return!1;var a=i.x-t.x,n=i.y-t.y;return!(a*a+n*n>e*e)}function Lt(t,e,i){var a=[];if(t.length>1)if(t[0].x===t[1].x){var n=e.height;if(a.push([{x:t[0].x,y:0},{x:t[0].x,y:n}]),t.length>2&&(a.push([{x:t[2].x,y:0},{x:t[2].x,y:n}]),i)){var r=t[0].x-t[2].x;a.push([{x:t[0].x+r,y:0},{x:t[0].x+r,y:n}])}}else{var s=e.width;if(t[0].y===t[1].y){if(a.push([{x:0,y:t[0].y},{x:s,y:t[0].y}]),t.length>2&&(a.push([{x:0,y:t[2].y},{x:s,y:t[2].y}]),i)){var o=t[0].y-t[2].y;a.push([{x:0,y:t[0].y+o},{x:s,y:t[0].y+o}])}}else{var c=(t[0].y-t[1].y)/(t[0].x-t[1].x),h=t[0].y-c*t[0].x;if(a.push([{x:0,y:0*c+h},{x:s,y:s*c+h}]),t.length>2){var l=t[2].y-c*t[2].x;if(a.push([{x:0,y:0*c+l},{x:s,y:s*c+l}]),i){var _=h+(h-l);a.push([{x:0,y:0*c+_},{x:s,y:s*c+_}])}}}}return a}function At(t,e){var i=[];if(t.length>0){var a=e.width;if(i.push([{x:0,y:t[0].y},{x:a,y:t[0].y}]),t.length>1){var n=t[0].y-t[1].y;i.push([{x:0,y:t[1].y+.786*n},{x:a,y:t[1].y+.786*n}]),i.push([{x:0,y:t[1].y+.618*n},{x:a,y:t[1].y+.618*n}]),i.push([{x:0,y:t[1].y+.5*n},{x:a,y:t[1].y+.5*n}]),i.push([{x:0,y:t[1].y+.382*n},{x:a,y:t[1].y+.382*n}]),i.push([{x:0,y:t[1].y+.236*n},{x:a,y:t[1].y+.236*n}]),i.push([{x:0,y:t[1].y},{x:a,y:t[1].y}])}}return i}var It=0,bt=2;function Pt(t){return t.getBoundingClientRect()||{left:0,top:0}}function Ct(t){return!!t.touches}function Rt(t){t.cancelable&&t.preventDefault()}var Ot=!!navigator.maxTouchPoints||!!navigator.msMaxTouchPoints||"ontouchstart"in window||!!(window.DocumentTouch&&document instanceof window.DocumentTouch),Ht="onorientationchange"in window&&Ot;function Nt(t,e){var i=t.clientX-e.clientX,a=t.clientY-e.clientY;return Math.sqrt(i*i+a*a)}var zt={MOUSE:"mouse",TOUCH:"touch"},Gt=function(){function t(e,a,n){i(this,t),this._target=e,this._handler=a,this._options=n,this._clickCount=0,this._clickTimeoutId=null,this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartPosition=null,this._moveExceededManhattanDistance=!1,this._cancelClick=!1,this._unsubscribeOutsideEvents=null,this._unsubscribeMousemove=null,this._unsubscribeRoot=null,this._startPinchMiddlePoint=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventDragProcess=!1,this._mousePressed=!1,this._init()}return n(t,[{key:"destroy",value:function(){null!==this._unsubscribeOutsideEvents&&(this._unsubscribeOutsideEvents(),this._unsubscribeOutsideEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),this._clearLongTapTimeout(),this._resetClickTimeout()}},{key:"_mouseEnterHandler",value:function(t){var e=this;this._unsubscribeMousemove&&this._unsubscribeMousemove();var i=this._mouseMoveHandler.bind(this),a=this._mouseWheelHandler.bind(this);this._unsubscribeMousemove=function(){e._target.removeEventListener("mousemove",i),e._target.removeEventListener("wheel",a)},this._target.addEventListener("mousemove",i),this._target.addEventListener("wheel",a,{passive:!1}),Ct(t)&&this._mouseMoveHandler(t);var n=this._makeCompatEvent(t);this._processEvent(n,this._handler.mouseEnterEvent)}},{key:"_resetClickTimeout",value:function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null}},{key:"_mouseMoveHandler",value:function(t){if(!this._mousePressed||Ct(t)){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseMoveEvent)}}},{key:"_mouseWheelHandler",value:function(t){var e=this._makeCompatEvent(t);t.localX=e.localX,t.localY=e.localY,this._processEvent(t,this._handler.mouseWheelEvent)}},{key:"_mouseMoveWithDownHandler",value:function(t){if(!("button"in t&&t.button!==It)&&null===this._startPinchMiddlePoint){var e=Ct(t);if(!this._preventDragProcess||!e){this._pinchPrevented=!0;var i=this._makeCompatEvent(t),a=this._mouseMoveStartPosition,n=Math.abs(a.x-i.pageX),r=Math.abs(a.y-i.pageY),s=n+r>5;if(s||!e){if(s&&!this._moveExceededManhattanDistance&&e){var o=.5*n;r>=o&&!this._options.treatVertTouchDragAsPageScroll||o>r&&!this._options.treatHorzTouchDragAsPageScroll||(this._preventDragProcess=!0)}s&&(this._moveExceededManhattanDistance=!0,this._cancelClick=!0,e&&this._clearLongTapTimeout()),this._preventDragProcess||(this._processEvent(i,this._handler.pressedMouseMoveEvent),e&&Rt(t))}}}}},{key:"_mouseUpHandler",value:function(t){if(!("button"in t&&t.button!==It)){var e=this._makeCompatEvent(t);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),Ct(t)&&this._mouseLeaveHandler(t),this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,this._clickTimeoutId&&this._clickCount>1?(this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent),Ct(t)&&(Rt(t),this._mouseLeaveHandler(t),0===t.touches.length&&(this._longTapActive=!1))}}},{key:"_clearLongTapTimeout",value:function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)}},{key:"_mouseDownHandler",value:function(t){if(!("button"in t&&t.button!==It&&t.button!==bt)){var e=this._makeCompatEvent(t);if("button"in t&&t.button===bt)this._processEvent(e,this._handler.mouseRightDownEvent);else{this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,Ct(t)&&this._mouseEnterHandler(t),this._mouseMoveStartPosition={x:e.pageX,y:e.pageY},this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null);var i=this._mouseMoveWithDownHandler.bind(this),a=this._mouseUpHandler.bind(this),n=this._target.ownerDocument.documentElement;this._unsubscribeRoot=function(){n.removeEventListener("touchmove",i),n.removeEventListener("touchend",a),n.removeEventListener("mousemove",i),n.removeEventListener("mouseup",a)},n.addEventListener("touchmove",i,{passive:!1}),n.addEventListener("touchend",a,{passive:!1}),this._clearLongTapTimeout(),Ct(t)&&1===t.touches.length?this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),600):(n.addEventListener("mousemove",i),n.addEventListener("mouseup",a)),this._mousePressed=!0,this._processEvent(e,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))}}}},{key:"_init",value:function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e=this._target.ownerDocument,i=function(e){t._handler.mouseDownOutsideEvent&&(e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent())};this._unsubscribeOutsideEvents=function(){e.removeEventListener("mousedown",i),e.removeEventListener("touchstart",i)},e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._mouseDownHandler.bind(this),{passive:!0}),Ht||this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",(function(){}),{passive:!1})}},{key:"_initPinch",value:function(){var t=this;void 0===this._handler.pinchStartEvent&&void 0===this._handler.pinchEvent&&void 0===this._handler.pinchEndEvent||(this._target.addEventListener("touchstart",(function(e){return t._checkPinchState(e.touches)}),{passive:!0}),this._target.addEventListener("touchmove",(function(e){if(2===e.touches.length&&null!==t._startPinchMiddlePoint&&void 0!==t._handler.pinchEvent){var i=Nt(e.touches[0],e.touches[1]);t._handler.pinchEvent(t._startPinchMiddlePoint,i/t._startPinchDistance),Rt(e)}}),{passive:!1}),this._target.addEventListener("touchend",(function(e){t._checkPinchState(e.touches)})))}},{key:"_checkPinchState",value:function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)}},{key:"_startPinch",value:function(t){var e=Pt(this._target);this._startPinchMiddlePoint={x:(t[0].clientX-e.left+(t[1].clientX-e.left))/2,y:(t[0].clientY-e.top+(t[1].clientY-e.top))/2},this._startPinchDistance=Nt(t[0],t[1]),void 0!==this._handler.pinchStartEvent&&this._handler.pinchStartEvent(),this._clearLongTapTimeout()}},{key:"_stopPinch",value:function(){null!==this._startPinchMiddlePoint&&(this._startPinchMiddlePoint=null,void 0!==this._handler.pinchEndEvent&&this._handler.pinchEndEvent())}},{key:"_mouseLeaveHandler",value:function(t){this._unsubscribeMousemove&&this._unsubscribeMousemove();var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.mouseLeaveEvent)}},{key:"_longTapHandler",value:function(t){var e=this._makeCompatEvent(t);this._processEvent(e,this._handler.longTapEvent),this._cancelClick=!0,this._longTapActive=!0}},{key:"_processEvent",value:function(t,e){e&&e.call(this._handler,t)}},{key:"_makeCompatEvent",value:function(t){var e;e="touches"in t&&t.touches.length?t.touches[0]:"changedTouches"in t&&t.changedTouches.length?t.changedTouches[0]:t;var i=Pt(this._target);return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY,localX:e.clientX-i.left,localY:e.clientY-i.top,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey,type:t.type.startsWith("mouse")?zt.MOUSE:zt.TOUCH,target:e.target,view:t.view}}}]),t}();function Yt(t){return t.type===zt.TOUCH}function Vt(t){return t.type===zt.MOUSE}var Ft=function(){function t(e){i(this,t),this._chartData=e,this._seriesSize={}}return n(t,[{key:"_checkEventPointX",value:function(t){return t>this._seriesSize.contentLeft&&this._seriesSize.contentRight>t}},{key:"setSeriesSize",value:function(t){this._seriesSize=t}}]),t}(),Bt="step_1",Wt="step_2",Xt="step_3",jt="step_done",Kt=function(t){function a(t,e,n){var r;return i(this,a),(r=h(this,o(a).call(this,t)))._xAxis=e,r._yAxis=n,r._noneGraphicMarkMouseDownFlag=!1,r._noneGraphicMarkMouseDownActiveData={markKey:null,dataIndex:-1,onLine:!1,onCircle:!1,pointIndex:-1},r}return s(a,t),n(a,[{key:"mouseUpEvent",value:function(t){this._chartData.setDragGraphicMarkFlag(!1),this._noneGraphicMarkMouseDownFlag=!1,this._noneGraphicMarkMouseDownActiveData={markKey:null,dataIndex:-1,onLine:!1,onCircle:!1,pointIndex:-1}}},{key:"mouseDownEvent",value:function(t){if(this._checkEventPointX(t.localX)&&this._checkEventPointY(t.localY)){this._chartData.setGraphicMarkPoint({x:t.localX,y:t.localY});var e=this._chartData.graphicMarkType();switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.STRAIGHT_LINE:case $.HORIZONTAL_RAY_LINE:case $.VERTICAL_RAY_LINE:case $.RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:case $.VERTICAL_SEGMENT_LINE:case $.SEGMENT_LINE:case $.PRICE_LINE:case $.FIBONACCI_LINE:this._twoStepGraphicMarkMouseDown(t,e);break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:this._threeStepGraphicMarkMouseDown(t,e);break;case $.NONE:this._noneGraphicMarkMouseLeftDown(t)}}}},{key:"mouseRightDownEvent",value:function(t){if(this._chartData.graphicMarkType()===$.NONE){this._findNoneGraphicMarkMouseDownActiveData(t);var e=this._noneGraphicMarkMouseDownActiveData.markKey,i=this._noneGraphicMarkMouseDownActiveData.dataIndex;if(e&&-1!==i){var a=this._chartData.graphicMarkData(),n=a[e];n.splice(i,1),a[e]=n,this._chartData.setGraphicMarkData(a),this.mouseUpEvent(t)}}}},{key:"_twoStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Bt:t.drawStep=Wt;break;case Wt:t.drawStep=jt,i._chartData.setGraphicMarkType($.NONE)}}))}},{key:"_threeStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Bt:t.drawStep=Wt;break;case Wt:t.drawStep=Xt;break;case Xt:t.drawStep=jt,i._chartData.setGraphicMarkType($.NONE)}}))}},{key:"_graphicMarkMouseDown",value:function(t,e,i){var a=this._chartData.graphicMarkData(),n=a[e];if(2===t.button)n.splice(n.length-1,1),this._chartData.setGraphicMarkType($.NONE);else{var r=n[n.length-1];i(r),n[n.length-1]=r}a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_noneGraphicMarkMouseLeftDown",value:function(t){this._findNoneGraphicMarkMouseDownActiveData(t),this._noneGraphicMarkMouseDownActiveData.markKey&&-1!==this._noneGraphicMarkMouseDownActiveData.dataIndex&&this._noneGraphicMarkMouseDownActiveData.onCircle&&(this._noneGraphicMarkMouseDownFlag=!0,this._chartData.setDragGraphicMarkFlag(!0))}},{key:"_findNoneGraphicMarkMouseDownActiveData",value:function(t){for(var i=this,a={x:t.localX,y:t.localY},n=Object.keys(this._chartData.graphicMarkData()),r=function(t){var e=n[t];switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.PRICE_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],{x:i._seriesSize.contentRight,y:t[0].y},a)})))return{v:void 0};break;case $.VERTICAL_STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],{x:t[0].x,y:i._seriesSize.tags[he].contentBottom},a)})))return{v:void 0};break;case $.STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],t[1],a)})))return{v:void 0};break;case $.HORIZONTAL_RAY_LINE:case $.VERTICAL_RAY_LINE:case $.RAY_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return St(t[0],t[1],a)})))return{v:void 0};break;case $.HORIZONTAL_SEGMENT_LINE:case $.VERTICAL_SEGMENT_LINE:case $.SEGMENT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Tt(t[0],t[1],a)})))return{v:void 0};break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:case $.FIBONACCI_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){var n=[],r={width:i._seriesSize.contentRight-i._seriesSize.contentLeft,height:i._seriesSize.tags[he].contentBottom-i._seriesSize.tags[he].contentTop};switch(e){case $.PRICE_CHANNEL_LINE:n=Lt(t,r,!0);break;case $.PARALLEL_STRAIGHT_LINE:n=Lt(t,r);break;case $.FIBONACCI_LINE:n=At(t,r)}for(var s=!1,o=0;n.length>o;o++){var c=n[o];if(s=wt(c[0],c[1],a))return s}return s})))return{v:void 0}}},s=0;n.length>s;s++){var o=r(s);if("object"===e(o))return o.v}}},{key:"_realFindNoneGraphicMarkMouseDownActiveData",value:function(t,e,i){var a=this,n=this._chartData.graphicMarkData()[t],r=this._chartData.styleOptions().graphicMark;return n.forEach((function(n,s){var o=[],c=!1,h=-1;n.points.forEach((function(t,i){var n=a._xAxis.convertToPixel(t.xPos),s=a._yAxis.convertToPixel(t.price);o.push({x:n,y:s});var l=Et({x:n,y:s},r.point.radius,e);l&&(h=i),c||(c=l)}));var l=i(o,e);if(l||c)return a._noneGraphicMarkMouseDownActiveData={markKey:t,dataIndex:s,onLine:l,onCircle:c,pointIndex:h},!0})),!1}},{key:"mouseMoveEvent",value:function(t){if(this._checkEventPointX(t.localX)&&this._checkEventPointY(t.localY)){var e={x:t.localX,y:t.localY};if(this._chartData.setGraphicMarkPoint(e),!this._waitingForMouseMoveAnimationFrame){this._waitingForMouseMoveAnimationFrame=!0;var i=this._chartData.graphicMarkType();switch(i){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.PRICE_LINE:this._onePointGraphicMarkMouseMove(e,i);break;case $.STRAIGHT_LINE:case $.RAY_LINE:case $.SEGMENT_LINE:case $.FIBONACCI_LINE:this._twoPointGraphicMarkMouseMove(e,i);break;case $.HORIZONTAL_RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].price=e.price}));break;case $.VERTICAL_RAY_LINE:case $.VERTICAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].xPos=e.xPos}));break;case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:this._threePointGraphicMarkMouseMove(e,i);break;case $.NONE:this._chartData.setGraphicMarkData(this._chartData.graphicMarkData())}this._waitingForMouseMoveAnimationFrame=!1}}}},{key:"pressedMouseMoveEvent",value:function(t){var e=this._noneGraphicMarkMouseDownActiveData.markKey,i=this._noneGraphicMarkMouseDownActiveData.dataIndex;if(e&&-1!==i){var a=this._chartData.graphicMarkData(),n=a[e],r={x:t.localX,y:t.localY};switch(e){case $.HORIZONTAL_STRAIGHT_LINE:case $.VERTICAL_STRAIGHT_LINE:case $.PRICE_LINE:case $.STRAIGHT_LINE:case $.RAY_LINE:case $.SEGMENT_LINE:case $.PRICE_CHANNEL_LINE:case $.PARALLEL_STRAIGHT_LINE:case $.FIBONACCI_LINE:var s=this._noneGraphicMarkMouseDownActiveData.pointIndex;-1!==s&&(n[i].points[s].xPos=this._xAxis.convertFromPixel(r.x),n[i].points[s].price=this._yAxis.convertFromPixel(r.y));break;case $.HORIZONTAL_RAY_LINE:case $.HORIZONTAL_SEGMENT_LINE:var o=this._noneGraphicMarkMouseDownActiveData.pointIndex;if(-1!==o){var c=this._yAxis.convertFromPixel(r.y);n[i].points[o].xPos=this._xAxis.convertFromPixel(r.x),n[i].points[0].price=c,n[i].points[1].price=c}break;case $.VERTICAL_RAY_LINE:case $.VERTICAL_SEGMENT_LINE:var h=this._noneGraphicMarkMouseDownActiveData.pointIndex;if(-1!==h){var l=this._xAxis.convertFromPixel(r.x);n[i].points[0].xPos=l,n[i].points[1].xPos=l,n[i].points[h].price=this._yAxis.convertFromPixel(r.y)}}a[e]=n,this._chartData.setGraphicMarkPoint({x:t.localX,y:t.localY}),this._chartData.setGraphicMarkData(a)}}},{key:"_onePointGraphicMarkMouseMove",value:function(t,e){var i=this;this._graphicMarkMouseMove(t,e,(function(e,a){var n=i._xAxis.convertFromPixel(t.x),r=i._yAxis.convertFromPixel(t.y);switch(a.drawStep){case jt:e.push({points:[{xPos:n,price:r}],drawStep:Bt});break;case Bt:case Wt:a.points[0].xPos=n,a.points[0].price=r,e[e.length-1]=a}}))}},{key:"_twoPointGraphicMarkMouseMove",value:function(t,e,i){var a=this;this._graphicMarkMouseMove(t,e,(function(e,n){var r=a._xAxis.convertFromPixel(t.x),s=a._yAxis.convertFromPixel(t.y);switch(n.drawStep){case jt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Bt});break;case Bt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Wt:n.points[1]={xPos:r,price:s},v(i)&&i(n,{xPos:r,price:s}),e[e.length-1]=n}}))}},{key:"_threePointGraphicMarkMouseMove",value:function(t,e,i){var a=this;this._graphicMarkMouseMove(t,e,(function(e,n){var r=a._xAxis.convertFromPixel(t.x),s=a._yAxis.convertFromPixel(t.y);switch(n.drawStep){case jt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Bt});break;case Bt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Wt:v(i)&&i(n,{xPos:r,price:s}),n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Xt:n.points[2]={xPos:r,price:s},e[e.length-1]=n}}))}},{key:"_graphicMarkMouseMove",value:function(t,e,i){var a=this._chartData.graphicMarkData(),n=a[e];i(n,n[n.length-1]||{drawStep:jt}),a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_checkEventPointY",value:function(t){var e=this._seriesSize.tags[he];return t>e.contentTop&&e.contentBottom>t}}]),a}(Ft),Zt=0,Ut=1,qt=2,Jt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._xAxis=n,s._yAxis=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().graphicMark,e=this._chartData.precisionOptions().price;this._drawHorizontalStraightLine(t),this._drawVerticalStraightLine(t),this._drawStraightLine(t),this._drawHorizontalRayLine(t),this._drawVerticalRayLine(t),this._drawRayLine(t),this._drawSegmentLine(t),this._drawPriceLine(t,e),this._drawPriceChannelLine(t),this._drawParallelStraightLine(t),this._drawFibonacciLine(t,e)}},{key:"_drawHorizontalStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.HORIZONTAL_STRAIGHT_LINE,t,wt,(function(t){return[[{x:0,y:t[0].y},{x:e._width,y:t[0].y}]]}))}},{key:"_drawVerticalStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.VERTICAL_STRAIGHT_LINE,t,wt,(function(t){return[[{x:t[0].x,y:0},{x:t[0].x,y:e._height}]]}))}},{key:"_drawStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.STRAIGHT_LINE,t,wt,(function(t){if(t[0].x===t[1].x)return[[{x:t[0].x,y:0},{x:t[0].x,y:e._height}]];var i=Mt(t[0],t[1],[{x:0,y:t[0].y},{x:e._width,y:t[0].y}]);return[[{x:0,y:i[0]},{x:e._width,y:i[1]}]]}))}},{key:"_drawHorizontalRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.HORIZONTAL_RAY_LINE,t,St,(function(t){var i={x:0,y:t[0].y};return t[1].x>t[0].x&&(i.x=e._width),[[t[0],i]]}))}},{key:"_drawVerticalRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.VERTICAL_RAY_LINE,t,St,(function(t){var i={x:t[0].x,y:0};return t[1].y>t[0].y&&(i.y=e._height),[[t[0],i]]}))}},{key:"_drawRayLine",value:function(t){var e=this;this._drawPointGraphicMark($.RAY_LINE,t,St,(function(t){var i;return i=t[0].x===t[1].x&&t[0].y!==t[1].y?t[1].y>t[0].y?{x:t[0].x,y:e._height}:{x:t[0].x,y:0}:t[0].x>t[1].x?{x:0,y:Mt(t[0],t[1],[{x:0,y:t[0].y}])[0]}:{x:e._width,y:Mt(t[0],t[1],[{x:e._width,y:t[0].y}])[0]},[[t[0],i]]}))}},{key:"_drawSegmentLine",value:function(t){this._drawPointGraphicMark($.HORIZONTAL_SEGMENT_LINE,t,Tt),this._drawPointGraphicMark($.VERTICAL_SEGMENT_LINE,t,Tt),this._drawPointGraphicMark($.SEGMENT_LINE,t,Tt)}},{key:"_drawPriceLine",value:function(t,e){var i=this;this._drawPointGraphicMark($.PRICE_LINE,t,St,(function(t){return[[t[0],{x:i._width,y:t[0].y}]]}),!0,e)}},{key:"_drawPriceChannelLine",value:function(t){var e=this;this._drawPointGraphicMark($.PRICE_CHANNEL_LINE,t,wt,(function(t){return Lt(t,{width:e._width,height:e._height},!0)}))}},{key:"_drawParallelStraightLine",value:function(t){var e=this;this._drawPointGraphicMark($.PARALLEL_STRAIGHT_LINE,t,wt,(function(t){return Lt(t,{width:e._width,height:e._height})}))}},{key:"_drawFibonacciLine",value:function(t,e){var i=this;this._drawPointGraphicMark($.FIBONACCI_LINE,t,wt,(function(t){return At(t,{width:i._width,height:i._height})}),!0,e,["(100.0%)","(78.6%)","(61.8%)","(50.0%)","(38.2%)","(23.6%)","(0.0%)"])}},{key:"_drawPointGraphicMark",value:function(t,e,i,a,n,r,s){var o=this;this._chartData.graphicMarkData()[t].forEach((function(t){var c=t.drawStep,h=[];t.points.forEach((function(t){var e=t.price,i=o._xAxis.convertToPixel(t.xPos),a=o._yAxis.convertToPixel(e);h.push({x:i,y:a})}));var l=a?a(h):[h];o._drawGraphicMark(e,l,h,c,i,n,r,s)}))}},{key:"_drawGraphicMark",value:function(t,e,i,a,n,r,s){var o=this,c=arguments.length>7&&void 0!==arguments[7]?arguments[7]:[],h=this._chartData.graphicMarkPoint(),l=!1;e.forEach((function(e,i){if(e.length>1){var _=n(e[0],e[1],h);if(l||(l=_),a!==Bt){switch(o._ctx.strokeStyle=t.line.color,o._ctx.lineWidth=t.line.size,o._getLineType(e[0],e[1])){case Zt:rt(o._ctx,(function(){o._ctx.beginPath(),o._ctx.moveTo(e[0].x,e[0].y),o._ctx.lineTo(e[1].x,e[1].y),o._ctx.stroke(),o._ctx.closePath()}));break;case Ut:at(o._ctx,e[0].y,e[0].x,e[1].x);break;case qt:nt(o._ctx,e[0].x,e[0].y,e[1].y)}if(r){var u=Z(o._yAxis.convertFromPixel(e[0].y),s);o._ctx.font=it(t.text.size),o._ctx.fillStyle=t.text.color,o._ctx.fillText("".concat(u," ").concat(c[i]||""),e[0].x+t.text.marginLeft,e[0].y-t.text.marginBottom)}}}}));for(var _=t.point.radius,u=!1,d=0;i.length>d&&!(u=Et(i[d],_,h));d++);i.forEach((function(e){var i=Et(e,_,h);if(u||l){var a=_,n=t.point.backgroundColor,r=t.point.borderColor,s=t.point.borderSize;i&&(a=t.point.activeRadius,n=t.point.activeBackgroundColor,r=t.point.activeBorderColor,s=t.point.activeBorderSize),o._ctx.fillStyle=n,o._ctx.beginPath(),o._ctx.arc(e.x,e.y,a,0,2*Math.PI),o._ctx.closePath(),o._ctx.fill(),o._ctx.lineWidth=s,o._ctx.strokeStyle=r,o._ctx.beginPath(),o._ctx.arc(e.x,e.y,a,0,2*Math.PI),o._ctx.closePath(),o._ctx.stroke()}}))}},{key:"_getLineType",value:function(t,e){return t.x===e.x?qt:t.y===e.y?Ut:Zt}}]),e}(ct),$t=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new kt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createExpandView",value:function(t,e){return new Jt(t,e.chartData,e.xAxis,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new Dt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"invalidate",value:function(t){t===q?this._expandView.flush():l(o(e.prototype),"invalidate",this).call(this,t)}},{key:"setSize",value:function(t,i){l(o(e.prototype),"setSize",this).call(this,t,i),this._expandView.setSize(t,i)}}]),e}(_t),Qt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._chartType=w.CANDLE_STICK,a}return s(e,t),n(e,[{key:"_createYAxis",value:function(t){return new gt(t.chartData,yt)}},{key:"_createMainWidget",value:function(t,e){return new $t({container:t,chartData:e.chartData,xAxis:e.xAxis,yAxis:this._yAxis,additionalDataProvider:{technicalIndicatorType:this.technicalIndicatorType.bind(this),chartType:this.chartType.bind(this),tag:this.tag.bind(this)}})}},{key:"_isRealTime",value:function(){return this._chartType===w.REAL_TIME}},{key:"chartType",value:function(){return this._chartType}},{key:"setChartType",value:function(t){this._chartType!==t&&(this._chartType=t,this._chartData.styleOptions().realTime.averageLine.display&&this._isRealTime()&&this._chartData.calcTechnicalIndicator(R.AVERAGE),this.invalidate(J))}}]),e}(mt),te=function(t){function e(t,a,n){var r;return i(this,e),(r=h(this,o(e).call(this,t,a)))._xAxis=n,r}return s(e,t),n(e,[{key:"_draw",value:function(){var t=this._chartData.styleOptions().xAxis;t.display&&(this._drawAxisLine(t),this._drawTickLines(t),this._drawTickLabels(t))}},{key:"_drawAxisLine",value:function(t){var e=t.axisLine;e.display&&(this._ctx.strokeStyle=e.color,this._ctx.lineWidth=e.size,at(this._ctx,0,0,this._width))}},{key:"_drawTickLines",value:function(t){var e=this,i=t.tickLine;if(i.display){this._ctx.lineWidth=i.size,this._ctx.strokeStyle=i.color;var a=t.axisLine.display?t.axisLine.size:0,n=a+i.length;this._xAxis.ticks().forEach((function(t){nt(e._ctx,t.x,a,n)}))}}},{key:"_drawTickLabels",value:function(t){var e=t.tickText;if(e.display){var i=t.tickLine;this._ctx.textBaseline="top",this._ctx.font=it(e.size),this._ctx.textAlign="center",this._ctx.fillStyle=e.color;var a=e.margin;t.axisLine.display&&(a+=t.axisLine.size),i.display&&(a+=i.length);for(var n=this._xAxis.ticks(),r=n.length,s=0;r>s;s++)this._ctx.fillText(n[s].v,n[s].x,a)}}}]),e}(ct),ee=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_drawCrossHairLabel",value:function(){if(this._chartData.crossHairSeriesTag()){var t=this._chartData.styleOptions().floatLayer.crossHair,e=t.vertical,i=e.text;if(t.display&&e.display&&i.display){var a,n=this._chartData.crossHairPoint();a=n?this._axis.convertFromPixel(n.x):this._chartData.dataList().length-1;var r=this._chartData.dataList()[a];if(r){var s=this._axis.convertToPixel(a),o=K(r.timestamp,"YYYY-MM-DD hh:mm",this._chartData.timezone()),c=i.size;this._ctx.font=it(c);var h=et(this._ctx,o),l=s-h/2,_=i.paddingLeft,u=i.paddingRight,d=i.paddingTop,v=i.borderSize;_+v>l?l=_+v:l>this._width-h-v-u&&(l=this._width-h-v-u);var p=l-v-_,f=l+h+v+u,y=0+c+2*v+d+i.paddingBottom;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(p,0,f-p,y-0),this._ctx.lineWidth=v,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(p,0,f-p,y-0),this._ctx.textBaseline="top",this._ctx.fillStyle=i.color,this._ctx.fillText(o,l,v+d)}}}}}]),e}(dt),ie=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_createMainView",value:function(t,e){return new te(t,e.chartData,e.xAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new ee(t,e.chartData,e.xAxis)}}]),e}(ot),ae=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._initMeasureCanvas(),a}return s(e,t),n(e,[{key:"_initMeasureCanvas",value:function(){var t=document.createElement("canvas");this._measureCtx=t.getContext("2d");var e=tt(this._measureCtx);this._measureCtx.scale(e,e)}},{key:"_computeMinMaxValue",value:function(){var t=this._chartData.from(),e=this._chartData.to()-1;return{min:t,max:e,range:e-t}}},{key:"_computeOptimalTicks",value:function(t){var e=[],i=t.length,a=this._chartData.dataList();if(i>0){var n=this._chartData.timezone(),r=this._chartData.styleOptions().xAxis.tickText.size;this._measureCtx.font=it(r);var s=et(this._measureCtx,"00-00 00:00"),o=parseInt(t[0].v),c=X(a[o],"timestamp",0),h=this.convertToPixel(o),l=1,_="MM:DD hh:mm";if(i>1){var u=parseInt(t[1].v),d=X(a[u],"timestamp",0),v=this.convertToPixel(u),p=Math.abs(v-h);s>p&&(l=Math.ceil(s/p));var f=(d-c)/1e3/60;_=720>f?"hh:mm":21600>f?"MM-DD":259200>f?"YYYY-MM":"YYYY"}for(var y=0;i>y;y+=l){var x=parseInt(t[y].v),g=a[x].timestamp,m=K(g,_,n);if(i-1-l>=y){var k=a[parseInt(t[y+l].v)].timestamp,D=K(g,"YYYY",n),M=K(g,"YYYY-MM",n),w=K(g,"MM-DD",n);D!==K(k,"YYYY",n)?m=D:M!==K(k,"YYYY-MM",n)?m=M:w!==K(k,"MM-DD",n)&&(m=w)}var S=this.convertToPixel(x);S>s/2&&this._width-s/2>S&&e.push({v:m,x:S})}if(0===e.length){var T=parseInt(t[t.length-1].v),E=a[T].timestamp,L=this.convertToPixel(T);e.push({v:K(E,"MM-DD",n),x:L})}}return e}},{key:"convertFromPixel",value:function(t){var e=this._chartData.dataSpace(),i=Math.ceil(t/e),a=this._chartData.from()+i-1,n=this._chartData.to();return a>n-1&&(a=n-1),a}},{key:"convertToPixel",value:function(t){var e=this._chartData.dataSpace();return Math.round((t-this._chartData.from())*e+this._chartData.barSpace()/2)}}]),e}(ft),ne=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"_initBefore",value:function(){this._xAxis=new ae(this._chartData)}},{key:"_createMainWidget",value:function(t,e){return new ie({container:t,chartData:e.chartData,xAxis:this._xAxis})}},{key:"_computeAxis",value:function(){this._xAxis.computeAxis()}},{key:"xAxis",value:function(){return this._xAxis}},{key:"setSize",value:function(t,i){this._xAxis.setSize(t.width,t.height),this._computeAxis(),l(o(e.prototype),"setSize",this).call(this,t,i)}}]),e}(st),re=function(){function t(e,a,n,r){i(this,t),this._chartData=a,this._seriesIndex=n,this._width=0,this._offsetLeft=0,this._dragEventHandler=r,this._initElement(e)}return n(t,[{key:"_initElement",value:function(t){this._container=t,this._wrapper=document.createElement("div"),this._wrapper.style.margin="0",this._wrapper.style.padding="0",this._wrapper.style.position="relative",this._wrapper.style.overflow="hidden",this._wrapper.style.zIndex="10",this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.cursor="ns-resize",this._element.style.height="6px",this._wrapper.appendChild(this._element);var e=t.lastChild;e?t.insertBefore(this._wrapper,e):t.appendChild(this._wrapper),this._dragEvent=new Gt(this._element,{mouseDownEvent:this._mouseDownEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this)},{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0})}},{key:"_mouseDownEvent",value:function(t){this._startY=t.pageY,this._dragEventHandler.startDrag(this._seriesIndex)}},{key:"_pressedMouseMoveEvent",value:function(t){this._dragEventHandler.drag(t.pageY-this._startY,this._seriesIndex)}},{key:"height",value:function(){return this._wrapper.offsetHeight}},{key:"setSize",value:function(t,e){this._offsetLeft=t,this._width=e,this.invalidate()}},{key:"updateSeriesIndex",value:function(t){this._seriesIndex=t}},{key:"invalidate",value:function(){var t=this._chartData.styleOptions().separator;this._wrapper.style.backgroundColor=t.color,this._wrapper.style.height="".concat(t.size,"px"),this._wrapper.style.marginLeft="".concat(t.fill?0:this._offsetLeft,"px"),this._wrapper.style.width=t.fill?"100%":"".concat(this._width,"px")}},{key:"getImage",value:function(){var t=this._chartData.styleOptions().separator,e=document.createElement("canvas"),i=e.getContext("2d"),a=tt(i),n=this._wrapper.offsetWidth,r=t.size;return e.style.width="".concat(n,"px"),e.style.height="".concat(r,"px"),e.width=n*a,e.height=r*a,i.scale(a,a),i.fillStyle=t.color,i.fillRect(this._offsetLeft,0,n,r),e}},{key:"destroy",value:function(){this._dragEvent.destroy(),this._container.removeChild(this._wrapper)}}]),t}(),se=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._startDragPoint={},a._touchPoint={},a._touchCancelCrossHair=!1,a._touchZoomed=!1,a._pinchScale=1,a}return s(e,t),n(e,[{key:"pinchStartEvent",value:function(){this._pinchScale=1,this._touchZoomed=!0}},{key:"pinchEvent",value:function(t,e){var i=5*(e-this._pinchScale);this._pinchScale=e,this._chartData.zoom(i)}},{key:"mouseLeaveEvent",value:function(t){Vt(t)&&this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseMoveEvent",value:function(t){if(Vt(t))if(this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e?(this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag)):this._chartData.setCrossHairSeriesTag(null)}else this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseWheelEvent",value:function(t){if(this._checkEventPointX(t.localX)){var e=-t.deltaY/100;if(0!==e){switch(t.cancelable&&t.preventDefault(),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._chartData.zoom(i)}}}}},{key:"mouseClickEvent",value:function(t){if(Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e&&(this._touchPoint||this._touchCancelCrossHair||this._touchZoomed||(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag)))}}},{key:"mouseDownEvent",value:function(t){if(this._startDragPoint={x:t.localX,y:t.localY},this._chartData.startDrag(),Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);if(e){var i={x:t.localX,y:e.y};if(this._touchZoomed=!1,this._touchPoint){var a=t.localX-this._touchPoint.x,n=t.localY-this._touchPoint.y;10>Math.sqrt(a*a+n*n)?(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint(i),this._chartData.setCrossHairSeriesTag(e.tag)):(this._touchCancelCrossHair=!0,this._touchPoint=null,this._chartData.setCrossHairPoint(i),this._chartData.setCrossHairSeriesTag(null))}else this._touchCancelCrossHair=!1}}}},{key:"pressedMouseMoveEvent",value:function(t){if(this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);if(e){var i={x:t.localX,y:e.y};if(Yt(t)&&this._touchPoint)return this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint(i),void this._chartData.setCrossHairSeriesTag(e.tag);var a=t.localX-this._startDragPoint.x;this._chartData.setCrossHairPoint(i),this._chartData.drag(a)}}}},{key:"longTapEvent",value:function(t){if(Yt(t)&&this._checkEventPointX(t.localX)){var e=this._translateCrossHairRealY(t.localY);e&&(this._touchPoint={x:t.localX,y:t.localY},this._chartData.setCrossHairPoint({x:t.localX,y:e.y}),this._chartData.setCrossHairSeriesTag(e.tag))}}},{key:"_translateCrossHairRealY",value:function(t){var e=this._seriesSize.tags||{};for(var i in e){var a=e[i];if(t>a.contentTop&&a.contentBottom>t)return{tag:i,y:t-a.contentTop}}return null}}]),e}(Ft),oe=function(t){function e(){return i(this,e),h(this,o(e).apply(this,arguments))}return s(e,t),n(e,[{key:"keyBoardDownEvent",value:function(t){if(t.shiftKey)switch(t.code){case"ArrowUp":this._chartData.zoom(-.05);break;case"ArrowDown":this._chartData.zoom(.05);break;case"ArrowLeft":this._chartData.startDrag(),this._chartData.drag(-this._chartData.dataSpace());break;case"ArrowRight":this._chartData.startDrag(),this._chartData.drag(this._chartData.dataSpace())}}}]),e}(Ft),ce=function(){function t(e,a,n,r){i(this,t),this._target=e,this._chartData=a,this._seriesSize={},this._event=new Gt(this._target,{pinchStartEvent:this._pinchStartEvent.bind(this),pinchEvent:this._pinchEvent.bind(this),mouseUpEvent:this._mouseUpEvent.bind(this),mouseClickEvent:this._mouseClickEvent.bind(this),mouseDownEvent:this._mouseDownEvent.bind(this),mouseRightDownEvent:this._mouseRightDownEvent.bind(this),mouseLeaveEvent:this._mouseLeaveEvent.bind(this),mouseMoveEvent:this._mouseMoveEvent.bind(this),mouseWheelEvent:this._mouseWheelEvent.bind(this),pressedMouseMoveEvent:this._pressedMouseMoveEvent.bind(this),longTapEvent:this._longTapEvent.bind(this)},{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!1}),this._boundKeyBoardDownEvent=this._keyBoardDownEvent.bind(this),this._target.addEventListener("keydown",this._boundKeyBoardDownEvent),this._boundContextMenuEvent=function(t){t.preventDefault()},this._target.addEventListener("contextmenu",this._boundContextMenuEvent,!1),this._zoomDragEventHandler=new se(a),this._graphicMarkEventHandler=new Kt(a,n,r),this._keyBoardEventHandler=new oe(a)}return n(t,[{key:"_keyBoardDownEvent",value:function(t){this._keyBoardEventHandler.keyBoardDownEvent(t)}},{key:"_pinchStartEvent",value:function(){this._zoomDragEventHandler.pinchStartEvent()}},{key:"_pinchEvent",value:function(t,e){this._zoomDragEventHandler.pinchEvent(t,e)}},{key:"_mouseUpEvent",value:function(t){this._graphicMarkEventHandler.mouseUpEvent(t)}},{key:"_mouseLeaveEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseLeaveEvent(t)}},{key:"_mouseMoveEvent",value:function(t){this._graphicMarkEventHandler.mouseMoveEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseMoveEvent(t)}},{key:"_mouseWheelEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseWheelEvent(t)}},{key:"_mouseClickEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.mouseClickEvent(t)}},{key:"_mouseDownEvent",value:function(t){this._graphicMarkEventHandler.mouseDownEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseDownEvent(t)}},{key:"_mouseRightDownEvent",value:function(t){this._graphicMarkEventHandler.mouseRightDownEvent(t)}},{key:"_pressedMouseMoveEvent",value:function(t){this._chartData.dragGraphicMarkFlag()&&(this._graphicMarkEventHandler.pressedMouseMoveEvent(t),null!==this._chartData.crossHairSeriesTag()&&this._chartData.setCrossHairSeriesTag(null)),this._checkZoomDrag()&&this._zoomDragEventHandler.pressedMouseMoveEvent(t)}},{key:"_longTapEvent",value:function(t){this._checkZoomDrag()&&this._zoomDragEventHandler.longTapEvent(t)}},{key:"_checkZoomDrag",value:function(){return!this._chartData.dragGraphicMarkFlag()&&this._chartData.graphicMarkType()===$.NONE}},{key:"setSeriesSize",value:function(t){this._zoomDragEventHandler.setSeriesSize(t),this._graphicMarkEventHandler.setSeriesSize(t)}},{key:"destroy",value:function(){this._event.destroy(),this._target.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._target.removeEventListener("contextmenu",this._boundContextMenuEvent)}}]),t}(),he="candle_stick_series_tag",le=function(){function t(e,a){i(this,t),this._initChartContainer(e),this._technicalIndicatorBaseId=0,this._technicalIndicatorSeries=[],this._separatorSeries=[],this._separatorDragStartTechnicalIndicatorHeight=0,this._chartData=new Q(a,this._updateSeries.bind(this)),this._xAxisSeries=new ne({container:this._chartContainer,chartData:this._chartData}),this._candleStickSeries=new Qt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:R.MA,tag:he}),this._chartEvent=new ce(this._chartContainer,this._chartData,this._xAxisSeries.xAxis(),this._candleStickSeries.yAxis()),this.measureSeriesSize()}return n(t,[{key:"_initChartContainer",value:function(t){this._container=t,this._chartContainer=document.createElement("div"),this._chartContainer.style.position="relative",this._chartContainer.style.outline="none",this._chartContainer.style.borderStyle="none",this._chartContainer.style.width="100%",this._chartContainer.style.height="100%",this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)}},{key:"_separatorStartDrag",value:function(t){this._separatorDragStartTechnicalIndicatorHeight=this._technicalIndicatorSeries[t].height()}},{key:"_separatorDrag",value:function(t,e){this._technicalIndicatorSeries[e].setTempHeight(this._separatorDragStartTechnicalIndicatorHeight-t),this.measureSeriesSize()}},{key:"_measureXAxisHeight",value:function(){var t=this._chartData.styleOptions().xAxis,e=t.axisLine,i=t.tickText,a=t.tickLine,n=0;return t.display&&(e.display&&(n+=e.size),a.display&&(n+=a.length),i.display&&(n+=i.size+i.margin)),n>0&&(n=Math.ceil(Math.max(t.minHeight,Math.min(n,t.maxHeight)))),n}},{key:"_measureYAxisWidth",value:function(){var t=this._chartData.styleOptions().yAxis,e=t.tickText,i=0;return t.display&&(t.axisLine.display&&(i+=t.axisLine.size),t.tickLine.display&&(i+=t.tickLine.length),t.tickText.display&&(i+=e.margin+6*(e.size-2))),i>0&&(i=Math.ceil(Math.max(t.minWidth,Math.min(i,t.maxWidth)))),i}},{key:"_measureSeparatorHeight",value:function(){return this._chartData.styleOptions().separator.size*this._separatorSeries.length}},{key:"_updateSeries",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J;if(t!==q){this._xAxisSeries.invalidate(t),this._candleStickSeries.invalidate(t);var e=!0,i=!1,a=void 0;try{for(var n,r=this._technicalIndicatorSeries[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){var s=n.value;s.invalidate(t)}}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}}this._candleStickSeries.invalidate(t)}},{key:"_calcAllSeriesTechnicalIndicator",value:function(){var t=[];this._candleStickSeries.chartType()===w.CANDLE_STICK?t.push(this._candleStickSeries.technicalIndicatorType()):this._chartData.calcTechnicalIndicator(R.AVERAGE);var e=!0,i=!1,a=void 0;try{for(var n,r=this._technicalIndicatorSeries[Symbol.iterator]();!(e=(n=r.next()).done);e=!0){var s=n.value.technicalIndicatorType();0>t.indexOf(s)&&t.push(s)}}catch(t){i=!0,a=t}finally{try{e||null==r.return||r.return()}finally{if(i)throw a}}for(var o=0,c=t;c.length>o;o++){this._chartData.calcTechnicalIndicator(c[o])}this._updateSeries()}},{key:"chartData",value:function(){return this._chartData}},{key:"measureSeriesSize",value:function(){var t=this._chartData.styleOptions().yAxis,e=t.position===m,i=t.tickText.position===M,a=this._chartContainer.offsetWidth,n=this._chartContainer.offsetHeight,r=this._measureSeparatorHeight(),s=this._measureXAxisHeight(),o=this._measureYAxisWidth(),c=n-s-r,h=a-(i?o:0),l=a-o,_=0;e&&(l=0,i&&(_=o));var u=0,d=!0,v=!1,p=void 0;try{for(var f,y=this._technicalIndicatorSeries[Symbol.iterator]();!(d=(f=y.next()).done);d=!0){u+=f.value.height()}}catch(t){v=!0,p=t}finally{try{d||null==y.return||y.return()}finally{if(v)throw p}}var x=c-u;this._chartData.setTotalDataSpace(h);var g={};g.contentLeft=_,g.contentRight=_+h;var k={};k[he]={contentTop:0,contentBottom:x};var D=x,w=x;this._candleStickSeries.setSize({left:_,width:h,height:x},{left:l,width:o,height:x});for(var S=0;this._technicalIndicatorSeries.length>S;S++){var T=this._technicalIndicatorSeries[S],E=this._separatorSeries[S],L=T.height();T.setSize({left:_,width:h,height:L},{left:l,width:o,height:L}),E.setSize(_,h),w+=L,k[T.tag()]={contentTop:D,contentBottom:w},D=w}g.tags=k,this._xAxisSeries.setSize({left:_,width:h,height:s},{left:l,width:o,height:s}),this._chartEvent.setSeriesSize(g)}},{key:"applyStyleOptions",value:function(t){this._chartData.applyStyleOptions(t),this.measureSeriesSize()}},{key:"applyTechnicalIndicatorParams",value:function(t,e){if(this._chartData.applyTechnicalIndicatorParams(t,e),this._chartData.calcTechnicalIndicator(t)){this._candleStickSeries.technicalIndicatorType()===t&&this._candleStickSeries.invalidate(J);var i=!0,a=!1,n=void 0;try{for(var r,s=this._technicalIndicatorSeries[Symbol.iterator]();!(i=(r=s.next()).done);i=!0){var o=r.value;o.technicalIndicatorType()===t&&o.invalidate(J)}}catch(t){a=!0,n=t}finally{try{i||null==s.return||s.return()}finally{if(a)throw n}}}}},{key:"applyNewData",value:function(t,e){d(t)&&(this._chartData.clearDataList(),this._chartData.addData(t,0,e),this._calcAllSeriesTechnicalIndicator())}},{key:"applyMoreData",value:function(t,e){d(t)&&(this._chartData.addData(t,0,e),this._calcAllSeriesTechnicalIndicator())}},{key:"updateData",value:function(t){if(p(t)&&!d(t)){var e=this._chartData.dataList(),i=e.length,a=i;+X(t,"timestamp",0)===+X(e[i-1],"timestamp",0)&&(a=i-1),this._chartData.addData(t,a),this._calcAllSeriesTechnicalIndicator()}}},{key:"setCandleStickSeriesType",value:function(t){this._candleStickSeries.setChartType(t)}},{key:"createTechnicalIndicator",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,i=this._technicalIndicatorSeries.length;this._separatorSeries.push(new re(this._chartContainer,this._chartData,i,{startDrag:this._separatorStartDrag.bind(this),drag:this._separatorDrag.bind(this)})),this._technicalIndicatorBaseId++;var a="".concat("technical_indicator_").concat(this._technicalIndicatorBaseId),n=new mt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:t,tag:a});return n.setTempHeight(e),this._technicalIndicatorSeries.push(n),this.measureSeriesSize(),a}},{key:"removeTechnicalIndicator",value:function(t){for(var e=-1,i=0;this._technicalIndicatorSeries.length>i;i++){if(this._technicalIndicatorSeries[i].tag()===t){e=i;break}}if(-1!==e){this._technicalIndicatorSeries[e].destroy(),this._separatorSeries[e].destroy(),delete this._technicalIndicatorSeries[e],delete this._separatorSeries[e];for(var a=0;this._separatorSeries.length>a;a++)this._separatorSeries[a].updateSeriesIndex(a);this.measureSeriesSize()}}},{key:"setTechnicalIndicatorType",value:function(t,e){if(t===he)this._candleStickSeries.setTechnicalIndicatorType(e);else{var i,a=!0,n=!1,r=void 0;try{for(var s,o=this._technicalIndicatorSeries[Symbol.iterator]();!(a=(s=o.next()).done);a=!0){var c=s.value;if(c.tag()===t){i=c;break}}}catch(t){n=!0,r=t}finally{try{a||null==o.return||o.return()}finally{if(n)throw r}}i&&(e===R.NO?this.removeTechnicalIndicator(t):i.setTechnicalIndicatorType(e))}}},{key:"getConvertPictureUrl",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"jpeg";if("png"!==i&&"jpeg"!==i&&"bmp"!==i)throw Error("Picture format only supports jpeg, png and bmp!!!");var a=document.createElement("canvas"),n=a.getContext("2d"),r=tt(n),s=this._chartContainer.offsetWidth,o=this._chartContainer.offsetHeight;a.style.width="".concat(s,"px"),a.style.height="".concat(o,"px"),a.width=s*r,a.height=o*r,n.scale(r,r);var c=0,h=this._candleStickSeries.height();n.drawImage(this._candleStickSeries.getImage(t,e),0,c,s,h),n.drawImage(this._candleStickSeries.getImage(t,e),0,c,s,h),c+=h;for(var l=0;this._separatorSeries.length>l;l++){var _=this._separatorSeries[l],u=_.height(),d=this._technicalIndicatorSeries[l],v=d.height();n.drawImage(_.getImage(),0,c,s,u),c+=u,n.drawImage(d.getImage(t),0,c,s,v),c+=v}return n.drawImage(this._xAxisSeries.getImage(t),0,c,s,this._xAxisSeries.height()),a.toDataURL("image/".concat(i))}},{key:"destroy",value:function(){this._candleStickSeries.destroy(),this._technicalIndicatorSeries.forEach((function(t){t.destroy()})),this._separatorSeries.forEach((function(t){t.destroy()})),this._xAxisSeries.destroy(),this._container.removeChild(this._chartContainer),this._chartEvent.destroy()}}]),t}(),_e=function(){function t(e,a){i(this,t),this._chartSeries=new le(e,a)}return n(t,[{key:"setStyleOptions",value:function(t){this._chartSeries.applyStyleOptions(t)}},{key:"getStyleOptions",value:function(){return this._chartSeries.chartData().styleOptions()}},{key:"setTechnicalIndicatorParams",value:function(t,e){this._chartSeries.applyTechnicalIndicatorParams(t,e)}},{key:"getTechnicalIndicatorParamOptions",value:function(){this._chartSeries.chartData().technicalIndicatorParamOptions()}},{key:"setPrecision",value:function(t,e){this._chartSeries.chartData().applyPrecision(t,e)}},{key:"setTimezone",value:function(t){this._chartSeries.chartData().setTimezone(t)}},{key:"resize",value:function(){this._chartSeries.chartData().adjustFromTo(),this._chartSeries.measureSeriesSize()}},{key:"setOffsetRightSpace",value:function(t){this._chartSeries.chartData().setOffsetRightSpace(t)}},{key:"setDataSpace",value:function(t){this._chartSeries.chartData().setDataSpace(t)}},{key:"clearData",value:function(){this._chartSeries.chartData().clearDataList()}},{key:"getDataList",value:function(){return this._chartSeries.chartData().dataList()}},{key:"applyNewData",value:function(t,e){this._chartSeries.applyNewData(t,e)}},{key:"applyMoreData",value:function(t,e){this._chartSeries.applyMoreData(t,e)}},{key:"updateData",value:function(t){this._chartSeries.updateData(t)}},{key:"loadMore",value:function(t){this._chartSeries.chartData().loadMore(t)}},{key:"setCandleStickChartType",value:function(t){this._chartSeries.setCandleStickSeriesType(t)}},{key:"setCandleStickTechnicalIndicatorType",value:function(t){this._chartSeries.setTechnicalIndicatorType(he,t)}},{key:"setTechnicalIndicatorType",value:function(t,e){this._chartSeries.setTechnicalIndicatorType(t,e)}},{key:"addTechnicalIndicator",value:function(t,e){return this._chartSeries.createTechnicalIndicator(t,e)}},{key:"removeTechnicalIndicator",value:function(t){this._chartSeries.removeTechnicalIndicator(t)}},{key:"addGraphicMark",value:function(t){var e=this._chartSeries.chartData().graphicMarkType();if(e!==t){var i=this._chartSeries.chartData().graphicMarkData(),a=i[e];a&&d(a)&&(a.splice(a.length-1,1),i[e]=a),i.hasOwnProperty(t)||(t=$.NONE),this._chartSeries.chartData().setGraphicMarkType(t),this._chartSeries.chartData().setGraphicMarkData(i)}}},{key:"removeAllGraphicMark",value:function(){var t=this._chartSeries.chartData().graphicMarkData(),e={};Object.keys(t).forEach((function(t){e[t]=[]})),this._chartSeries.chartData().setGraphicMarkType($.NONE),this._chartSeries.chartData().setGraphicMarkData(e)}},{key:"getConvertPictureUrl",value:function(t,e,i){return this._chartSeries.getConvertPictureUrl(t,e,i)}},{key:"destroy",value:function(){this._chartSeries.destroy()}}]),t}(),ue={},de=1,ve="Chart version is 5.0.0. Root dom is null, can not initialize the chart!!!";t.dispose=function(t){var e;t&&("string"==typeof t&&(e=(t=document.getElementById(t)||document.getElementsByClassName(t)).chart_id),e||(e=t.chart_id),!e&&t instanceof _e&&(e=t.id),e&&(ue[e].destroy(),delete ue[e]))},t.init=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t;if(!i)throw Error(ve);if("string"==typeof i&&(i=document.getElementById(t)||document.getElementsByClassName(t)),!i)throw Error(ve);var a=ue[i.chart_id||""];if(a)return a;var n="k_line_chart_".concat(de++),r=new _e(i,e);return r.id=n,i.chart_id=n,ue[n]=r,r},t.version=function(){return"5.0.0"},Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/src/view/View.js b/src/view/View.js index c436cf3df..f24e84d4d 100644 --- a/src/view/View.js +++ b/src/view/View.js @@ -47,18 +47,20 @@ class View { * @param height */ setSize (width, height) { - this._redraw(() => { - const pixelRatio = getPixelRatio(this._ctx) - this._width = width - this._height = height - this._canvas.style.top = '0' - this._canvas.style.width = `${width}px` - this._canvas.style.height = `${height}px` - this._canvas.width = width * pixelRatio - this._canvas.height = height * pixelRatio - this._ctx.scale(pixelRatio, pixelRatio) - // this._ctx.translate(0.5, 0.5) - }) + if (this._width !== width || this._height !== height) { + this._redraw(() => { + const pixelRatio = getPixelRatio(this._ctx) + this._width = width + this._height = height + this._canvas.style.top = '0' + this._canvas.style.width = `${width}px` + this._canvas.style.height = `${height}px` + this._canvas.width = width * pixelRatio + this._canvas.height = height * pixelRatio + this._ctx.scale(pixelRatio, pixelRatio) + // this._ctx.translate(0.5, 0.5) + }) + } } /**