| | |
| | | </template> |
| | | <script> |
| | | import { init, dispose } from 'klinecharts' |
| | | let chart = null |
| | | import { _getKline } from "@/service/trade.api"; |
| | | import config from './config' |
| | | import { clearAllTimers } from '@/utils/utis.js' |
| | | import { Loading } from 'vant'; |
| | | import { customShapeTemplates } from './drawTools' |
| | | |
| | | /** K 线 X 轴/十字光标等展示用 IANA 时区(美国东部,自动夏令时) */ |
| | | const KLINE_DISPLAY_TIMEZONE = 'America/New_York' |
| | | let chart = null |
| | | export default { |
| | | name: 'KlineCharts', |
| | | data() { |
| | |
| | | initData() { |
| | | this.timeValue = this.timeList.find(t => t.id === '15min') || this.timeList[0] |
| | | chart = init('kline', config); |
| | | chart.setTimezone(KLINE_DISPLAY_TIMEZONE) |
| | | chart.setOffsetRightSpace(25) |
| | | chart.setDataSpace(10) |
| | | chart.setPriceVolumePrecision(4, 2) |