| | |
| | | |
| | | // this.CreateKLineChart(); |
| | | this.$nextTick(() => { |
| | | // this.timerss = setInterval(() => { |
| | | this.CreateMinuteChart(); |
| | | this.CreateKLineChart(); |
| | | // }, 3000); |
| | | // this.CreateMinuteChart(); |
| | | // this.CreateKLineChart(); |
| | | |
| | | // this.timerss = setInterval(() => { |
| | | // // this.KLineChart = null |
| | | // // this.CreateMinuteChart(); |
| | |
| | | beforeDestroy() { |
| | | clearInterval(this.timerss); // 在组件销毁前清除定时器 |
| | | this.timerss = null; |
| | | }, |
| | | destroyed() { |
| | | clearInterval(this.timerss); // 在组件销毁前清除定时器 |
| | | }, |
| | | methods: { |
| | | OnSize() { |
| | |
| | | chart.SetOption(option); |
| | | this.Chart = chart; |
| | | }, |
| | | |
| | | // k线图创建 |
| | | CreateKLineChart() { |
| | | if (this.KLineChart) return; |
| | | |
| | |
| | | option.Symbol = this.Symbol; |
| | | |
| | | option.NetworkFilter = (data, callback) => { |
| | | console.log("data, callback", data, callback); |
| | | |
| | | this.NetworkFilter(data, callback); |
| | | }; // 网络请求回调函数 |
| | | var chart = HQChart.Chart.JSChart.Init(this.$refs.kline2); |
| | |
| | | data, |
| | | callback // 第3方数据替换接口 |
| | | ) { |
| | | EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data); |
| | | // EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data); |
| | | if (this.timerss) { |
| | | clearInterval(this.timerss); |
| | | this.timerss = null; |