fix:修改 chartMap tooltip显示不正确的问题
This commit is contained in:
@@ -178,6 +178,7 @@ export default {
|
||||
})
|
||||
},
|
||||
mapTooltipFormatter (dcStat) {
|
||||
const self = this
|
||||
return `<div class="tooltip" style="z-index: 11111">
|
||||
<div class="tooltip--title">${dcStat.name}</div>
|
||||
<div class="tooltip--row">
|
||||
@@ -189,8 +190,8 @@ export default {
|
||||
<div>${dcStat.agent.up}</div>
|
||||
<div>${dcStat.agent.down}</div>
|
||||
</div>
|
||||
<div class="tooltip-chart" id="tooltip-chart--endpoint"></div>
|
||||
<div class="tooltip-chart" id="tooltip-chart--prometheus"></div>
|
||||
<div class="tooltip-chart" id="tooltip-chart--endpoint-${self.chartInfo.id}"></div>
|
||||
<div class="tooltip-chart" id="tooltip-chart--prometheus-${self.chartInfo.id}"></div>
|
||||
</div>
|
||||
</div>`
|
||||
|
||||
@@ -201,8 +202,8 @@ export default {
|
||||
setTimeout(() => {
|
||||
const data = param.tooltip.options.data
|
||||
// console.info(tooltipEndpointChart);
|
||||
tooltipEndpointChart = echarts.init(document.querySelector('#tooltip-chart--endpoint'))
|
||||
tooltipPrometheusChart = echarts.init(document.querySelector('#tooltip-chart--prometheus'))
|
||||
tooltipEndpointChart = echarts.init(document.querySelector('#tooltip-chart--endpoint-' + this.chartInfo.id))
|
||||
tooltipPrometheusChart = echarts.init(document.querySelector('#tooltip-chart--prometheus-' + this.chartInfo.id))
|
||||
const endpointOption = chartConfig.getOption('tooltipPie')
|
||||
const prometheusOption = chartConfig.getOption('tooltipPie')
|
||||
endpointOption.series[0].label.formatter = data.asset.total + ''
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
:margin="[10, 10]"
|
||||
:row-height="stepWidth"
|
||||
:vertical-compact="true"
|
||||
:use-css-transforms="true"
|
||||
:use-css-transforms="false"
|
||||
:style="{
|
||||
'margin-top': layoutMargintop
|
||||
}"
|
||||
@@ -294,7 +294,9 @@ export default {
|
||||
// 1.元素距离页面顶部的距离
|
||||
// console.log(dom.style.transform)
|
||||
|
||||
let top = dom.style.transform.split(',')[1]
|
||||
// let top = dom.style.transform.split(',')[1]
|
||||
// top = top.substring(0, top.length - 2)
|
||||
let top = dom.style.top
|
||||
top = top.substring(0, top.length - 2)
|
||||
const mainOffsetTop = top - this.stepWidth + 14// transform: grid组件 通过 tranfrom 控制位置 中间的为y的值 通过截取获得 - 父元素 marginTop的 值。
|
||||
// 2.元素的高度
|
||||
|
||||
Reference in New Issue
Block a user