fix:修改timebar的tooltip

This commit is contained in:
zhangyu
2022-01-25 19:16:31 +08:00
parent 50dccf6a3c
commit f22a1f30eb
2 changed files with 17 additions and 7 deletions

View File

@@ -40,6 +40,12 @@ import { getChartColor } from '@/components/charts/chart-options'
import * as echarts from 'echarts'
export default {
name: 'ChartIpOpenPortBar',
setup () {
const myChart = null
return {
myChart
}
},
props: {
chartInfo: Object,
chartData: [Array, Object],
@@ -48,7 +54,6 @@ export default {
},
data () {
return {
myChart: null,
chartOption: null,
tableData: [],
tableKey: [

View File

@@ -15,9 +15,14 @@ import { getCharBartColor, timeBarTooltipFormatter } from '@/views/charts/charts
export default {
name: 'ChaetTimeBar',
setup () {
const myChart = null
return {
myChart
}
},
data () {
return {
myChart: null,
chartOption: null
}
},
@@ -33,11 +38,11 @@ export default {
const dom = document.getElementById(id)
!this.myChart && (this.myChart = echarts.init(dom))
this.chartOption = this.$_.cloneDeep(timeBar)
this.chartOption.tooltip.trigger = 'item'
this.chartOption.tooltip.formatter = (params) => {
const str = timeBarTooltipFormatter(params, chartParams.direction)
return str
}
// this.chartOption.tooltip.trigger = 'item'
// this.chartOption.tooltip.formatter = (params) => {
// const str = timeBarTooltipFormatter(params, chartParams.direction)
// return str
// }
if (!chartParams.itemColorAlternately) {
this.chartOption.series[0].itemStyle.color = function (params) {
return getCharBartColor(0)