echarts
echarts copied to clipboard
由 v3.5.4 更新至 v3.7.1 后gauge detail不显示了
One-line summary [问题简述]
使用 react 封装 ECharts,通过 <ECharts option={option} />生成图表,将 v3.5.4 更新至 v3.7.1 后 gauge detail 不显示了。
经查发现,'src/chart/gauge/GaugeSeries.js' 中 detail.height 由 40 变为 null。
打断点发现,var height = parsePercent(detailModel.get('height'), posInfo.r);,height 为 NaN,
textHeight: isNaN(height) ? null : height。
detail不显示可能就是 textHeight 为 null 造成的,目前只能放弃版本更新。
Version & Environment [版本及环境]
- ECharts version [ECharts 版本]:v3.7.1
- Browser version [浏览器类型和版本]:chrome
- OS Version [操作系统类型和版本]:win7
Expected behaviour [期望结果]
请问有什么解决办法?
ECharts option [ECharts配置项]
option = {
series: [{
name: '',
type: 'gauge',
center: ['30%', '50%'],
radius: '65%',
axisLine: {
lineStyle: {
color: [
[0.8, '#0193cf'],
[1, '#ccc']
],
width: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
pointer: {
show: true,
length: '80%',
width: 2
},
itemStyle: {
normal: {
color: '#ccc'
}
},
detail: {
formatter: '{value}%',
offsetCenter: [0, '5%']
},
data: [{
value: 80,
label: {
textStyle: {
fontSize: 12
}
}
}]
}, {
name: '',
type: 'gauge',
center: ['80%', '57%'],
radius: '45%',
axisLine: {
lineStyle: {
color: [
[0.6, '#0193cf'],
[1, '#ccc']
],
width: 10
}
},
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLabel: {
show: false
},
pointer: {
show: true,
length: '80%',
width: 2
},
itemStyle: {
normal: {
color: '#ccc'
}
},
detail: {
formatter: '{value}%',
offsetCenter: [0, '5%']
},
data: [{
value: 60,
label: {
textStyle: {
fontSize: 12
}
}
}]
}]
}
请问两位大大怎样才能使 textHeight 不为 null ? ps 想使用新版本的富文本,不能一直放弃版本更新啊 @pissang @Ovilia
现在神奇的好了。。。