fix(视图): 堆叠图label,tooltip偶尔不显示的问题

This commit is contained in:
junjun 2022-08-08 11:57:49 +08:00
parent 1f655bf46d
commit adf1d1b7c6

View File

@ -143,7 +143,7 @@ export function getLabel(chart) {
yAxis = JSON.parse(JSON.stringify(chart.yaxis)) yAxis = JSON.parse(JSON.stringify(chart.yaxis))
} }
if (chart.type === 'bar-stack' || chart.type === 'line-stack') { if (chart.type === 'bar-stack' || chart.type === 'line-stack' || chart.type === 'bar-stack-horizontal') {
const f = yAxis[0] const f = yAxis[0]
if (f.formatterCfg) { if (f.formatterCfg) {
res = valueFormatter(param.value, f.formatterCfg) res = valueFormatter(param.value, f.formatterCfg)
@ -196,7 +196,7 @@ export function getTooltip(chart) {
} }
let obj let obj
if (chart.type === 'bar-stack' || chart.type === 'line-stack') { if (chart.type === 'bar-stack' || chart.type === 'line-stack' || chart.type === 'bar-stack-horizontal') {
obj = { name: param.category, value: param.value } obj = { name: param.category, value: param.value }
const f = yAxis[0] const f = yAxis[0]
if (f.formatterCfg) { if (f.formatterCfg) {