From 73556a04ab8bfc191efda4d1332c0a76d71da76b Mon Sep 17 00:00:00 2001 From: lihu Date: Thu, 9 Apr 2020 01:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/klinecharts.development.js | 9 +++++++-- dist/klinecharts.development.js.map | 2 +- dist/klinecharts.production.min.js | 2 +- src/data/ChartData.js | 4 ++-- src/series/ChartSeries.js | 8 ++++++++ types/index.d.ts | 2 +- 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dist/klinecharts.development.js b/dist/klinecharts.development.js index faaa972bf..9793d8d9d 100644 --- a/dist/klinecharts.development.js +++ b/dist/klinecharts.development.js @@ -2334,7 +2334,7 @@ var GraphicMarkType = { FIBONACCI_LINE: 'fibonacciLine' }; var MAX_DATA_SPACE = 30; -var MIN_DATA_SPACE = 2; +var MIN_DATA_SPACE = 3; var ChartData = /*#__PURE__*/ @@ -2372,7 +2372,7 @@ function () { this._range = 0; // 每一条数据的空间 - this._dataSpace = 4; // bar的空间 + this._dataSpace = 8; // bar的空间 this._barSpace = this._calcBarSpace(); // 十字光标位置 @@ -10278,6 +10278,11 @@ function () { key: "createTechnicalIndicator", value: function createTechnicalIndicator(technicalIndicatorType) { var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT; + + if (!technicalIndicatorType || !TechnicalIndicatorType.hasOwnProperty(technicalIndicatorType) || technicalIndicatorType === TechnicalIndicatorType.NO || technicalIndicatorType === TechnicalIndicatorType.AVERAGE) { + technicalIndicatorType = TechnicalIndicatorType.MACD; + } + var technicalIndicatorSeriesCount = this._technicalIndicatorSeries.length; this._separatorSeries.push(new SeparatorSeries(this._chartContainer, this._chartData, technicalIndicatorSeriesCount, { diff --git a/dist/klinecharts.development.js.map b/dist/klinecharts.development.js.map index 112f52b6c..67e2baf08 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/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 {{PERCENTAGE: string, NORMAL: string}}\n */\nexport const YAxisType = {\n NORMAL: 'normal',\n PERCENTAGE: 'percentage'\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 * y轴类型\n */\n type: YAxisType.NORMAL,\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 point: {\n display: true,\n radius: 3\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 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 const rateBarSpace = Math.floor(this._dataSpace * 0.8)\n const floorBarSpace = Math.floor(this._dataSpace)\n const optimalBarSpace = Math.min(rateBarSpace, floorBarSpace - 1)\n return Math.max(1, optimalBarSpace)\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 + 0.5, y, halfBarSpace * 2 - 1, 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.fillStyle = upColor\n } else if (close < preClose) {\n this._ctx.fillStyle = downColor\n } else {\n this._ctx.fillStyle = noChangeColor\n }\n this._ctx.fillRect(x - 0.5, highY, 1, lowY - highY)\n this._ctx.fillRect(x - halfBarSpace, openY - 0.5, halfBarSpace, 1)\n this._ctx.fillRect(x, closeY - 0.5, halfBarSpace, 1)\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 floatLayerPromptTechnicalIndicatorPoint = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.point\n if (!floatLayerPromptTechnicalIndicatorPoint.display) {\n return\n }\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 const radius = floatLayerPromptTechnicalIndicatorPoint.radius\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, radius, 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 { 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 - 1\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 this._ctx.fillText(tick.v, 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 let text\n if (this._yAxis.isPercentageYAxis()) {\n const fromClose = dataList[this._chartData.from()].close\n text = `${((lastPrice - fromClose) / fromClose * 100).toFixed(2)}%`\n } else {\n text = formatPrecision(lastPrice, this._chartData.precisionOptions().price)\n }\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'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\n\nexport default class YAxisFloatLayerView extends View {\n constructor (container, chartData, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\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._yAxis.convertFromPixel(crossHairPoint.y)\n let yAxisDataLabel\n if (this._yAxis.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n yAxisDataLabel = `${((value - fromClose) / fromClose * 100).toFixed(2)}%`\n } else {\n const precision = this._chartData.precisionOptions()[this._yAxis.isCandleStickYAxis() ? 'price' : this._additionalDataProvider.technicalIndicatorType()]\n yAxisDataLabel = formatPrecision(value, precision)\n }\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 { formatBigNumber, formatValue } from '../utils/format'\nimport { YAxisType } from '../data/options/styleOptions'\n\nexport default class YAxis extends Axis {\n constructor (chartData, isCandleStickYAxis) {\n super(chartData)\n this._isCandleStickYAxis = isCandleStickYAxis\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 // 保证每次图形绘制上下都留间隙\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._innerConvertToPixel(+ticks[0].v)\n let tickCountDif = 1\n if (tickLength > 1) {\n const nextY = this._innerConvertToPixel(+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 const isPercentageAxis = this.isPercentageYAxis()\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const v = ticks[i].v\n const y = this._innerConvertToPixel(+v)\n if (y > textHeight &&\n y < this._height - textHeight) {\n optimalTicks.push({ v: isPercentageAxis ? `${(+v).toFixed(2)}%` : formatBigNumber(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 const minValueString = minMaxArray[0].toString()\n const minValueDotIndex = minValueString.indexOf('.') + 1\n let minValuePrecision = 0\n if (minValueDotIndex > 0) {\n minValuePrecision = minValueString.length - minValueDotIndex\n }\n\n const maxValueString = minMaxArray[1].toString()\n const maxValueDotIndex = maxValueString.indexOf('.') + 1\n let maxValuePrecision = 0\n if (maxValueDotIndex > 0) {\n maxValuePrecision = maxValueString.length - maxValueDotIndex\n }\n\n const precision = Math.min(minValuePrecision, maxValuePrecision)\n const temp = Math.pow(10, precision)\n minMaxArray[0] = Math.round(minMaxArray[0] * temp) / temp\n minMaxArray[1] = Math.round(minMaxArray[1] * temp) / temp\n if (this.isPercentageYAxis()) {\n const fromClose = dataList[from].close\n this._minValue = (minMaxArray[0] - fromClose) / fromClose * 100\n this._maxValue = (minMaxArray[1] - fromClose) / fromClose * 100\n if (this._minValue === this._maxValue) {\n this._minValue -= 10\n this._minValue += 10\n }\n } else {\n this._minValue = minMaxArray[0]\n this._maxValue = minMaxArray[1]\n if (this._minValue === this._maxValue) {\n this._minValue -= 1\n if (this._minValue < 0) {\n this._minValue = 0\n this._maxValue += this._maxValue\n } else {\n this._maxValue += 1\n }\n }\n }\n }\n }\n\n _innerConvertToPixel (value) {\n return Math.round((1.0 - (value - this._minValue) / this._range) * this._height)\n }\n\n isCandleStickYAxis () {\n return this._isCandleStickYAxis\n }\n\n /**\n * 是否是蜡烛图y轴组件\n * @returns {boolean}\n */\n isPercentageYAxis () {\n return this._isCandleStickYAxis && this._chartData.styleOptions().yAxis.type === YAxisType.PERCENTAGE\n }\n\n convertFromPixel (pixel) {\n const yAxisValue = (1.0 - pixel / this._height) * this._range + this._minValue\n if (this.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n return fromClose * yAxisValue / 100 + fromClose\n }\n return yAxisValue\n }\n\n convertToPixel (value) {\n let realValue = value\n if (this.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n realValue = (value - fromClose) / fromClose * 100\n }\n return this._innerConvertToPixel(realValue)\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 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, false)\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 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.fillRect(x - 0.5, highLine[0], 1, highLine[1] - highLine[0])\n this._ctx.fillRect(x - 0.5, lowLine[0], 1, lowLine[1] - lowLine[0])\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] + 0.5, rect[1], rect[2] - 1, rect[3])\n break\n }\n case CandleStickStyle.UP_STROKE: {\n if (close > preClose) {\n this._ctx.strokeRect(rect[0] + 0.5, rect[1], rect[2] - 1, 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 > 0 && x < this._seriesSize.contentRight - this._seriesSize.contentLeft\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,\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 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, true)\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 View from './View'\n\nimport { formatDate } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\n\nexport default class XAxisFloatLayerView extends View {\n constructor (container, chartData, xAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\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._xAxis.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._xAxis.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 return (value - this._chartData.from()) * this._chartData.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._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.cursor = 'ns-resize'\n this._element.style.position = 'absolute'\n this._element.style.zIndex = '20'\n this._element.style.height = '5px'\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 event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseUpEvent(event)\n }\n\n _mouseLeaveEvent (event) {\n if (this._checkZoomDrag()) {\n event.localX -= this._seriesSize.contentLeft\n this._zoomDragEventHandler.mouseLeaveEvent(event)\n }\n }\n\n _mouseMoveEvent (event) {\n event.localX -= this._seriesSize.contentLeft\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 event.localX -= this._seriesSize.contentLeft\n this._zoomDragEventHandler.mouseClickEvent(event)\n }\n }\n\n _mouseDownEvent (event) {\n event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseDownEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseDownEvent(event)\n }\n }\n\n _mouseRightDownEvent (event) {\n event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseRightDownEvent(event)\n }\n\n _pressedMouseMoveEvent (event) {\n event.localX -= this._seriesSize.contentLeft\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 event.localX -= this._seriesSize.contentLeft\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._seriesSize = 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.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._container.offsetWidth\n const seriesHeight = this._container.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","YAxisType","NORMAL","PERCENTAGE","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","point","radius","defaultGraphicMark","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","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","rateBarSpace","floorBarSpace","optimalBarSpace","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","floatLayerPromptTechnicalIndicatorPoint","valueSize","join","indicatorData","label","decimal","precisionOptions","index","TechnicalIndicatorWidget","YAxisView","yAxisOptions","_drawAxisLine","_drawTickLines","_drawTickLabels","_drawLastPriceLabel","_isDrawFromStart","tickLineLength","tickLineDisplay","tickTextMargin","textAlign","lastPriceMark","lastPrice","preLastPrice","priceY","priceMarkText","isPercentageYAxis","fromClose","rectWidth","rectHeight","rectStartX","YAxisFloatLayerView","_drawCrossHairLabel","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","YAxis","_isCandleStickYAxis","minMaxArray","keys","optimalTicks","tickLength","textHeight","_innerConvertToPixel","tickCountDif","nextY","isPercentageAxis","isRealTime","isShowAverageLine","minCompareArray","maxCompareArray","apply","_compareMinMax","minValueString","minValueDotIndex","minValuePrecision","maxValueString","maxValueDotIndex","maxValuePrecision","temp","round","pixel","yAxisValue","realValue","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","contentRight","contentLeft","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,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QAAT;;;QAEE,CAACnqB,EAAL,EAAS;MACPA,EAAE,GAAGwqB,GAAG,CAACL,QAAT;;;QAEE,CAACnqB,EAAD,IAAOwqB,GAAG,YAAY7B,KAA1B,EAAiC;MAC/B3oB,EAAE,GAAGwqB,GAAG,CAACxqB,EAAT;;;QAEEA,EAAJ,EAAQ;MACN0pB,SAAS,CAAC1pB,EAAD,CAAT,CAAcoiB,OAAd;aACOsH,SAAS,CAAC1pB,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/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 {{PERCENTAGE: string, NORMAL: string}}\n */\nexport const YAxisType = {\n NORMAL: 'normal',\n PERCENTAGE: 'percentage'\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 * y轴类型\n */\n type: YAxisType.NORMAL,\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 point: {\n display: true,\n radius: 3\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 MAX_DATA_SPACE = 30\nconst MIN_DATA_SPACE = 3\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 = 8\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 const rateBarSpace = Math.floor(this._dataSpace * 0.8)\n const floorBarSpace = Math.floor(this._dataSpace)\n const optimalBarSpace = Math.min(rateBarSpace, floorBarSpace - 1)\n return Math.max(1, optimalBarSpace)\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 + 0.5, y, halfBarSpace * 2 - 1, 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.fillStyle = upColor\n } else if (close < preClose) {\n this._ctx.fillStyle = downColor\n } else {\n this._ctx.fillStyle = noChangeColor\n }\n this._ctx.fillRect(x - 0.5, highY, 1, lowY - highY)\n this._ctx.fillRect(x - halfBarSpace, openY - 0.5, halfBarSpace, 1)\n this._ctx.fillRect(x, closeY - 0.5, halfBarSpace, 1)\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 floatLayerPromptTechnicalIndicatorPoint = this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.point\n if (!floatLayerPromptTechnicalIndicatorPoint.display) {\n return\n }\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 const radius = floatLayerPromptTechnicalIndicatorPoint.radius\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, radius, 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 { 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 - 1\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 this._ctx.fillText(tick.v, 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 let text\n if (this._yAxis.isPercentageYAxis()) {\n const fromClose = dataList[this._chartData.from()].close\n text = `${((lastPrice - fromClose) / fromClose * 100).toFixed(2)}%`\n } else {\n text = formatPrecision(lastPrice, this._chartData.precisionOptions().price)\n }\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'\nimport { calcTextWidth, getFont } from '../utils/canvas'\nimport { formatPrecision } from '../utils/format'\nimport { YAxisPosition, YAxisTextPosition } from '../data/options/styleOptions'\n\nexport default class YAxisFloatLayerView extends View {\n constructor (container, chartData, yAxis, additionalDataProvider) {\n super(container, chartData)\n this._yAxis = yAxis\n this._additionalDataProvider = additionalDataProvider\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\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._yAxis.convertFromPixel(crossHairPoint.y)\n let yAxisDataLabel\n if (this._yAxis.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n yAxisDataLabel = `${((value - fromClose) / fromClose * 100).toFixed(2)}%`\n } else {\n const precision = this._chartData.precisionOptions()[this._yAxis.isCandleStickYAxis() ? 'price' : this._additionalDataProvider.technicalIndicatorType()]\n yAxisDataLabel = formatPrecision(value, precision)\n }\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 { formatBigNumber, formatValue } from '../utils/format'\nimport { YAxisType } from '../data/options/styleOptions'\n\nexport default class YAxis extends Axis {\n constructor (chartData, isCandleStickYAxis) {\n super(chartData)\n this._isCandleStickYAxis = isCandleStickYAxis\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 // 保证每次图形绘制上下都留间隙\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._innerConvertToPixel(+ticks[0].v)\n let tickCountDif = 1\n if (tickLength > 1) {\n const nextY = this._innerConvertToPixel(+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 const isPercentageAxis = this.isPercentageYAxis()\n for (let i = 0; i < tickLength; i += tickCountDif) {\n const v = ticks[i].v\n const y = this._innerConvertToPixel(+v)\n if (y > textHeight &&\n y < this._height - textHeight) {\n optimalTicks.push({ v: isPercentageAxis ? `${(+v).toFixed(2)}%` : formatBigNumber(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 const minValueString = minMaxArray[0].toString()\n const minValueDotIndex = minValueString.indexOf('.') + 1\n let minValuePrecision = 0\n if (minValueDotIndex > 0) {\n minValuePrecision = minValueString.length - minValueDotIndex\n }\n\n const maxValueString = minMaxArray[1].toString()\n const maxValueDotIndex = maxValueString.indexOf('.') + 1\n let maxValuePrecision = 0\n if (maxValueDotIndex > 0) {\n maxValuePrecision = maxValueString.length - maxValueDotIndex\n }\n\n const precision = Math.min(minValuePrecision, maxValuePrecision)\n const temp = Math.pow(10, precision)\n minMaxArray[0] = Math.round(minMaxArray[0] * temp) / temp\n minMaxArray[1] = Math.round(minMaxArray[1] * temp) / temp\n if (this.isPercentageYAxis()) {\n const fromClose = dataList[from].close\n this._minValue = (minMaxArray[0] - fromClose) / fromClose * 100\n this._maxValue = (minMaxArray[1] - fromClose) / fromClose * 100\n if (this._minValue === this._maxValue) {\n this._minValue -= 10\n this._minValue += 10\n }\n } else {\n this._minValue = minMaxArray[0]\n this._maxValue = minMaxArray[1]\n if (this._minValue === this._maxValue) {\n this._minValue -= 1\n if (this._minValue < 0) {\n this._minValue = 0\n this._maxValue += this._maxValue\n } else {\n this._maxValue += 1\n }\n }\n }\n }\n }\n\n _innerConvertToPixel (value) {\n return Math.round((1.0 - (value - this._minValue) / this._range) * this._height)\n }\n\n isCandleStickYAxis () {\n return this._isCandleStickYAxis\n }\n\n /**\n * 是否是蜡烛图y轴组件\n * @returns {boolean}\n */\n isPercentageYAxis () {\n return this._isCandleStickYAxis && this._chartData.styleOptions().yAxis.type === YAxisType.PERCENTAGE\n }\n\n convertFromPixel (pixel) {\n const yAxisValue = (1.0 - pixel / this._height) * this._range + this._minValue\n if (this.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n return fromClose * yAxisValue / 100 + fromClose\n }\n return yAxisValue\n }\n\n convertToPixel (value) {\n let realValue = value\n if (this.isPercentageYAxis()) {\n const fromClose = this._chartData.dataList()[this._chartData.from()].close\n realValue = (value - fromClose) / fromClose * 100\n }\n return this._innerConvertToPixel(realValue)\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 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, false)\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 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.fillRect(x - 0.5, highLine[0], 1, highLine[1] - highLine[0])\n this._ctx.fillRect(x - 0.5, lowLine[0], 1, lowLine[1] - lowLine[0])\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] + 0.5, rect[1], rect[2] - 1, rect[3])\n break\n }\n case CandleStickStyle.UP_STROKE: {\n if (close > preClose) {\n this._ctx.strokeRect(rect[0] + 0.5, rect[1], rect[2] - 1, 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 > 0 && x < this._seriesSize.contentRight - this._seriesSize.contentLeft\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,\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 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, true)\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 View from './View'\n\nimport { formatDate } from '../utils/format'\nimport { calcTextWidth, getFont } from '../utils/canvas'\n\nexport default class XAxisFloatLayerView extends View {\n constructor (container, chartData, xAxis) {\n super(container, chartData)\n this._xAxis = xAxis\n }\n\n _draw () {\n this._drawCrossHairLabel()\n }\n\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._xAxis.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._xAxis.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 return (value - this._chartData.from()) * this._chartData.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._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.cursor = 'ns-resize'\n this._element.style.position = 'absolute'\n this._element.style.zIndex = '20'\n this._element.style.height = '5px'\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 event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseUpEvent(event)\n }\n\n _mouseLeaveEvent (event) {\n if (this._checkZoomDrag()) {\n event.localX -= this._seriesSize.contentLeft\n this._zoomDragEventHandler.mouseLeaveEvent(event)\n }\n }\n\n _mouseMoveEvent (event) {\n event.localX -= this._seriesSize.contentLeft\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 event.localX -= this._seriesSize.contentLeft\n this._zoomDragEventHandler.mouseClickEvent(event)\n }\n }\n\n _mouseDownEvent (event) {\n event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseDownEvent(event)\n if (this._checkZoomDrag()) {\n this._zoomDragEventHandler.mouseDownEvent(event)\n }\n }\n\n _mouseRightDownEvent (event) {\n event.localX -= this._seriesSize.contentLeft\n this._graphicMarkEventHandler.mouseRightDownEvent(event)\n }\n\n _pressedMouseMoveEvent (event) {\n event.localX -= this._seriesSize.contentLeft\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 event.localX -= this._seriesSize.contentLeft\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._seriesSize = 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.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._container.offsetWidth\n const seriesHeight = this._container.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 if (\n !technicalIndicatorType ||\n !TechnicalIndicatorType.hasOwnProperty(technicalIndicatorType) ||\n technicalIndicatorType === TechnicalIndicatorType.NO ||\n technicalIndicatorType === TechnicalIndicatorType.AVERAGE\n ) {\n technicalIndicatorType = TechnicalIndicatorType.MACD\n }\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","YAxisType","NORMAL","PERCENTAGE","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","point","radius","defaultGraphicMark","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","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","rateBarSpace","floorBarSpace","optimalBarSpace","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","floatLayerPromptTechnicalIndicatorPoint","valueSize","join","indicatorData","label","decimal","precisionOptions","index","TechnicalIndicatorWidget","YAxisView","yAxisOptions","_drawAxisLine","_drawTickLines","_drawTickLabels","_drawLastPriceLabel","_isDrawFromStart","tickLineLength","tickLineDisplay","tickTextMargin","textAlign","lastPriceMark","lastPrice","preLastPrice","priceY","priceMarkText","isPercentageYAxis","fromClose","rectWidth","rectHeight","rectStartX","YAxisFloatLayerView","_drawCrossHairLabel","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","YAxis","_isCandleStickYAxis","minMaxArray","keys","optimalTicks","tickLength","textHeight","_innerConvertToPixel","tickCountDif","nextY","isPercentageAxis","isRealTime","isShowAverageLine","minCompareArray","maxCompareArray","apply","_compareMinMax","minValueString","minValueDotIndex","minValuePrecision","maxValueString","maxValueDotIndex","maxValuePrecision","temp","round","pixel","yAxisValue","realValue","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","contentRight","contentLeft","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","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MACID,QAAJ,EAAc;IACH;MACPE,OAAO,CAACC,IAAR,CAAa,8CAAb;;;WAEKH,QAAP;;;MAEIlqB,EAAE,0BAAmB2pB,MAAM,EAAzB,CAAR;MACMW,KAAK,GAAG,IAAI3B,KAAJ,CAAU1sB,SAAV,EAAqBhf,KAArB,CAAd;EACAqtC,KAAK,CAACtqB,EAAN,GAAWA,EAAX;EACA/D,SAAS,CAACkuB,QAAV,GAAqBnqB,EAArB;EACA0pB,SAAS,CAAC1pB,EAAD,CAAT,GAAgBsqB,KAAhB;SACOA,KAAP;;;;;;;;AAOF,SAASC,OAAT,CAAkBC,GAAlB,EAAuB;MACjBA,GAAJ,EAAS;QACHxqB,EAAJ;;QACI,OAAOwqB,GAAP,KAAe,QAAnB,EAA6B;MAC3BA,GAAG,GAAGztB,QAAQ,CAACitB,cAAT,CAAwBQ,GAAxB,KAAgCztB,QAAQ,CAACktB,sBAAT,CAAgCO,GAAhC,CAAtC;MACAxqB,EAAE,GAAGwqB,GAAG,CAACL,QAAT;;;QAEE,CAACnqB,EAAL,EAAS;MACPA,EAAE,GAAGwqB,GAAG,CAACL,QAAT;;;QAEE,CAACnqB,EAAD,IAAOwqB,GAAG,YAAY7B,KAA1B,EAAiC;MAC/B3oB,EAAE,GAAGwqB,GAAG,CAACxqB,EAAT;;;QAEEA,EAAJ,EAAQ;MACN0pB,SAAS,CAAC1pB,EAAD,CAAT,CAAcoiB,OAAd;aACOsH,SAAS,CAAC1pB,EAAD,CAAhB;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/klinecharts.production.min.js b/dist/klinecharts.production.min.js index a4d69ce19..e337df605 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 u(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)?u(a,n):(e[i]||0===e[i]||!1===e[i])&&(t[i]=e[i])}}function _(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)?_(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,m="dash",g="left",k="right",D="percentage",M="inside",w="outside",S={REAL_TIME:"real_time",CANDLE_STICK:"candle_stick"},T="solid",E="stroke",L="up_stroke",A="down_stroke",I="ohlc",b="always",P="follow_cross",C="standard",R={grid:{display:!0,horizontal:{display:!0,size:1,color:"#393939",style:m,dashValue:[2,2]},vertical:{display:!1,size:1,color:"#393939",style:m,dashValue:[2,2]}},candleStick:{bar:{style:T,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:m,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,type:"normal",position:k,axisLine:{display:!0,color:"#888888",size:1},tickText:{position:w,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:m,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:m,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:b,candleStick:{showType:C,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},point:{display:!0,radius:3}}}},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}}},O={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"},H=(r(y={},O.MA,[5,10,30,60]),r(y,O.VOL,[5,10,20]),r(y,O.MACD,[12,26,9]),r(y,O.BOLL,[20]),r(y,O.KDJ,[9,3,3]),r(y,O.RSI,[6,12,24]),r(y,O.BIAS,[6,12,24]),r(y,O.BRAR,[26]),r(y,O.CCI,[13]),r(y,O.DMI,[14,6]),r(y,O.CR,[26,10,20,40,60]),r(y,O.PSY,[12]),r(y,O.DMA,[10,50,10]),r(y,O.TRIX,[12,20]),r(y,O.OBV,[30]),r(y,O.VR,[24,30]),r(y,O.WR,[13,34,89]),r(y,O.MTM,[6,10]),r(y,O.EMV,[14,9]),r(y,O.SAR,[2,2,20]),y),N=(r(x={price:2,volume:0},O.NO,2),r(x,O.MA,2),r(x,O.VOL,0),r(x,O.MACD,2),r(x,O.BOLL,2),r(x,O.KDJ,2),r(x,O.RSI,2),r(x,O.BIAS,2),r(x,O.BRAR,4),r(x,O.CCI,4),r(x,O.DMI,4),r(x,O.CR,2),r(x,O.PSY,2),r(x,O.DMA,4),r(x,O.TRIX,4),r(x,O.OBV,4),r(x,O.VR,4),r(x,O.WR,4),r(x,O.MTM,4),r(x,O.EMV,4),r(x,O.SAR,2),x),z={};function G(t,e){for(var i=t.length,a=0;i>a;a++)e(a);return t}function Y(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 V(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 F(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 B(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 W(t){return t&&d(t)}function X(t,e){return W(t)&&t.length===e}function j(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}z[O.AVERAGE]=function(t){var e=0,i=0;return G(t,(function(a){e+=t[a].turnover||0,t[a].average=0!==(i+=t[a].volume||0)?e/i:0}))},z[O.MA]=function(t,e){if(!W(e))return t;var i=[],a=e.length;return G(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}))},z[O.VOL]=function(t,e){if(!W(e))return t;var i=[],a=e.length;return G(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}))},z[O.MACD]=function(t,e){if(!X(e,3))return t;var i,a,n=0,r=0,s=0,o=0,c=0;return G(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)}}))},z[O.BOLL]=function(t,e){if(!X(e,1))return t;var i,a,n=0;return G(t,(function(r){n+=t[r].close,e[0]>r?(i=n/(r+1),a=Y(t.slice(0,r+1),i)):(i=(n-=t[r-e[0]].close)/e[0],a=Y(t.slice(r-(e[0]-1),r+1),i)),t[r].boll={up:i+2*a,mid:i,dn:i-2*a}}))},z[O.KDJ]=function(t,e){return X(e,3)?G(t,(function(s){var o=t[s].close;e[0]-1>s?(n=F(t.slice(0,s+1)),r=V(t.slice(0,s+1))):(n=F(t.slice(s-(e[0]-1),s+1)),r=V(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},z[O.RSI]=function(t,e){if(!X(e,3))return t;var i,a,n,s,o,c,h=0,l=0,u=0,_=0,d=0,v=0;return G(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,u+=x,d+=x;else{var m=Math.abs(x);l+=m,_+=m,v+=m}if(e[0]>p)i=h/(p+1),a=(h+l)/(p+1);else{if(p>e[0]){var g=t[p-e[0]].close-t[p-e[0]-1].close;g>0?h-=g:l-=Math.abs(g)}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=u/(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?u-=k:_-=Math.abs(k)}n=u/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}))},z[O.BIAS]=function(t,e){if(!X(e,3))return t;var i,a,n,r=0,s=0,o=0;return G(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}))},z[O.BRAR]=function(t,e){if(!X(e,1))return t;var i=0,a=0,n=0,r=0,s=0,o=0;return G(t,(function(c){var h=t[c].high,l=t[c].low,u=t[c].open;if(s+=h-u,o+=u-l,c>0){var _=t[c-1].close;if(n+=h-_,r+=_-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}}))},z[O.CCI]=function(t,e){if(!X(e,1))return t;var i,a,n=0,r=[],s=0;return G(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}}))},z[O.DMI]=function(t,e){if(!X(e,2))return t;var i=0,a=0,n=0,r=0,s=[0],o=0,c=[0],h=0,l=[0],u=0,_=[0],d=0;return G(t,(function(v){if(v>0){var p=t[v-1].close,f=t[v].high,y=t[v].low,x=f-y,m=Math.abs(f-p),g=Math.abs(y-p),k=f-t[v-1].high,D=t[v-1].low-y,M=Math.max(Math.max(x,m),g);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;u+=S,l.push(S),v>e[0]-1&&(o-=s[v-e[0]],h-=c[v-e[0]],u-=l[v-e[0]]),0===o?(i=0,a=0):(i=100*h/o,a=100*u/o);var T=Math.abs(a-i)/(a+i)*100;if(d+=T,_.push(T),e[1]>v)r=n=d/(v+1);else{var E=_[v-e[1]];r=((n=(d-=E)/e[1])+E)/2}}t[v].dmi={pdi:i,mdi:a,adx:n,adxr:r}}))},z[O.CR]=function(t,e){if(!X(e,5))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=[],u=0,_=[],d=0,v=[],p=0,f=[];return G(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,m=t[y].high-x;0>m&&(m=0),o+=m;var g=x-t[y].low;if(0>g&&(g=0),c+=g,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,u+=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?u/(y+1):(u-=t[y-e[2]].cr.cr)/e[2],_.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?_[0]:_[y-9],ma3:17>y?v[0]:v[y-17],ma4:25>y?f[0]:f[y-25]}}))},z[O.PSY]=function(t,e){if(!X(e,1))return t;var i=0,a=0;return G(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}}))},z[O.DMA]=function(t,e){if(!X(e,3))return t;var i,a,n,r,s=0,o=0,c=0;return G(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}}))},z[O.TRIX]=function(t,e){if(!X(e,2))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=0,u=[];return G(t,(function(_){var d=t[_].close;if(0===_)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,u.push(r),o+=s,i=e[1]>_?o/(_+1):(o-=t[_-e[1]].trix.trix)/e[1],t[_].trix={trix:s,maTrix:i}}))},z[O.OBV]=function(t,e){if(!X(e,1))return t;var i,a,n=0,r=0;return G(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}}))},z[O.VR]=function(t,e){if(!X(e,2))return t;var i,a=0,n=0,r=0,s=0,o=0;return G(t,(function(c){var h=t[c].close,l=t[c].open,u=t[c].volume;if(h>l?a+=u:l>h?n+=u:r+=u,c>e[0]-1){var _=t[c-e[0]].close,d=t[c-e[0]].open,v=t[c-e[0]].volume;_>d?a-=v:d>_?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}}))},z[O.WR]=function(t,e){if(!X(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,u=Number.MIN_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER;return G(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=B(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=B(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)u=Math.max(p,u),_=Math.min(f,_);else{var m=B(t.slice(d-e[2],d));u=m[0],_=m[1]}t[d].wr={wr1:i,wr2:a,wr3:0!==(s=u-_)?(u-v)/s*100:0}}))},z[O.MTM]=function(t,e){if(!X(e,2))return t;var i,a,n=0;return G(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}}))},z[O.EMV]=function(t,e){if(!X(e,2))return t;var i,a=0,n=0,r=0,s=[];return G(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}}))},z[O.SAR]=function(t,e){if(!X(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 G(t,(function(e){var h=c,l=t[e].high,u=t[e].low;if(o){(-100===s||l>s)&&(s=l,r=Math.min(r+a,n)),c=h+r*(s-h);var _=Math.min(t[Math.max(1,e)-1].low,u);c>t[e].low?(c=s,r=i,s=-100,o=!o):c>_&&(c=_)}else{(-100===s||s>u)&&(s=u,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 K="en-us";function Z(t,e,i){if(t&&f(t)){var a,n=new Date(t);try{a=new Intl.DateTimeFormat(K,{hour12:!1,timeZone:i,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}catch(t){a=new Intl.DateTimeFormat(K,{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 U(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 q=1,J=2,$=3,Q={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"},tt=function(){function t(e,a){i(this,t),this._invalidateHandler=a,this._styleOptions=_(R),u(this._styleOptions,e),this._technicalIndicatorParamOptions=_(H),this._precisionOptions=_(N),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=Q.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(j(this._dataList[0],"timestamp")))}},{key:"_calcRange",value:function(){this._range=Math.floor(this._totalDataSpace/this._dataSpace),this.adjustFromTo()}},{key:"_calcBarSpace",value:function(){return Math.max(1,Math.min(Math.floor(.8*this._dataSpace),Math.floor(this._dataSpace)-1))}},{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){u(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[O.MA]=t,this._precisionOptions[O.BOLL]=t,this._precisionOptions[O.SAR]=t),!e&&0!==e||0>e||(this._precisionOptions.volume=e,this._precisionOptions[O.VOL]=e)}},{key:"calcTechnicalIndicator",value:function(t){if(t===O.NO)return!0;var e=z[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(q)}},{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(j(this._dataList[0],"timestamp")),void this._invalidateHandler(q)}else{var i=this._calcRangDif();if(this._from===this._dataList.length-i)return void this._invalidateHandler(q)}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(J)}},{key:"loadMore",value:function(t){this._loadMoreCallback=t}}]),t}();function et(t){return(window.devicePixelRatio||1)/(t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function it(t,e){return t.measureText(e).width}function at(t){return"".concat(t,"px Arial")}function nt(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 rt(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 st(t,e){t.save(),t.lineWidth%2&&t.translate(.5,.5),e(),t.restore()}var ot=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===$&&this._computeAxis(),t!==J&&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=et(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,u=this._yAxisWidgetCell.offsetHeight,_=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),_,0,l,u),i}},{key:"destroy",value:function(){this._container.removeChild(this._element)}}]),t}(),ct=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 q:this._floatLayerView.flush();break;case $:this._mainView.flush(),this._floatLayerView.flush()}}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=et(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 ht=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=et(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}(),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(){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===m&&this._ctx.setLineDash(i.dashValue),this._yAxis.ticks().forEach((function(e){nt(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===m?a.dashValue:[]),this._xAxis.ticks().forEach((function(e){rt(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 O.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 O.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 O.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 u=s.close,_=(c[i-1]||{}||{}).close||u;e._ctx.fillStyle=u>_?r.bar.upColor:_>u?r.bar.downColor:r.bar.noChangeColor,e._drawBars(t,o,h.num,!0)};break;case O.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 O.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 O.BRAR:t=function(t,i,a){var r=a.brar||{};e._prepareLinePoints(t,[r.br,r.ar],n)};break;case O.CCI:t=function(t,i,a){e._prepareLinePoints(t,[(a.cci||{}).cci],n)};break;case O.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 O.DMA:t=function(t,i,a){var r=a.dma||{};e._prepareLinePoints(t,[r.dif,r.difMa],n)};break;case O.DMI:t=function(t,i,a){var r=a.dmi||{};e._prepareLinePoints(t,[r.mdi,r.pdi,r.adx,r.adxr],n)};break;case O.KDJ:t=function(t,i,a){var r=a.kdj||{};e._prepareLinePoints(t,[r.k,r.d,r.j],n)};break;case O.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 O.PSY:t=function(t,i,a){e._prepareLinePoints(t,[(a.psy||{}).psy],n)};break;case O.TRIX:t=function(t,i,a){var r=a.trix||{};e._prepareLinePoints(t,[r.trix,r.maTrix],n)};break;case O.OBV:t=function(t,i,a){var r=a.obv||{};e._prepareLinePoints(t,[r.obv,r.maObv],n)};break;case O.VR:t=function(t,i,a){var r=a.vr||{};e._prepareLinePoints(t,[r.vr,r.maVr],n)};break;case O.WR:t=function(t,i,a){var r=a.wr||{};e._prepareLinePoints(t,[r.wr1,r.wr2,r.wr3],n)};break;case O.MTM:t=function(t,i,a){var r=a.mtm||{};e._prepareLinePoints(t,[r.mtm,r.mtmMa],n)};break;case O.EMV:t=function(t,i,a){var r=a.emv||{};e._prepareLinePoints(t,[r.emv,r.maEmv],n)};break;case O.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 u=this._chartData.dataList();o||this._drawOhlc(i,e,n,u[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,st(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+.5,s,2*e-1,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),u=this._yAxis.convertToPixel(i.low),_=(a||{}).close||o;this._ctx.fillStyle=o>_?n:_>o?r:s,this._ctx.fillRect(e-.5,l,1,u-l),this._ctx.fillRect(e-t,c-.5,t,1),this._ctx.fillRect(e,h-.5,t,1)}},{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}(ht),ut=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===b||n===P&&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===m&&this._ctx.setLineDash(i.dashValue),nt(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===m&&this._ctx.setLineDash(n.dashValue),rt(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,u=a.size,_=a.color,d=e.length;this._ctx.textBaseline="top",this._ctx.font=at(u);var v=it(this._ctx,n);this._ctx.fillStyle=_,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=it(this._ctx,f);this._ctx.fillStyle=e[p%d]||_,this._ctx.fillText(f,h,l),h+=o+c+y}}},{key:"_drawTechnicalIndicatorPromptPoint",value:function(t,e,i){var a=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.point;if(a.display){var n=this._additionalDataProvider.technicalIndicatorType();if(this._chartData.crossHairSeriesTag()&&n!==O.SAR)for(var r=e.length,s=n===O.MACD||n===O.VOL?t.length-1:t.length,o=a.radius,c=0;s>c;c++){var h=t[c];if(h||0===h){var l=this._yAxis.convertToPixel(h);this._ctx.fillStyle=e[c%r],this._ctx.beginPath(),this._ctx.arc(i,l,o,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 O.MA:i.forEach((function(t){n.push("ma".concat(t))}));break;case O.VOL:i.forEach((function(t){n.push("ma".concat(t))})),n.push("num");break;case O.MACD:n=["diff","dea","macd"];break;case O.BOLL:n=["up","mid","dn"];break;case O.BIAS:i.forEach((function(t){n.push("bias".concat(t))}));break;case O.BRAR:n=["br","ar"];break;case O.CCI:n=["cci"];break;case O.CR:n=["cr","ma1","ma2","ma3","ma4"];break;case O.DMA:n=["dif","difMa"];break;case O.DMI:n=["mdi","pdi","adx","adxr"];break;case O.KDJ:n=["k","d","j"];break;case O.RSI:i.forEach((function(t){n.push("rsi".concat(t))}));break;case O.PSY:n=["psy"];break;case O.TRIX:n=["trix","maTrix"];break;case O.OBV:n=["obv","maObv"];break;case O.VR:n=["vr","maVr"];break;case O.WR:n=["wr1","wr2","wr3"];break;case O.MTM:n=["mtm","mtmMa"];break;case O.EMV:n=["emv","maEmv"];break;case O.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=j(t,e.toLowerCase());n.forEach((function(t){a.push(j(s,t))}));var o=this._chartData.precisionOptions()[e];a.forEach((function(t,e){a[e]=U(t,o)}))}return{labels:n,values:a,name:r}}}]),e}(ht),_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 lt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createFloatLayerView",value:function(t,e){return new ut(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}}]),e}(ct),dt=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-1,rt(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){nt(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=at(c),this._ctx.fillStyle=i.color,this._yAxis.ticks().forEach((function(t){e._ctx.fillText(t.v,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,l=i.text;if(this._yAxis.isPercentageYAxis()){var u=a[this._chartData.from()].close;h="".concat(((s-u)/u*100).toFixed(2),"%")}else h=U(s,this._chartData.precisionOptions().price);var _=i.text.size;this._ctx.font=at(_);var d,v=it(this._ctx,h)+l.paddingLeft+l.paddingRight,p=l.paddingTop+_+l.paddingBottom;d=this._isDrawFromStart(t)?0:this._width-v,this._ctx.fillStyle=r,this._ctx.fillRect(d,c-l.paddingTop-_/2,v,p),this._ctx.fillStyle=l.color,this._ctx.textBaseline="middle",this._ctx.fillText(h,d+l.paddingLeft,c)}}}},{key:"_isDrawFromStart",value:function(t){return t.position===g&&t.tickText.position===M||t.position===k&&t.tickText.position===w}}]),e}(ht),vt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._yAxis=n,s._additionalDataProvider=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawCrossHairLabel()}},{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,r=this._yAxis.convertFromPixel(a.y);if(this._yAxis.isPercentageYAxis()){var s=this._chartData.dataList()[this._chartData.from()].close;n="".concat(((r-s)/s*100).toFixed(2),"%")}else{n=U(r,this._chartData.precisionOptions()[this._yAxis.isCandleStickYAxis()?"price":this._additionalDataProvider.technicalIndicatorType()])}var o=i.size;this._ctx.font=at(o);var c,h=it(this._ctx,n),l=i.paddingLeft,u=i.paddingTop,_=i.borderSize,d=h+2*_+l+i.paddingRight,v=o+2*_+u+i.paddingBottom,p=this._chartData.styleOptions().yAxis;c=p.position===g&&p.tickText.position===M||p.position===k&&p.tickText.position===w?0:this._width-d;var f=a.y-_-u-o/2;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(c,f,d,v),this._ctx.lineWidth=_,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(c,f,d,v),this._ctx.textBaseline="middle",this._ctx.fillStyle=i.color,this._ctx.fillText(n,c+_+l,a.y)}}}}}]),e}(ht),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 dt(t,e.chartData,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new vt(t,e.chartData,e.yAxis,e.additionalDataProvider)}}]),e}(ct),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=function(t){function e(t,a){var n;return i(this,e),(n=h(this,o(e).call(this,t)))._isCandleStickYAxis=a,n}return s(e,t),n(e,[{key:"_compareMinMax",value:function(t,e,i){var a=j(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!==O.BOLL&&e!==O.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{min:t-=i/100*10,max:e+=i/100*20,range:i=Math.abs(e-t)}}},{key:"_computeOptimalTicks",value:function(t){var e,i=[],a=t.length;if(a>0){var n=this._chartData.styleOptions().xAxis.tickText.size,r=this._innerConvertToPixel(+t[0].v),s=1;if(a>1){var o=this._innerConvertToPixel(+t[1].v),c=Math.abs(o-r);2*n>c&&(s=Math.ceil(2*n/c))}for(var h=this.isPercentageYAxis(),l=0;a>l;l+=s){var u=t[l].v,_=this._innerConvertToPixel(+u);_>n&&this._height-n>_&&i.push({v:h?"".concat((+u).toFixed(2),"%"):(e=u,f(+e)?e>5e4?"".concat(+(e/1e3).toFixed(1),"K"):e>5e6?"".concat(+(e/1e6).toFixed(3),"M"):"".concat(e):"--"),y:_})}}return i}},{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 u=a;n>u;u++){var _=i[u];this._compareMinMax(_,t,s),this._isCandleStickYAxis&&(s[0]=Math.min(_.low,s[0]),s[1]=Math.max(_.high,s[1]))}t===O.VOL&&(s[0]=0)}if(s[0]!==1/0&&s[1]!==-1/0){var d=""+s[0],v=d.indexOf(".")+1,p=0;v>0&&(p=d.length-v);var f=""+s[1],y=f.indexOf(".")+1,x=0;y>0&&(x=f.length-y);var m=Math.pow(10,Math.min(p,x));if(s[0]=Math.round(s[0]*m)/m,s[1]=Math.round(s[1]*m)/m,this.isPercentageYAxis()){var g=i[a].close;this._minValue=(s[0]-g)/g*100,this._maxValue=(s[1]-g)/g*100,this._minValue===this._maxValue&&(this._minValue-=10,this._minValue+=10)}else this._minValue=s[0],this._maxValue=s[1],this._minValue===this._maxValue&&(this._minValue-=1,0>this._minValue?(this._minValue=0,this._maxValue+=this._maxValue):this._maxValue+=1)}}},{key:"_innerConvertToPixel",value:function(t){return Math.round((1-(t-this._minValue)/this._range)*this._height)}},{key:"isCandleStickYAxis",value:function(){return this._isCandleStickYAxis}},{key:"isPercentageYAxis",value:function(){return this._isCandleStickYAxis&&this._chartData.styleOptions().yAxis.type===D}},{key:"convertFromPixel",value:function(t){var e=(1-t/this._height)*this._range+this._minValue;if(this.isPercentageYAxis()){var i=this._chartData.dataList()[this._chartData.from()].close;return i*e/100+i}return e}},{key:"convertToPixel",value:function(t){var e=t;if(this.isPercentageYAxis()){var i=this._chartData.dataList()[this._chartData.from()].close;e=(t-i)/i*100}return this._innerConvertToPixel(e)}}]),e}(ft),xt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._technicalIndicatorType=t.technicalIndicatorType||O.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 yt(t.chartData,!1)}},{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($)}},{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}(ot),mt=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()===S.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,st(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 u=1;i.length>u;u++)t._ctx.lineTo(i[u].x,i[u].y);t._ctx.closePath(),t._ctx.fill()}var _=h.averageLine;_.display&&a.length>0&&(t._ctx.lineWidth=_.size,t._ctx.strokeStyle=_.color,st(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,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!==I){var m=t._yAxis.convertToPixel(x),g=t._yAxis.convertToPixel(d),k=t._yAxis.convertToPixel(f),D=t._yAxis.convertToPixel(y),M=[],w=[];switch(M[0]=k,w[1]=D,m>g?(M[1]=g,w[0]=m,e=[c-u,g,_,m-g]):g>m?(M[1]=m,w[0]=g,e=[c-u,m,_,g-m]):(M[1]=m,w[0]=g,e=[c-u,m,_,1]),t._ctx.fillRect(c-.5,M[0],1,M[1]-M[0]),t._ctx.fillRect(c-.5,w[0],1,w[1]-w[0]),1>e[3]&&(e[3]=1),o.bar.style){case T:t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case E:t._ctx.strokeRect(e[0]+.5,e[1],e[2]-1,e[3]);break;case L:d>p?t._ctx.strokeRect(e[0]+.5,e[1],e[2]-1,e[3]):t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case A: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(u,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,st(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);rt(this._ctx,o,c,h),nt(this._ctx,h,o,o+5),this._ctx.font=at(t.textSize);var l=U(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===m&&this._ctx.setLineDash(o.dashValue),nt(this._ctx,s,0,this._width),this._ctx.setLineDash([])}}}]),e}(lt),gt=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===C?(this._drawCandleStickStandardPromptText(i,a),this._additionalDataProvider.chartType()===S.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=at(o);var l=r,u=t.text.marginTop;h.forEach((function(t,i){var o=t?"".concat(t,": "):"",h=it(a._ctx,o);a._ctx.fillStyle=c,a._ctx.fillText(o,l,u),l+=h;var _,d=n[i]||"--";"object"===e(d)?(_=d.value||"--",a._ctx.fillStyle=d.color||c):(a._ctx.fillStyle=c,_=d);var v=it(a._ctx,_);a._ctx.fillText(_,l,u),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,u=a.text.marginBottom,_=a.text.size,d=a.text.color;this._ctx.textBaseline="top",this._ctx.font=at(_);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=it(r._ctx,s)+c+h;v=Math.max(v,l)}));var p=a.rect,f=p.borderSize,y=p.paddingLeft,x=p.paddingRight,m=p.paddingTop,g=p.left,k=p.right,D=2*f+m+p.paddingBottom+(u+l+_)*s.length,M=this._getTechnicalIndicatorPromptData(t),w=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator,T=w.text.marginLeft,E=w.text.marginRight,L=w.text.marginTop,A=w.text.marginBottom,I=w.text.size,b=this._additionalDataProvider.chartType()===S.CANDLE_STICK,P=M.labels||[],C=M.values||[];b&&(this._ctx.font=at(I),P.forEach((function(t,e){var i=C[e]||"--",a="".concat(t,": ").concat(i),n=it(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:g;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+m;this._ctx.font=at(_),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=at(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=[j(t,"timestamp"),j(t,"open"),j(t,"close"),j(t,"high"),j(t,"low"),j(t,"volume")]).forEach((function(t,e){switch(e){case 0:n[e]=Z(t,"YYYY-MM-DD hh:mm",i._chartData.timezone());break;case n.length-1:n[e]=U(t,r.volume);break;default:n[e]=U(t,r.price)}}))}return n}}]),a}(ut);function kt(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 Dt(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-kt(t,e,[i])[0]))}function Mt(t,e,i){return!!(i&&t&&e)&&(!!Dt(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 wt(t,e,i){return!!(i&&t&&e)&&(!!Dt(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 St(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 Tt(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 u=h+(h-l);a.push([{x:0,y:0*c+u},{x:s,y:s*c+u}])}}}}return a}function Et(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 Lt=0,At=2;function It(t){return t.getBoundingClientRect()||{left:0,top:0}}function bt(t){return!!t.touches}function Pt(t){t.cancelable&&t.preventDefault()}var Ct=!!navigator.maxTouchPoints||!!navigator.msMaxTouchPoints||"ontouchstart"in window||!!(window.DocumentTouch&&document instanceof window.DocumentTouch),Rt="onorientationchange"in window&&Ct;function Ot(t,e){var i=t.clientX-e.clientX,a=t.clientY-e.clientY;return Math.sqrt(i*i+a*a)}var Ht={MOUSE:"mouse",TOUCH:"touch"},Nt=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}),bt(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||bt(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!==Lt)&&null===this._startPinchMiddlePoint){var e=bt(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&&Pt(t))}}}}},{key:"_mouseUpHandler",value:function(t){if(!("button"in t&&t.button!==Lt)){var e=this._makeCompatEvent(t);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),bt(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),bt(t)&&(Pt(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!==Lt&&t.button!==At)){var e=this._makeCompatEvent(t);if("button"in t&&t.button===At)this._processEvent(e,this._handler.mouseRightDownEvent);else{this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,bt(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(),bt(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}),Rt||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=Ot(e.touches[0],e.touches[1]);t._handler.pinchEvent(t._startPinchMiddlePoint,i/t._startPinchDistance),Pt(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=It(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=Ot(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=It(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")?Ht.MOUSE:Ht.TOUCH,target:e.target,view:t.view}}}]),t}();function zt(t){return t.type===Ht.TOUCH}function Gt(t){return t.type===Ht.MOUSE}var Yt=function(){function t(e){i(this,t),this._chartData=e,this._seriesSize={}}return n(t,[{key:"_checkEventPointX",value:function(t){return t>0&&this._seriesSize.contentRight-this._seriesSize.contentLeft>t}},{key:"setSeriesSize",value:function(t){this._seriesSize=t}}]),t}(),Vt="step_1",Ft="step_2",Bt="step_3",Wt="step_done",Xt=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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.STRAIGHT_LINE:case Q.HORIZONTAL_RAY_LINE:case Q.VERTICAL_RAY_LINE:case Q.RAY_LINE:case Q.HORIZONTAL_SEGMENT_LINE:case Q.VERTICAL_SEGMENT_LINE:case Q.SEGMENT_LINE:case Q.PRICE_LINE:case Q.FIBONACCI_LINE:this._twoStepGraphicMarkMouseDown(t,e);break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:this._threeStepGraphicMarkMouseDown(t,e);break;case Q.NONE:this._noneGraphicMarkMouseLeftDown(t)}}}},{key:"mouseRightDownEvent",value:function(t){if(this._chartData.graphicMarkType()===Q.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 Vt:t.drawStep=Ft;break;case Ft:t.drawStep=Wt,i._chartData.setGraphicMarkType(Q.NONE)}}))}},{key:"_threeStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Vt:t.drawStep=Ft;break;case Ft:t.drawStep=Bt;break;case Bt:t.drawStep=Wt,i._chartData.setGraphicMarkType(Q.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(Q.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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.PRICE_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],{x:i._seriesSize.contentRight,y:t[0].y},a)})))return{v:void 0};break;case Q.VERTICAL_STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],{x:t[0].x,y:i._seriesSize.tags[oe].contentBottom},a)})))return{v:void 0};break;case Q.STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],t[1],a)})))return{v:void 0};break;case Q.HORIZONTAL_RAY_LINE:case Q.VERTICAL_RAY_LINE:case Q.RAY_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Mt(t[0],t[1],a)})))return{v:void 0};break;case Q.HORIZONTAL_SEGMENT_LINE:case Q.VERTICAL_SEGMENT_LINE:case Q.SEGMENT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],t[1],a)})))return{v:void 0};break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:case Q.FIBONACCI_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){var n=[],r={width:i._seriesSize.contentRight,height:i._seriesSize.tags[oe].contentBottom-i._seriesSize.tags[oe].contentTop};switch(e){case Q.PRICE_CHANNEL_LINE:n=Tt(t,r,!0);break;case Q.PARALLEL_STRAIGHT_LINE:n=Tt(t,r);break;case Q.FIBONACCI_LINE:n=Et(t,r)}for(var s=!1,o=0;n.length>o;o++){var c=n[o];if(s=Dt(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=St({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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.PRICE_LINE:this._onePointGraphicMarkMouseMove(e,i);break;case Q.STRAIGHT_LINE:case Q.RAY_LINE:case Q.SEGMENT_LINE:case Q.FIBONACCI_LINE:this._twoPointGraphicMarkMouseMove(e,i);break;case Q.HORIZONTAL_RAY_LINE:case Q.HORIZONTAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].price=e.price}));break;case Q.VERTICAL_RAY_LINE:case Q.VERTICAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].xPos=e.xPos}));break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:this._threePointGraphicMarkMouseMove(e,i);break;case Q.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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.PRICE_LINE:case Q.STRAIGHT_LINE:case Q.RAY_LINE:case Q.SEGMENT_LINE:case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:case Q.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 Q.HORIZONTAL_RAY_LINE:case Q.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 Q.VERTICAL_RAY_LINE:case Q.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 Wt:e.push({points:[{xPos:n,price:r}],drawStep:Vt});break;case Vt:case Ft: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 Wt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Vt});break;case Vt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Ft: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 Wt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Vt});break;case Vt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Ft:v(i)&&i(n,{xPos:r,price:s}),n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Bt: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:Wt}),a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_checkEventPointY",value:function(t){var e=this._seriesSize.tags[oe];return t>e.contentTop&&e.contentBottom>t}}]),a}(Yt),jt=0,Kt=1,Zt=2,Ut=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(Q.HORIZONTAL_STRAIGHT_LINE,t,Dt,(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(Q.VERTICAL_STRAIGHT_LINE,t,Dt,(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(Q.STRAIGHT_LINE,t,Dt,(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=kt(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(Q.HORIZONTAL_RAY_LINE,t,Mt,(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(Q.VERTICAL_RAY_LINE,t,Mt,(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(Q.RAY_LINE,t,Mt,(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:kt(t[0],t[1],[{x:0,y:t[0].y}])[0]}:{x:e._width,y:kt(t[0],t[1],[{x:e._width,y:t[0].y}])[0]},[[t[0],i]]}))}},{key:"_drawSegmentLine",value:function(t){this._drawPointGraphicMark(Q.HORIZONTAL_SEGMENT_LINE,t,wt),this._drawPointGraphicMark(Q.VERTICAL_SEGMENT_LINE,t,wt),this._drawPointGraphicMark(Q.SEGMENT_LINE,t,wt)}},{key:"_drawPriceLine",value:function(t,e){var i=this;this._drawPointGraphicMark(Q.PRICE_LINE,t,Mt,(function(t){return[[t[0],{x:i._width,y:t[0].y}]]}),!0,e)}},{key:"_drawPriceChannelLine",value:function(t){var e=this;this._drawPointGraphicMark(Q.PRICE_CHANNEL_LINE,t,Dt,(function(t){return Tt(t,{width:e._width,height:e._height},!0)}))}},{key:"_drawParallelStraightLine",value:function(t){var e=this;this._drawPointGraphicMark(Q.PARALLEL_STRAIGHT_LINE,t,Dt,(function(t){return Tt(t,{width:e._width,height:e._height})}))}},{key:"_drawFibonacciLine",value:function(t,e){var i=this;this._drawPointGraphicMark(Q.FIBONACCI_LINE,t,Dt,(function(t){return Et(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 u=n(e[0],e[1],h);if(l||(l=u),a!==Vt){switch(o._ctx.strokeStyle=t.line.color,o._ctx.lineWidth=t.line.size,o._getLineType(e[0],e[1])){case jt:st(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 Kt:nt(o._ctx,e[0].y,e[0].x,e[1].x);break;case Zt:rt(o._ctx,e[0].x,e[0].y,e[1].y)}if(r){var _=U(o._yAxis.convertFromPixel(e[0].y),s);o._ctx.font=at(t.text.size),o._ctx.fillStyle=t.text.color,o._ctx.fillText("".concat(_," ").concat(c[i]||""),e[0].x+t.text.marginLeft,e[0].y-t.text.marginBottom)}}}}));for(var u=t.point.radius,_=!1,d=0;i.length>d&&!(_=St(i[d],u,h));d++);i.forEach((function(e){var i=St(e,u,h);if(_||l){var a=u,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?Zt:t.y===e.y?Kt:jt}}]),e}(ht),qt=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 mt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createExpandView",value:function(t,e){return new Ut(t,e.chartData,e.xAxis,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new gt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"invalidate",value:function(t){t===J?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),Jt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._chartType=S.CANDLE_STICK,a}return s(e,t),n(e,[{key:"_createYAxis",value:function(t){return new yt(t.chartData,!0)}},{key:"_createMainWidget",value:function(t,e){return new qt({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===S.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(O.AVERAGE),this.invalidate($))}}]),e}(xt),$t=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,nt(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){rt(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=at(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}(ht),Qt=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(){this._drawCrossHairLabel()}},{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._xAxis.convertFromPixel(n.x):this._chartData.dataList().length-1;var r=this._chartData.dataList()[a];if(r){var s=this._xAxis.convertToPixel(a),o=Z(r.timestamp,"YYYY-MM-DD hh:mm",this._chartData.timezone()),c=i.size;this._ctx.font=at(c);var h=it(this._ctx,o),l=s-h/2,u=i.paddingLeft,_=i.paddingRight,d=i.paddingTop,v=i.borderSize;u+v>l?l=u+v:l>this._width-h-v-_&&(l=this._width-h-v-_);var p=l-v-u,f=l+h+v+_,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}(ht),te=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 $t(t,e.chartData,e.xAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new Qt(t,e.chartData,e.xAxis)}}]),e}(ct),ee=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=et(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=at(r);var s=it(this._measureCtx,"00-00 00:00"),o=parseInt(t[0].v),c=j(a[o],"timestamp",0),h=this.convertToPixel(o),l=1,u="MM:DD hh:mm";if(i>1){var _=parseInt(t[1].v),d=j(a[_],"timestamp",0),v=this.convertToPixel(_),p=Math.abs(v-h);s>p&&(l=Math.ceil(s/p));var f=(d-c)/1e3/60;u=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),m=a[x].timestamp,g=Z(m,u,n);if(i-1-l>=y){var k=a[parseInt(t[y+l].v)].timestamp,D=Z(m,"YYYY",n),M=Z(m,"YYYY-MM",n),w=Z(m,"MM-DD",n);D!==Z(k,"YYYY",n)?g=D:M!==Z(k,"YYYY-MM",n)?g=M:w!==Z(k,"MM-DD",n)&&(g=w)}var S=this.convertToPixel(x);S>s/2&&this._width-s/2>S&&e.push({v:g,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:Z(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){return(t-this._chartData.from())*this._chartData.dataSpace()+this._chartData.barSpace()/2}}]),e}(ft),ie=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 ee(this._chartData)}},{key:"_createMainWidget",value:function(t,e){return new te({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}(ot),ae=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.overflow="hidden",this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.width="100%",this._element.style.cursor="ns-resize",this._element.style.position="absolute",this._element.style.zIndex="20",this._element.style.height="5px",this._wrapper.appendChild(this._element);var e=t.lastChild;e?t.insertBefore(this._wrapper,e):t.appendChild(this._wrapper),this._dragEvent=new Nt(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=et(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}(),ne=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){Gt(t)&&this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseMoveEvent",value:function(t){if(Gt(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(zt(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(),zt(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(zt(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(zt(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}(Yt),re=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}(Yt),se=function(){function t(e,a,n,r){i(this,t),this._target=e,this._chartData=a,this._seriesSize={},this._event=new Nt(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 ne(a),this._graphicMarkEventHandler=new Xt(a,n,r),this._keyBoardEventHandler=new re(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){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseUpEvent(t)}},{key:"_mouseLeaveEvent",value:function(t){this._checkZoomDrag()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.mouseLeaveEvent(t))}},{key:"_mouseMoveEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,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()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.mouseClickEvent(t))}},{key:"_mouseDownEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseDownEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseDownEvent(t)}},{key:"_mouseRightDownEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseRightDownEvent(t)}},{key:"_pressedMouseMoveEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,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()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.longTapEvent(t))}},{key:"_checkZoomDrag",value:function(){return!this._chartData.dragGraphicMarkFlag()&&this._chartData.graphicMarkType()===Q.NONE}},{key:"setSeriesSize",value:function(t){this._seriesSize=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}(),oe="candle_stick_series_tag",ce=function(){function t(e,a){i(this,t),this._initChartContainer(e),this._technicalIndicatorBaseId=0,this._technicalIndicatorSeries=[],this._separatorSeries=[],this._separatorDragStartTechnicalIndicatorHeight=0,this._chartData=new tt(a,this._updateSeries.bind(this)),this._xAxisSeries=new ie({container:this._chartContainer,chartData:this._chartData}),this._candleStickSeries=new Jt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:O.MA,tag:oe}),this._chartEvent=new se(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.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]:$;if(t!==J){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()===S.CANDLE_STICK?t.push(this._candleStickSeries.technicalIndicatorType()):this._chartData.calcTechnicalIndicator(O.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===g,i=t.tickText.position===w,a=this._container.offsetWidth,n=this._container.offsetHeight,r=this._measureSeparatorHeight(),s=this._measureXAxisHeight(),o=this._measureYAxisWidth(),c=n-s-r,h=a-(i?o:0),l=a-o,u=0;e&&(l=0,i&&(u=o));var _=0,d=!0,v=!1,p=void 0;try{for(var f,y=this._technicalIndicatorSeries[Symbol.iterator]();!(d=(f=y.next()).done);d=!0){_+=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-_;this._chartData.setTotalDataSpace(h);var m={};m.contentLeft=u,m.contentRight=u+h;var k={};k[oe]={contentTop:0,contentBottom:x};var D=x,M=x;this._candleStickSeries.setSize({left:u,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:u,width:h,height:L},{left:l,width:o,height:L}),E.setSize(u,h),M+=L,k[T.tag()]={contentTop:D,contentBottom:M},D=M}m.tags=k,this._xAxisSeries.setSize({left:u,width:h,height:s},{left:l,width:o,height:s}),this._chartEvent.setSeriesSize(m)}},{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($);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($)}}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;+j(t,"timestamp",0)===+j(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 ae(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 xt({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===oe)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===O.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=et(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 u=this._separatorSeries[l],_=u.height(),d=this._technicalIndicatorSeries[l],v=d.height();n.drawImage(u.getImage(),0,c,s,_),c+=_,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}(),he=function(){function t(e,a){i(this,t),this._chartSeries=new ce(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(oe,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=Q.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(Q.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}(),le={},ue=1,_e="Chart version is 5.1.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 he&&(e=t.id),e&&(le[e].destroy(),delete le[e]))},t.init=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t;if(!i)throw Error(_e);if("string"==typeof i&&(i=document.getElementById(t)||document.getElementsByClassName(t)),!i)throw Error(_e);var a=le[i.chart_id||""];if(a)return a;var n="k_line_chart_".concat(ue++),r=new he(i,e);return r.id=n,i.chart_id=n,le[n]=r,r},t.version=function(){return"5.1.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 u(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)?u(a,n):(e[i]||0===e[i]||!1===e[i])&&(t[i]=e[i])}}function _(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)?_(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,m="dash",g="left",k="right",D="percentage",M="inside",w="outside",S={REAL_TIME:"real_time",CANDLE_STICK:"candle_stick"},T="solid",E="stroke",L="up_stroke",A="down_stroke",I="ohlc",b="always",P="follow_cross",C="standard",R={grid:{display:!0,horizontal:{display:!0,size:1,color:"#393939",style:m,dashValue:[2,2]},vertical:{display:!1,size:1,color:"#393939",style:m,dashValue:[2,2]}},candleStick:{bar:{style:T,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:m,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,type:"normal",position:k,axisLine:{display:!0,color:"#888888",size:1},tickText:{position:w,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:m,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:m,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:b,candleStick:{showType:C,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},point:{display:!0,radius:3}}}},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}}},O={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"},H=(r(y={},O.MA,[5,10,30,60]),r(y,O.VOL,[5,10,20]),r(y,O.MACD,[12,26,9]),r(y,O.BOLL,[20]),r(y,O.KDJ,[9,3,3]),r(y,O.RSI,[6,12,24]),r(y,O.BIAS,[6,12,24]),r(y,O.BRAR,[26]),r(y,O.CCI,[13]),r(y,O.DMI,[14,6]),r(y,O.CR,[26,10,20,40,60]),r(y,O.PSY,[12]),r(y,O.DMA,[10,50,10]),r(y,O.TRIX,[12,20]),r(y,O.OBV,[30]),r(y,O.VR,[24,30]),r(y,O.WR,[13,34,89]),r(y,O.MTM,[6,10]),r(y,O.EMV,[14,9]),r(y,O.SAR,[2,2,20]),y),N=(r(x={price:2,volume:0},O.NO,2),r(x,O.MA,2),r(x,O.VOL,0),r(x,O.MACD,2),r(x,O.BOLL,2),r(x,O.KDJ,2),r(x,O.RSI,2),r(x,O.BIAS,2),r(x,O.BRAR,4),r(x,O.CCI,4),r(x,O.DMI,4),r(x,O.CR,2),r(x,O.PSY,2),r(x,O.DMA,4),r(x,O.TRIX,4),r(x,O.OBV,4),r(x,O.VR,4),r(x,O.WR,4),r(x,O.MTM,4),r(x,O.EMV,4),r(x,O.SAR,2),x),z={};function G(t,e){for(var i=t.length,a=0;i>a;a++)e(a);return t}function Y(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 V(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 F(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 B(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 W(t){return t&&d(t)}function X(t,e){return W(t)&&t.length===e}function j(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}z[O.AVERAGE]=function(t){var e=0,i=0;return G(t,(function(a){e+=t[a].turnover||0,t[a].average=0!==(i+=t[a].volume||0)?e/i:0}))},z[O.MA]=function(t,e){if(!W(e))return t;var i=[],a=e.length;return G(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}))},z[O.VOL]=function(t,e){if(!W(e))return t;var i=[],a=e.length;return G(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}))},z[O.MACD]=function(t,e){if(!X(e,3))return t;var i,a,n=0,r=0,s=0,o=0,c=0;return G(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)}}))},z[O.BOLL]=function(t,e){if(!X(e,1))return t;var i,a,n=0;return G(t,(function(r){n+=t[r].close,e[0]>r?(i=n/(r+1),a=Y(t.slice(0,r+1),i)):(i=(n-=t[r-e[0]].close)/e[0],a=Y(t.slice(r-(e[0]-1),r+1),i)),t[r].boll={up:i+2*a,mid:i,dn:i-2*a}}))},z[O.KDJ]=function(t,e){return X(e,3)?G(t,(function(s){var o=t[s].close;e[0]-1>s?(n=F(t.slice(0,s+1)),r=V(t.slice(0,s+1))):(n=F(t.slice(s-(e[0]-1),s+1)),r=V(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},z[O.RSI]=function(t,e){if(!X(e,3))return t;var i,a,n,s,o,c,h=0,l=0,u=0,_=0,d=0,v=0;return G(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,u+=x,d+=x;else{var m=Math.abs(x);l+=m,_+=m,v+=m}if(e[0]>p)i=h/(p+1),a=(h+l)/(p+1);else{if(p>e[0]){var g=t[p-e[0]].close-t[p-e[0]-1].close;g>0?h-=g:l-=Math.abs(g)}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=u/(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?u-=k:_-=Math.abs(k)}n=u/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}))},z[O.BIAS]=function(t,e){if(!X(e,3))return t;var i,a,n,r=0,s=0,o=0;return G(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}))},z[O.BRAR]=function(t,e){if(!X(e,1))return t;var i=0,a=0,n=0,r=0,s=0,o=0;return G(t,(function(c){var h=t[c].high,l=t[c].low,u=t[c].open;if(s+=h-u,o+=u-l,c>0){var _=t[c-1].close;if(n+=h-_,r+=_-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}}))},z[O.CCI]=function(t,e){if(!X(e,1))return t;var i,a,n=0,r=[],s=0;return G(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}}))},z[O.DMI]=function(t,e){if(!X(e,2))return t;var i=0,a=0,n=0,r=0,s=[0],o=0,c=[0],h=0,l=[0],u=0,_=[0],d=0;return G(t,(function(v){if(v>0){var p=t[v-1].close,f=t[v].high,y=t[v].low,x=f-y,m=Math.abs(f-p),g=Math.abs(y-p),k=f-t[v-1].high,D=t[v-1].low-y,M=Math.max(Math.max(x,m),g);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;u+=S,l.push(S),v>e[0]-1&&(o-=s[v-e[0]],h-=c[v-e[0]],u-=l[v-e[0]]),0===o?(i=0,a=0):(i=100*h/o,a=100*u/o);var T=Math.abs(a-i)/(a+i)*100;if(d+=T,_.push(T),e[1]>v)r=n=d/(v+1);else{var E=_[v-e[1]];r=((n=(d-=E)/e[1])+E)/2}}t[v].dmi={pdi:i,mdi:a,adx:n,adxr:r}}))},z[O.CR]=function(t,e){if(!X(e,5))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=[],u=0,_=[],d=0,v=[],p=0,f=[];return G(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,m=t[y].high-x;0>m&&(m=0),o+=m;var g=x-t[y].low;if(0>g&&(g=0),c+=g,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,u+=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?u/(y+1):(u-=t[y-e[2]].cr.cr)/e[2],_.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?_[0]:_[y-9],ma3:17>y?v[0]:v[y-17],ma4:25>y?f[0]:f[y-25]}}))},z[O.PSY]=function(t,e){if(!X(e,1))return t;var i=0,a=0;return G(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}}))},z[O.DMA]=function(t,e){if(!X(e,3))return t;var i,a,n,r,s=0,o=0,c=0;return G(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}}))},z[O.TRIX]=function(t,e){if(!X(e,2))return t;var i,a,n,r,s=0,o=0,c=0,h=0,l=0,u=[];return G(t,(function(_){var d=t[_].close;if(0===_)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,u.push(r),o+=s,i=e[1]>_?o/(_+1):(o-=t[_-e[1]].trix.trix)/e[1],t[_].trix={trix:s,maTrix:i}}))},z[O.OBV]=function(t,e){if(!X(e,1))return t;var i,a,n=0,r=0;return G(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}}))},z[O.VR]=function(t,e){if(!X(e,2))return t;var i,a=0,n=0,r=0,s=0,o=0;return G(t,(function(c){var h=t[c].close,l=t[c].open,u=t[c].volume;if(h>l?a+=u:l>h?n+=u:r+=u,c>e[0]-1){var _=t[c-e[0]].close,d=t[c-e[0]].open,v=t[c-e[0]].volume;_>d?a-=v:d>_?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}}))},z[O.WR]=function(t,e){if(!X(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,u=Number.MIN_SAFE_INTEGER,_=Number.MAX_SAFE_INTEGER;return G(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=B(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=B(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)u=Math.max(p,u),_=Math.min(f,_);else{var m=B(t.slice(d-e[2],d));u=m[0],_=m[1]}t[d].wr={wr1:i,wr2:a,wr3:0!==(s=u-_)?(u-v)/s*100:0}}))},z[O.MTM]=function(t,e){if(!X(e,2))return t;var i,a,n=0;return G(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}}))},z[O.EMV]=function(t,e){if(!X(e,2))return t;var i,a=0,n=0,r=0,s=[];return G(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}}))},z[O.SAR]=function(t,e){if(!X(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 G(t,(function(e){var h=c,l=t[e].high,u=t[e].low;if(o){(-100===s||l>s)&&(s=l,r=Math.min(r+a,n)),c=h+r*(s-h);var _=Math.min(t[Math.max(1,e)-1].low,u);c>t[e].low?(c=s,r=i,s=-100,o=!o):c>_&&(c=_)}else{(-100===s||s>u)&&(s=u,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 K="en-us";function Z(t,e,i){if(t&&f(t)){var a,n=new Date(t);try{a=new Intl.DateTimeFormat(K,{hour12:!1,timeZone:i,year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric"}).format(n)}catch(t){a=new Intl.DateTimeFormat(K,{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 U(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 q=1,J=2,$=3,Q={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"},tt=function(){function t(e,a){i(this,t),this._invalidateHandler=a,this._styleOptions=_(R),u(this._styleOptions,e),this._technicalIndicatorParamOptions=_(H),this._precisionOptions=_(N),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=8,this._barSpace=this._calcBarSpace(),this._crossHairPoint=null,this._crossHairSeriesTag=null,this._preFrom=0,this._graphicMarkType=Q.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(j(this._dataList[0],"timestamp")))}},{key:"_calcRange",value:function(){this._range=Math.floor(this._totalDataSpace/this._dataSpace),this.adjustFromTo()}},{key:"_calcBarSpace",value:function(){return Math.max(1,Math.min(Math.floor(.8*this._dataSpace),Math.floor(this._dataSpace)-1))}},{key:"_calcRangDif",value:function(){return this._range-Math.floor(this._offsetRightSpace/this._dataSpace)}},{key:"_innerSetDataSpace",value:function(t){return!(!t||3>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){u(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[O.MA]=t,this._precisionOptions[O.BOLL]=t,this._precisionOptions[O.SAR]=t),!e&&0!==e||0>e||(this._precisionOptions.volume=e,this._precisionOptions[O.VOL]=e)}},{key:"calcTechnicalIndicator",value:function(t){if(t===O.NO)return!0;var e=z[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(q)}},{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(j(this._dataList[0],"timestamp")),void this._invalidateHandler(q)}else{var i=this._calcRangDif();if(this._from===this._dataList.length-i)return void this._invalidateHandler(q)}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(J)}},{key:"loadMore",value:function(t){this._loadMoreCallback=t}}]),t}();function et(t){return(window.devicePixelRatio||1)/(t.backingStorePixelRatio||t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)}function it(t,e){return t.measureText(e).width}function at(t){return"".concat(t,"px Arial")}function nt(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 rt(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 st(t,e){t.save(),t.lineWidth%2&&t.translate(.5,.5),e(),t.restore()}var ot=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===$&&this._computeAxis(),t!==J&&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=et(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,u=this._yAxisWidgetCell.offsetHeight,_=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),_,0,l,u),i}},{key:"destroy",value:function(){this._container.removeChild(this._element)}}]),t}(),ct=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 q:this._floatLayerView.flush();break;case $:this._mainView.flush(),this._floatLayerView.flush()}}},{key:"getImage",value:function(t,e){var i=document.createElement("canvas"),a=i.getContext("2d"),n=et(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 ht=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=et(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}(),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(){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===m&&this._ctx.setLineDash(i.dashValue),this._yAxis.ticks().forEach((function(e){nt(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===m?a.dashValue:[]),this._xAxis.ticks().forEach((function(e){rt(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 O.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 O.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 O.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 u=s.close,_=(c[i-1]||{}||{}).close||u;e._ctx.fillStyle=u>_?r.bar.upColor:_>u?r.bar.downColor:r.bar.noChangeColor,e._drawBars(t,o,h.num,!0)};break;case O.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 O.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 O.BRAR:t=function(t,i,a){var r=a.brar||{};e._prepareLinePoints(t,[r.br,r.ar],n)};break;case O.CCI:t=function(t,i,a){e._prepareLinePoints(t,[(a.cci||{}).cci],n)};break;case O.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 O.DMA:t=function(t,i,a){var r=a.dma||{};e._prepareLinePoints(t,[r.dif,r.difMa],n)};break;case O.DMI:t=function(t,i,a){var r=a.dmi||{};e._prepareLinePoints(t,[r.mdi,r.pdi,r.adx,r.adxr],n)};break;case O.KDJ:t=function(t,i,a){var r=a.kdj||{};e._prepareLinePoints(t,[r.k,r.d,r.j],n)};break;case O.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 O.PSY:t=function(t,i,a){e._prepareLinePoints(t,[(a.psy||{}).psy],n)};break;case O.TRIX:t=function(t,i,a){var r=a.trix||{};e._prepareLinePoints(t,[r.trix,r.maTrix],n)};break;case O.OBV:t=function(t,i,a){var r=a.obv||{};e._prepareLinePoints(t,[r.obv,r.maObv],n)};break;case O.VR:t=function(t,i,a){var r=a.vr||{};e._prepareLinePoints(t,[r.vr,r.maVr],n)};break;case O.WR:t=function(t,i,a){var r=a.wr||{};e._prepareLinePoints(t,[r.wr1,r.wr2,r.wr3],n)};break;case O.MTM:t=function(t,i,a){var r=a.mtm||{};e._prepareLinePoints(t,[r.mtm,r.mtmMa],n)};break;case O.EMV:t=function(t,i,a){var r=a.emv||{};e._prepareLinePoints(t,[r.emv,r.maEmv],n)};break;case O.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 u=this._chartData.dataList();o||this._drawOhlc(i,e,n,u[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,st(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+.5,s,2*e-1,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),u=this._yAxis.convertToPixel(i.low),_=(a||{}).close||o;this._ctx.fillStyle=o>_?n:_>o?r:s,this._ctx.fillRect(e-.5,l,1,u-l),this._ctx.fillRect(e-t,c-.5,t,1),this._ctx.fillRect(e,h-.5,t,1)}},{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}(ht),ut=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===b||n===P&&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===m&&this._ctx.setLineDash(i.dashValue),nt(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===m&&this._ctx.setLineDash(n.dashValue),rt(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,u=a.size,_=a.color,d=e.length;this._ctx.textBaseline="top",this._ctx.font=at(u);var v=it(this._ctx,n);this._ctx.fillStyle=_,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=it(this._ctx,f);this._ctx.fillStyle=e[p%d]||_,this._ctx.fillText(f,h,l),h+=o+c+y}}},{key:"_drawTechnicalIndicatorPromptPoint",value:function(t,e,i){var a=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator.point;if(a.display){var n=this._additionalDataProvider.technicalIndicatorType();if(this._chartData.crossHairSeriesTag()&&n!==O.SAR)for(var r=e.length,s=n===O.MACD||n===O.VOL?t.length-1:t.length,o=a.radius,c=0;s>c;c++){var h=t[c];if(h||0===h){var l=this._yAxis.convertToPixel(h);this._ctx.fillStyle=e[c%r],this._ctx.beginPath(),this._ctx.arc(i,l,o,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 O.MA:i.forEach((function(t){n.push("ma".concat(t))}));break;case O.VOL:i.forEach((function(t){n.push("ma".concat(t))})),n.push("num");break;case O.MACD:n=["diff","dea","macd"];break;case O.BOLL:n=["up","mid","dn"];break;case O.BIAS:i.forEach((function(t){n.push("bias".concat(t))}));break;case O.BRAR:n=["br","ar"];break;case O.CCI:n=["cci"];break;case O.CR:n=["cr","ma1","ma2","ma3","ma4"];break;case O.DMA:n=["dif","difMa"];break;case O.DMI:n=["mdi","pdi","adx","adxr"];break;case O.KDJ:n=["k","d","j"];break;case O.RSI:i.forEach((function(t){n.push("rsi".concat(t))}));break;case O.PSY:n=["psy"];break;case O.TRIX:n=["trix","maTrix"];break;case O.OBV:n=["obv","maObv"];break;case O.VR:n=["vr","maVr"];break;case O.WR:n=["wr1","wr2","wr3"];break;case O.MTM:n=["mtm","mtmMa"];break;case O.EMV:n=["emv","maEmv"];break;case O.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=j(t,e.toLowerCase());n.forEach((function(t){a.push(j(s,t))}));var o=this._chartData.precisionOptions()[e];a.forEach((function(t,e){a[e]=U(t,o)}))}return{labels:n,values:a,name:r}}}]),e}(ht),_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 lt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createFloatLayerView",value:function(t,e){return new ut(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}}]),e}(ct),dt=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-1,rt(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){nt(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=at(c),this._ctx.fillStyle=i.color,this._yAxis.ticks().forEach((function(t){e._ctx.fillText(t.v,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,l=i.text;if(this._yAxis.isPercentageYAxis()){var u=a[this._chartData.from()].close;h="".concat(((s-u)/u*100).toFixed(2),"%")}else h=U(s,this._chartData.precisionOptions().price);var _=i.text.size;this._ctx.font=at(_);var d,v=it(this._ctx,h)+l.paddingLeft+l.paddingRight,p=l.paddingTop+_+l.paddingBottom;d=this._isDrawFromStart(t)?0:this._width-v,this._ctx.fillStyle=r,this._ctx.fillRect(d,c-l.paddingTop-_/2,v,p),this._ctx.fillStyle=l.color,this._ctx.textBaseline="middle",this._ctx.fillText(h,d+l.paddingLeft,c)}}}},{key:"_isDrawFromStart",value:function(t){return t.position===g&&t.tickText.position===M||t.position===k&&t.tickText.position===w}}]),e}(ht),vt=function(t){function e(t,a,n,r){var s;return i(this,e),(s=h(this,o(e).call(this,t,a)))._yAxis=n,s._additionalDataProvider=r,s}return s(e,t),n(e,[{key:"_draw",value:function(){this._drawCrossHairLabel()}},{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,r=this._yAxis.convertFromPixel(a.y);if(this._yAxis.isPercentageYAxis()){var s=this._chartData.dataList()[this._chartData.from()].close;n="".concat(((r-s)/s*100).toFixed(2),"%")}else{n=U(r,this._chartData.precisionOptions()[this._yAxis.isCandleStickYAxis()?"price":this._additionalDataProvider.technicalIndicatorType()])}var o=i.size;this._ctx.font=at(o);var c,h=it(this._ctx,n),l=i.paddingLeft,u=i.paddingTop,_=i.borderSize,d=h+2*_+l+i.paddingRight,v=o+2*_+u+i.paddingBottom,p=this._chartData.styleOptions().yAxis;c=p.position===g&&p.tickText.position===M||p.position===k&&p.tickText.position===w?0:this._width-d;var f=a.y-_-u-o/2;this._ctx.fillStyle=i.backgroundColor,this._ctx.fillRect(c,f,d,v),this._ctx.lineWidth=_,this._ctx.strokeStyle=i.borderColor,this._ctx.strokeRect(c,f,d,v),this._ctx.textBaseline="middle",this._ctx.fillStyle=i.color,this._ctx.fillText(n,c+_+l,a.y)}}}}}]),e}(ht),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 dt(t,e.chartData,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new vt(t,e.chartData,e.yAxis,e.additionalDataProvider)}}]),e}(ct),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=function(t){function e(t,a){var n;return i(this,e),(n=h(this,o(e).call(this,t)))._isCandleStickYAxis=a,n}return s(e,t),n(e,[{key:"_compareMinMax",value:function(t,e,i){var a=j(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!==O.BOLL&&e!==O.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{min:t-=i/100*10,max:e+=i/100*20,range:i=Math.abs(e-t)}}},{key:"_computeOptimalTicks",value:function(t){var e,i=[],a=t.length;if(a>0){var n=this._chartData.styleOptions().xAxis.tickText.size,r=this._innerConvertToPixel(+t[0].v),s=1;if(a>1){var o=this._innerConvertToPixel(+t[1].v),c=Math.abs(o-r);2*n>c&&(s=Math.ceil(2*n/c))}for(var h=this.isPercentageYAxis(),l=0;a>l;l+=s){var u=t[l].v,_=this._innerConvertToPixel(+u);_>n&&this._height-n>_&&i.push({v:h?"".concat((+u).toFixed(2),"%"):(e=u,f(+e)?e>5e4?"".concat(+(e/1e3).toFixed(1),"K"):e>5e6?"".concat(+(e/1e6).toFixed(3),"M"):"".concat(e):"--"),y:_})}}return i}},{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 u=a;n>u;u++){var _=i[u];this._compareMinMax(_,t,s),this._isCandleStickYAxis&&(s[0]=Math.min(_.low,s[0]),s[1]=Math.max(_.high,s[1]))}t===O.VOL&&(s[0]=0)}if(s[0]!==1/0&&s[1]!==-1/0){var d=""+s[0],v=d.indexOf(".")+1,p=0;v>0&&(p=d.length-v);var f=""+s[1],y=f.indexOf(".")+1,x=0;y>0&&(x=f.length-y);var m=Math.pow(10,Math.min(p,x));if(s[0]=Math.round(s[0]*m)/m,s[1]=Math.round(s[1]*m)/m,this.isPercentageYAxis()){var g=i[a].close;this._minValue=(s[0]-g)/g*100,this._maxValue=(s[1]-g)/g*100,this._minValue===this._maxValue&&(this._minValue-=10,this._minValue+=10)}else this._minValue=s[0],this._maxValue=s[1],this._minValue===this._maxValue&&(this._minValue-=1,0>this._minValue?(this._minValue=0,this._maxValue+=this._maxValue):this._maxValue+=1)}}},{key:"_innerConvertToPixel",value:function(t){return Math.round((1-(t-this._minValue)/this._range)*this._height)}},{key:"isCandleStickYAxis",value:function(){return this._isCandleStickYAxis}},{key:"isPercentageYAxis",value:function(){return this._isCandleStickYAxis&&this._chartData.styleOptions().yAxis.type===D}},{key:"convertFromPixel",value:function(t){var e=(1-t/this._height)*this._range+this._minValue;if(this.isPercentageYAxis()){var i=this._chartData.dataList()[this._chartData.from()].close;return i*e/100+i}return e}},{key:"convertToPixel",value:function(t){var e=t;if(this.isPercentageYAxis()){var i=this._chartData.dataList()[this._chartData.from()].close;e=(t-i)/i*100}return this._innerConvertToPixel(e)}}]),e}(ft),xt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._technicalIndicatorType=t.technicalIndicatorType||O.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 yt(t.chartData,!1)}},{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($)}},{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}(ot),mt=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()===S.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,st(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 u=1;i.length>u;u++)t._ctx.lineTo(i[u].x,i[u].y);t._ctx.closePath(),t._ctx.fill()}var _=h.averageLine;_.display&&a.length>0&&(t._ctx.lineWidth=_.size,t._ctx.strokeStyle=_.color,st(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,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!==I){var m=t._yAxis.convertToPixel(x),g=t._yAxis.convertToPixel(d),k=t._yAxis.convertToPixel(f),D=t._yAxis.convertToPixel(y),M=[],w=[];switch(M[0]=k,w[1]=D,m>g?(M[1]=g,w[0]=m,e=[c-u,g,_,m-g]):g>m?(M[1]=m,w[0]=g,e=[c-u,m,_,g-m]):(M[1]=m,w[0]=g,e=[c-u,m,_,1]),t._ctx.fillRect(c-.5,M[0],1,M[1]-M[0]),t._ctx.fillRect(c-.5,w[0],1,w[1]-w[0]),1>e[3]&&(e[3]=1),o.bar.style){case T:t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case E:t._ctx.strokeRect(e[0]+.5,e[1],e[2]-1,e[3]);break;case L:d>p?t._ctx.strokeRect(e[0]+.5,e[1],e[2]-1,e[3]):t._ctx.fillRect(e[0],e[1],e[2],e[3]);break;case A: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(u,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,st(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);rt(this._ctx,o,c,h),nt(this._ctx,h,o,o+5),this._ctx.font=at(t.textSize);var l=U(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===m&&this._ctx.setLineDash(o.dashValue),nt(this._ctx,s,0,this._width),this._ctx.setLineDash([])}}}]),e}(lt),gt=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===C?(this._drawCandleStickStandardPromptText(i,a),this._additionalDataProvider.chartType()===S.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=at(o);var l=r,u=t.text.marginTop;h.forEach((function(t,i){var o=t?"".concat(t,": "):"",h=it(a._ctx,o);a._ctx.fillStyle=c,a._ctx.fillText(o,l,u),l+=h;var _,d=n[i]||"--";"object"===e(d)?(_=d.value||"--",a._ctx.fillStyle=d.color||c):(a._ctx.fillStyle=c,_=d);var v=it(a._ctx,_);a._ctx.fillText(_,l,u),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,u=a.text.marginBottom,_=a.text.size,d=a.text.color;this._ctx.textBaseline="top",this._ctx.font=at(_);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=it(r._ctx,s)+c+h;v=Math.max(v,l)}));var p=a.rect,f=p.borderSize,y=p.paddingLeft,x=p.paddingRight,m=p.paddingTop,g=p.left,k=p.right,D=2*f+m+p.paddingBottom+(u+l+_)*s.length,M=this._getTechnicalIndicatorPromptData(t),w=this._chartData.styleOptions().floatLayer.prompt.technicalIndicator,T=w.text.marginLeft,E=w.text.marginRight,L=w.text.marginTop,A=w.text.marginBottom,I=w.text.size,b=this._additionalDataProvider.chartType()===S.CANDLE_STICK,P=M.labels||[],C=M.values||[];b&&(this._ctx.font=at(I),P.forEach((function(t,e){var i=C[e]||"--",a="".concat(t,": ").concat(i),n=it(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:g;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+m;this._ctx.font=at(_),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=at(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=[j(t,"timestamp"),j(t,"open"),j(t,"close"),j(t,"high"),j(t,"low"),j(t,"volume")]).forEach((function(t,e){switch(e){case 0:n[e]=Z(t,"YYYY-MM-DD hh:mm",i._chartData.timezone());break;case n.length-1:n[e]=U(t,r.volume);break;default:n[e]=U(t,r.price)}}))}return n}}]),a}(ut);function kt(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 Dt(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-kt(t,e,[i])[0]))}function Mt(t,e,i){return!!(i&&t&&e)&&(!!Dt(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 wt(t,e,i){return!!(i&&t&&e)&&(!!Dt(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 St(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 Tt(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 u=h+(h-l);a.push([{x:0,y:0*c+u},{x:s,y:s*c+u}])}}}}return a}function Et(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 Lt=0,At=2;function It(t){return t.getBoundingClientRect()||{left:0,top:0}}function bt(t){return!!t.touches}function Pt(t){t.cancelable&&t.preventDefault()}var Ct=!!navigator.maxTouchPoints||!!navigator.msMaxTouchPoints||"ontouchstart"in window||!!(window.DocumentTouch&&document instanceof window.DocumentTouch),Rt="onorientationchange"in window&&Ct;function Ot(t,e){var i=t.clientX-e.clientX,a=t.clientY-e.clientY;return Math.sqrt(i*i+a*a)}var Ht={MOUSE:"mouse",TOUCH:"touch"},Nt=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}),bt(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||bt(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!==Lt)&&null===this._startPinchMiddlePoint){var e=bt(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&&Pt(t))}}}}},{key:"_mouseUpHandler",value:function(t){if(!("button"in t&&t.button!==Lt)){var e=this._makeCompatEvent(t);this._clearLongTapTimeout(),this._mouseMoveStartPosition=null,this._mousePressed=!1,this._unsubscribeRoot&&(this._unsubscribeRoot(),this._unsubscribeRoot=null),bt(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),bt(t)&&(Pt(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!==Lt&&t.button!==At)){var e=this._makeCompatEvent(t);if("button"in t&&t.button===At)this._processEvent(e,this._handler.mouseRightDownEvent);else{this._cancelClick=!1,this._moveExceededManhattanDistance=!1,this._preventDragProcess=!1,bt(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(),bt(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}),Rt||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=Ot(e.touches[0],e.touches[1]);t._handler.pinchEvent(t._startPinchMiddlePoint,i/t._startPinchDistance),Pt(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=It(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=Ot(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=It(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")?Ht.MOUSE:Ht.TOUCH,target:e.target,view:t.view}}}]),t}();function zt(t){return t.type===Ht.TOUCH}function Gt(t){return t.type===Ht.MOUSE}var Yt=function(){function t(e){i(this,t),this._chartData=e,this._seriesSize={}}return n(t,[{key:"_checkEventPointX",value:function(t){return t>0&&this._seriesSize.contentRight-this._seriesSize.contentLeft>t}},{key:"setSeriesSize",value:function(t){this._seriesSize=t}}]),t}(),Vt="step_1",Ft="step_2",Bt="step_3",Wt="step_done",Xt=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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.STRAIGHT_LINE:case Q.HORIZONTAL_RAY_LINE:case Q.VERTICAL_RAY_LINE:case Q.RAY_LINE:case Q.HORIZONTAL_SEGMENT_LINE:case Q.VERTICAL_SEGMENT_LINE:case Q.SEGMENT_LINE:case Q.PRICE_LINE:case Q.FIBONACCI_LINE:this._twoStepGraphicMarkMouseDown(t,e);break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:this._threeStepGraphicMarkMouseDown(t,e);break;case Q.NONE:this._noneGraphicMarkMouseLeftDown(t)}}}},{key:"mouseRightDownEvent",value:function(t){if(this._chartData.graphicMarkType()===Q.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 Vt:t.drawStep=Ft;break;case Ft:t.drawStep=Wt,i._chartData.setGraphicMarkType(Q.NONE)}}))}},{key:"_threeStepGraphicMarkMouseDown",value:function(t,e){var i=this;this._graphicMarkMouseDown(t,e,(function(t){switch(t.drawStep){case Vt:t.drawStep=Ft;break;case Ft:t.drawStep=Bt;break;case Bt:t.drawStep=Wt,i._chartData.setGraphicMarkType(Q.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(Q.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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.PRICE_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],{x:i._seriesSize.contentRight,y:t[0].y},a)})))return{v:void 0};break;case Q.VERTICAL_STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],{x:t[0].x,y:i._seriesSize.tags[oe].contentBottom},a)})))return{v:void 0};break;case Q.STRAIGHT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Dt(t[0],t[1],a)})))return{v:void 0};break;case Q.HORIZONTAL_RAY_LINE:case Q.VERTICAL_RAY_LINE:case Q.RAY_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return Mt(t[0],t[1],a)})))return{v:void 0};break;case Q.HORIZONTAL_SEGMENT_LINE:case Q.VERTICAL_SEGMENT_LINE:case Q.SEGMENT_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){return wt(t[0],t[1],a)})))return{v:void 0};break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:case Q.FIBONACCI_LINE:if(i._realFindNoneGraphicMarkMouseDownActiveData(e,a,(function(t){var n=[],r={width:i._seriesSize.contentRight,height:i._seriesSize.tags[oe].contentBottom-i._seriesSize.tags[oe].contentTop};switch(e){case Q.PRICE_CHANNEL_LINE:n=Tt(t,r,!0);break;case Q.PARALLEL_STRAIGHT_LINE:n=Tt(t,r);break;case Q.FIBONACCI_LINE:n=Et(t,r)}for(var s=!1,o=0;n.length>o;o++){var c=n[o];if(s=Dt(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=St({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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.PRICE_LINE:this._onePointGraphicMarkMouseMove(e,i);break;case Q.STRAIGHT_LINE:case Q.RAY_LINE:case Q.SEGMENT_LINE:case Q.FIBONACCI_LINE:this._twoPointGraphicMarkMouseMove(e,i);break;case Q.HORIZONTAL_RAY_LINE:case Q.HORIZONTAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].price=e.price}));break;case Q.VERTICAL_RAY_LINE:case Q.VERTICAL_SEGMENT_LINE:this._twoPointGraphicMarkMouseMove(e,i,(function(t,e){t.points[0].xPos=e.xPos}));break;case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:this._threePointGraphicMarkMouseMove(e,i);break;case Q.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 Q.HORIZONTAL_STRAIGHT_LINE:case Q.VERTICAL_STRAIGHT_LINE:case Q.PRICE_LINE:case Q.STRAIGHT_LINE:case Q.RAY_LINE:case Q.SEGMENT_LINE:case Q.PRICE_CHANNEL_LINE:case Q.PARALLEL_STRAIGHT_LINE:case Q.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 Q.HORIZONTAL_RAY_LINE:case Q.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 Q.VERTICAL_RAY_LINE:case Q.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 Wt:e.push({points:[{xPos:n,price:r}],drawStep:Vt});break;case Vt:case Ft: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 Wt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Vt});break;case Vt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Ft: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 Wt:e.push({points:[{xPos:r,price:s},{xPos:r,price:s}],drawStep:Vt});break;case Vt:n.points[0]={xPos:r,price:s},n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Ft:v(i)&&i(n,{xPos:r,price:s}),n.points[1]={xPos:r,price:s},e[e.length-1]=n;break;case Bt: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:Wt}),a[e]=n,this._chartData.setGraphicMarkData(a)}},{key:"_checkEventPointY",value:function(t){var e=this._seriesSize.tags[oe];return t>e.contentTop&&e.contentBottom>t}}]),a}(Yt),jt=0,Kt=1,Zt=2,Ut=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(Q.HORIZONTAL_STRAIGHT_LINE,t,Dt,(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(Q.VERTICAL_STRAIGHT_LINE,t,Dt,(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(Q.STRAIGHT_LINE,t,Dt,(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=kt(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(Q.HORIZONTAL_RAY_LINE,t,Mt,(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(Q.VERTICAL_RAY_LINE,t,Mt,(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(Q.RAY_LINE,t,Mt,(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:kt(t[0],t[1],[{x:0,y:t[0].y}])[0]}:{x:e._width,y:kt(t[0],t[1],[{x:e._width,y:t[0].y}])[0]},[[t[0],i]]}))}},{key:"_drawSegmentLine",value:function(t){this._drawPointGraphicMark(Q.HORIZONTAL_SEGMENT_LINE,t,wt),this._drawPointGraphicMark(Q.VERTICAL_SEGMENT_LINE,t,wt),this._drawPointGraphicMark(Q.SEGMENT_LINE,t,wt)}},{key:"_drawPriceLine",value:function(t,e){var i=this;this._drawPointGraphicMark(Q.PRICE_LINE,t,Mt,(function(t){return[[t[0],{x:i._width,y:t[0].y}]]}),!0,e)}},{key:"_drawPriceChannelLine",value:function(t){var e=this;this._drawPointGraphicMark(Q.PRICE_CHANNEL_LINE,t,Dt,(function(t){return Tt(t,{width:e._width,height:e._height},!0)}))}},{key:"_drawParallelStraightLine",value:function(t){var e=this;this._drawPointGraphicMark(Q.PARALLEL_STRAIGHT_LINE,t,Dt,(function(t){return Tt(t,{width:e._width,height:e._height})}))}},{key:"_drawFibonacciLine",value:function(t,e){var i=this;this._drawPointGraphicMark(Q.FIBONACCI_LINE,t,Dt,(function(t){return Et(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 u=n(e[0],e[1],h);if(l||(l=u),a!==Vt){switch(o._ctx.strokeStyle=t.line.color,o._ctx.lineWidth=t.line.size,o._getLineType(e[0],e[1])){case jt:st(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 Kt:nt(o._ctx,e[0].y,e[0].x,e[1].x);break;case Zt:rt(o._ctx,e[0].x,e[0].y,e[1].y)}if(r){var _=U(o._yAxis.convertFromPixel(e[0].y),s);o._ctx.font=at(t.text.size),o._ctx.fillStyle=t.text.color,o._ctx.fillText("".concat(_," ").concat(c[i]||""),e[0].x+t.text.marginLeft,e[0].y-t.text.marginBottom)}}}}));for(var u=t.point.radius,_=!1,d=0;i.length>d&&!(_=St(i[d],u,h));d++);i.forEach((function(e){var i=St(e,u,h);if(_||l){var a=u,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?Zt:t.y===e.y?Kt:jt}}]),e}(ht),qt=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 mt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"_createExpandView",value:function(t,e){return new Ut(t,e.chartData,e.xAxis,e.yAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new gt(t,e.chartData,e.xAxis,e.yAxis,e.additionalDataProvider)}},{key:"invalidate",value:function(t){t===J?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),Jt=function(t){function e(t){var a;return i(this,e),(a=h(this,o(e).call(this,t)))._chartType=S.CANDLE_STICK,a}return s(e,t),n(e,[{key:"_createYAxis",value:function(t){return new yt(t.chartData,!0)}},{key:"_createMainWidget",value:function(t,e){return new qt({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===S.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(O.AVERAGE),this.invalidate($))}}]),e}(xt),$t=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,nt(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){rt(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=at(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}(ht),Qt=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(){this._drawCrossHairLabel()}},{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._xAxis.convertFromPixel(n.x):this._chartData.dataList().length-1;var r=this._chartData.dataList()[a];if(r){var s=this._xAxis.convertToPixel(a),o=Z(r.timestamp,"YYYY-MM-DD hh:mm",this._chartData.timezone()),c=i.size;this._ctx.font=at(c);var h=it(this._ctx,o),l=s-h/2,u=i.paddingLeft,_=i.paddingRight,d=i.paddingTop,v=i.borderSize;u+v>l?l=u+v:l>this._width-h-v-_&&(l=this._width-h-v-_);var p=l-v-u,f=l+h+v+_,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}(ht),te=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 $t(t,e.chartData,e.xAxis)}},{key:"_createFloatLayerView",value:function(t,e){return new Qt(t,e.chartData,e.xAxis)}}]),e}(ct),ee=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=et(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=at(r);var s=it(this._measureCtx,"00-00 00:00"),o=parseInt(t[0].v),c=j(a[o],"timestamp",0),h=this.convertToPixel(o),l=1,u="MM:DD hh:mm";if(i>1){var _=parseInt(t[1].v),d=j(a[_],"timestamp",0),v=this.convertToPixel(_),p=Math.abs(v-h);s>p&&(l=Math.ceil(s/p));var f=(d-c)/1e3/60;u=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),m=a[x].timestamp,g=Z(m,u,n);if(i-1-l>=y){var k=a[parseInt(t[y+l].v)].timestamp,D=Z(m,"YYYY",n),M=Z(m,"YYYY-MM",n),w=Z(m,"MM-DD",n);D!==Z(k,"YYYY",n)?g=D:M!==Z(k,"YYYY-MM",n)?g=M:w!==Z(k,"MM-DD",n)&&(g=w)}var S=this.convertToPixel(x);S>s/2&&this._width-s/2>S&&e.push({v:g,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:Z(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){return(t-this._chartData.from())*this._chartData.dataSpace()+this._chartData.barSpace()/2}}]),e}(ft),ie=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 ee(this._chartData)}},{key:"_createMainWidget",value:function(t,e){return new te({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}(ot),ae=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.overflow="hidden",this._element=document.createElement("div"),this._element.style.margin="0",this._element.style.padding="0",this._element.style.width="100%",this._element.style.cursor="ns-resize",this._element.style.position="absolute",this._element.style.zIndex="20",this._element.style.height="5px",this._wrapper.appendChild(this._element);var e=t.lastChild;e?t.insertBefore(this._wrapper,e):t.appendChild(this._wrapper),this._dragEvent=new Nt(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=et(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}(),ne=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){Gt(t)&&this._chartData.setCrossHairSeriesTag(null)}},{key:"mouseMoveEvent",value:function(t){if(Gt(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(zt(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(),zt(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(zt(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(zt(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}(Yt),re=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}(Yt),se=function(){function t(e,a,n,r){i(this,t),this._target=e,this._chartData=a,this._seriesSize={},this._event=new Nt(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 ne(a),this._graphicMarkEventHandler=new Xt(a,n,r),this._keyBoardEventHandler=new re(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){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseUpEvent(t)}},{key:"_mouseLeaveEvent",value:function(t){this._checkZoomDrag()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.mouseLeaveEvent(t))}},{key:"_mouseMoveEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,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()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.mouseClickEvent(t))}},{key:"_mouseDownEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseDownEvent(t),this._checkZoomDrag()&&this._zoomDragEventHandler.mouseDownEvent(t)}},{key:"_mouseRightDownEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,this._graphicMarkEventHandler.mouseRightDownEvent(t)}},{key:"_pressedMouseMoveEvent",value:function(t){t.localX-=this._seriesSize.contentLeft,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()&&(t.localX-=this._seriesSize.contentLeft,this._zoomDragEventHandler.longTapEvent(t))}},{key:"_checkZoomDrag",value:function(){return!this._chartData.dragGraphicMarkFlag()&&this._chartData.graphicMarkType()===Q.NONE}},{key:"setSeriesSize",value:function(t){this._seriesSize=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}(),oe="candle_stick_series_tag",ce=function(){function t(e,a){i(this,t),this._initChartContainer(e),this._technicalIndicatorBaseId=0,this._technicalIndicatorSeries=[],this._separatorSeries=[],this._separatorDragStartTechnicalIndicatorHeight=0,this._chartData=new tt(a,this._updateSeries.bind(this)),this._xAxisSeries=new ie({container:this._chartContainer,chartData:this._chartData}),this._candleStickSeries=new Jt({container:this._chartContainer,chartData:this._chartData,xAxis:this._xAxisSeries.xAxis(),technicalIndicatorType:O.MA,tag:oe}),this._chartEvent=new se(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.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]:$;if(t!==J){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()===S.CANDLE_STICK?t.push(this._candleStickSeries.technicalIndicatorType()):this._chartData.calcTechnicalIndicator(O.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===g,i=t.tickText.position===w,a=this._container.offsetWidth,n=this._container.offsetHeight,r=this._measureSeparatorHeight(),s=this._measureXAxisHeight(),o=this._measureYAxisWidth(),c=n-s-r,h=a-(i?o:0),l=a-o,u=0;e&&(l=0,i&&(u=o));var _=0,d=!0,v=!1,p=void 0;try{for(var f,y=this._technicalIndicatorSeries[Symbol.iterator]();!(d=(f=y.next()).done);d=!0){_+=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-_;this._chartData.setTotalDataSpace(h);var m={};m.contentLeft=u,m.contentRight=u+h;var k={};k[oe]={contentTop:0,contentBottom:x};var D=x,M=x;this._candleStickSeries.setSize({left:u,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:u,width:h,height:L},{left:l,width:o,height:L}),E.setSize(u,h),M+=L,k[T.tag()]={contentTop:D,contentBottom:M},D=M}m.tags=k,this._xAxisSeries.setSize({left:u,width:h,height:s},{left:l,width:o,height:s}),this._chartEvent.setSeriesSize(m)}},{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($);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($)}}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;+j(t,"timestamp",0)===+j(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;t&&O.hasOwnProperty(t)&&t!==O.NO&&t!==O.AVERAGE||(t=O.MACD);var i=this._technicalIndicatorSeries.length;this._separatorSeries.push(new ae(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 xt({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===oe)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===O.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=et(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 u=this._separatorSeries[l],_=u.height(),d=this._technicalIndicatorSeries[l],v=d.height();n.drawImage(u.getImage(),0,c,s,_),c+=_,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}(),he=function(){function t(e,a){i(this,t),this._chartSeries=new ce(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(oe,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=Q.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(Q.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}(),le={},ue=1,_e="Chart version is 5.1.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 he&&(e=t.id),e&&(le[e].destroy(),delete le[e]))},t.init=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t;if(!i)throw Error(_e);if("string"==typeof i&&(i=document.getElementById(t)||document.getElementsByClassName(t)),!i)throw Error(_e);var a=le[i.chart_id||""];if(a)return a;var n="k_line_chart_".concat(ue++),r=new he(i,e);return r.id=n,i.chart_id=n,le[n]=r,r},t.version=function(){return"5.1.0"},Object.defineProperty(t,"__esModule",{value:!0})})); diff --git a/src/data/ChartData.js b/src/data/ChartData.js index e2f05f6ba..c001385e3 100644 --- a/src/data/ChartData.js +++ b/src/data/ChartData.js @@ -30,7 +30,7 @@ export const GraphicMarkType = { } const MAX_DATA_SPACE = 30 -const MIN_DATA_SPACE = 2 +const MIN_DATA_SPACE = 3 export default class ChartData { constructor (styleOptions, invalidateHandler) { @@ -67,7 +67,7 @@ export default class ChartData { // 绘制区间数据数量 this._range = 0 // 每一条数据的空间 - this._dataSpace = 4 + this._dataSpace = 8 // bar的空间 this._barSpace = this._calcBarSpace() diff --git a/src/series/ChartSeries.js b/src/series/ChartSeries.js index 6bc75079c..8e8e89543 100644 --- a/src/series/ChartSeries.js +++ b/src/series/ChartSeries.js @@ -339,6 +339,14 @@ export default class ChartSeries { * @returns {string} */ createTechnicalIndicator (technicalIndicatorType, height = DEFAULT_TECHNICAL_INDICATOR_SERIES_HEIGHT) { + if ( + !technicalIndicatorType || + !TechnicalIndicatorType.hasOwnProperty(technicalIndicatorType) || + technicalIndicatorType === TechnicalIndicatorType.NO || + technicalIndicatorType === TechnicalIndicatorType.AVERAGE + ) { + technicalIndicatorType = TechnicalIndicatorType.MACD + } const technicalIndicatorSeriesCount = this._technicalIndicatorSeries.length this._separatorSeries.push( new SeparatorSeries( diff --git a/types/index.d.ts b/types/index.d.ts index 6761ffb7a..6d84c38aa 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -54,7 +54,7 @@ export interface Chart { setCandleStickChartType(chartType: ChartType): void; setCandleStickTechnicalIndicatorType(technicalIndicatorType: TechnicalIndicatorType): void; setTechnicalIndicatorType(tag: string, technicalIndicatorType: TechnicalIndicatorType): void; - addTechnicalIndicator(technicalIndicatorType: TechnicalIndicatorType, height?: number): void; + addTechnicalIndicator(technicalIndicatorType?: TechnicalIndicatorType, height?: number): string; removeTechnicalIndicator(tag: string): void; addGraphicMark(graphicMarkType: GraphicMarkType): void; removeAllGraphicMark(): void;