| | |
| | | ], |
| | | SplashTitle: "loading...", |
| | | Symbol: "600015.sh", |
| | | IsAutoUpdate: true, // 是自动更新数据 |
| | | IsAutoUpdate: false, // 是自动更新数据 |
| | | AutoUpdateFrequency: 15000, |
| | | IsApiPeriod: true, |
| | | IsShowRightMenu: false, // 是否显示右键菜单 |
| | |
| | | Name: i18n.t("hj89"), |
| | | ID: 2, |
| | | }, |
| | | { |
| | | Name: i18n.t("hj90"), |
| | | ID: 4, |
| | | }, |
| | | { |
| | | Name: i18n.t("hj91"), |
| | | ID: 5, |
| | | }, |
| | | // { |
| | | // Name: i18n.t("hj90"), |
| | | // ID: 4, |
| | | // }, |
| | | // { |
| | | // Name: i18n.t("hj91"), |
| | | // ID: 5, |
| | | // }, |
| | | { |
| | | Name: i18n.t("hj92"), |
| | | ID: 7, |
| | |
| | | mounted() { |
| | | this.init(); |
| | | }, |
| | | beforeDestroy() { |
| | | if (this.timerss) { |
| | | clearInterval(this.timerss); |
| | | } |
| | | this.clearTime(); |
| | | }, |
| | | methods: { |
| | | // 清除所有定时器 |
| | | clearTime() { |
| | | // 创建一个额外的定时器以获取当前最大定时器 ID |
| | | let lastIntervalId = setInterval(() => {}, 1000); |
| | | // 遍历并清除所有定时器 |
| | | for (let i = 1; i <= lastIntervalId; i++) { |
| | | clearInterval(i); |
| | | clearTimeout(i); |
| | | } |
| | | }, |
| | | init() { |
| | | this.OnSize(); |
| | | this.SetChartStyle(); |
| | |
| | | SetChartStyle() { |
| | | EastMoney.HQData.SetMinuteChartCoordinate(); |
| | | var blackStyle = HQChart.Chart.HQChartStyle.GetStyleConfig( |
| | | HQChart.Chart.STYLE_TYPE_ID.WHITE_ID |
| | | // HQChart.Chart.STYLE_TYPE_ID.WHITE_ID // 白色风格 |
| | | HQChart.Chart.STYLE_TYPE_ID.BLACK_ID // 黑色风格 |
| | | ); // 读取黑色风格配置 |
| | | |
| | | blackStyle.UpBarColor = "#449b54"; //上涨 |
| | |
| | | HQChart.Chart.JSChart.SetStyle(blackStyle); |
| | | }, |
| | | handleClick(tab) { |
| | | this.clearTime(); |
| | | this.KLineChart.ChangePeriod(tab.$attrs.Id); |
| | | }, |
| | | |
| | |
| | | data, |
| | | callback // 第3方数据替换接口 |
| | | ) { |
| | | if (this.timerss) { |
| | | clearInterval(this.timerss); |
| | | this.timerss = null; |
| | | } |
| | | EastMoney.HQData.Log("[HQChartDemo::NetworkFilter] data", data); |
| | | |
| | | this.timeChange(data, callback); |
| | | this.timerss = setInterval(() => { |
| | | this.timeChange(data, callback); |
| | |
| | | #hqchart_minute { |
| | | height: 0; |
| | | flex: 1; |
| | | background-color: #fff; |
| | | // background-color: #fff; |
| | | position: relative; |
| | | } |
| | | |
| | | #hqchart_kline { |
| | | height: 0; |
| | | flex: 1; |
| | | background-color: #fff; |
| | | // background-color: #fff; |
| | | position: relative; |
| | | } |
| | | } |