fix: 调整散点图的tooltip配置

This commit is contained in:
tnt group 2022-09-16 08:41:27 +08:00
parent 287097ceed
commit f8aafd0e0b
3 changed files with 21 additions and 0 deletions

View File

@ -8,8 +8,15 @@ export const includes = ['legend', 'xAxis', 'yAxis']
export const option = {
dataset: dataJson,
tooltip: {
showDelay: 0,
formatter: (params: { value: string | any[]; seriesName: string; name: string }) => {
console.log(params)
return params.value.length > 1
? `${params.seriesName}<br />${params.value[0]} ${params.value[1]}`
: `${params.seriesName}<br />${params.name} ${params.value}`
},
axisPointer: {
show: true,
type: 'cross',
@ -19,6 +26,7 @@ export const option = {
}
}
},
legend: {},
xAxis: {

View File

@ -11,6 +11,12 @@ export const option = {
tooltip: {
showDelay: 0,
formatter: (params: { value: string | any[]; seriesName: string; name: string }) => {
console.log(params)
return params.value.length > 1
? `${params.seriesName}<br />${params.value[0]} ${params.value[1]}`
: `${params.seriesName}<br />${params.name} ${params.value}`
},
axisPointer: {
show: true,
type: 'cross',

View File

@ -46,8 +46,15 @@ export const seriesItem = {
export const option = {
dataset: dataJson,
tooltip: {
showDelay: 0,
formatter: (params: { value: string | any[]; seriesName: string; name: string }) => {
console.log(params)
return params.value.length > 1
? `${params.seriesName}<br />${params.value[0]} ${params.value[1]}`
: `${params.seriesName}<br />${params.name} ${params.value}`
},
axisPointer: {
show: true,
type: 'cross',