fix:修改timebar的tooltip
This commit is contained in:
@@ -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: [
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user