|
|
@ -68,7 +68,8 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { |
|
|
|
// 给配置项 |
|
|
|
const KlineOption = { |
|
|
|
tooltip: { |
|
|
|
trigger: 'item', // 触发类型 坐标轴触发 |
|
|
|
trigger: 'axis', // 触发类型 坐标轴触发 |
|
|
|
confine: true, // 限制tooltip不超出容器 |
|
|
|
axisPointer: { |
|
|
|
type: 'cross', // 十字准星效果 |
|
|
|
crossStyle: { |
|
|
@ -76,12 +77,18 @@ function initQXNLZHEcharts(kline, qxnlzhqData) { |
|
|
|
} |
|
|
|
}, |
|
|
|
formatter: function (params) { |
|
|
|
const date = params.name |
|
|
|
if (!params || params.length === 0) return '' |
|
|
|
|
|
|
|
// 找到K线数据 |
|
|
|
const klineParam = params.find(param => param.seriesType === 'candlestick') |
|
|
|
if (!klineParam) return '' |
|
|
|
|
|
|
|
const date = klineParam.name |
|
|
|
// 开收低高分别取参数的第2到第5个数 |
|
|
|
const open = params.data[1] |
|
|
|
const close = params.data[2] |
|
|
|
const low = params.data[3] |
|
|
|
const high = params.data[4] |
|
|
|
const open = klineParam.data[1] |
|
|
|
const close = klineParam.data[2] |
|
|
|
const low = klineParam.data[3] |
|
|
|
const high = klineParam.data[4] |
|
|
|
return `日期: ${date}<br/>开盘价: ${open}<br/>收盘价: ${close}<br/>最低价: ${low}<br/>最高价: ${high}` |
|
|
|
|
|
|
|
} |
|
|
|