ehcarts title中的富文本不起作用,有知道的没?
echarts吧
全部回复
仅看楼主
level 1
option = {
title: {
text: '今天天气不错',
textStyle: {
label: {
normal: {
show: true,
formatter: [
'The whole box is a {term|Text Block}, with',
].join('\n'),
backgroundColor: '#eee',
// borderColor: '#333',
borderColor: 'rgb(199,86,83)',
borderWidth: 2,
borderRadius: 5,
padding: 10,
color: '#000',
fontSize: 14,
shadowBlur: 3,
shadowColor: '#888',
shadowOffsetX: 0,
shadowOffsetY: 3,
lineHeight: 30,
rich: {
term: {
fontSize: 18,
color: 'rgb(199,86,83)'
}
}
}
}
},
},
series: [
{
type: 'scatter',
data: [[0,0]],
symbolSize: 1,
label: {
normal: {
show: true,
formatter: [
'The whole box is a {term|Text Block}, with',
'{fregment1|A Text Fregment}',
].join('\n'),
backgroundColor: '#eee',
// borderColor: '#333',
borderColor: 'rgb(199,86,83)',
borderWidth: 2,
borderRadius: 5,
padding: 10,
color: '#000',
fontSize: 14,
shadowBlur: 3,
shadowColor: '#888',
shadowOffsetX: 0,
shadowOffsetY: 3,
lineHeight: 30,
rich: {
term: {
fontSize: 18,
color: 'rgb(199,86,83)'
},
fregment1: {
backgroundColor: '#000',
color: 'yellow',
padding: 5
}
}
}
}
}
],
xAxis: {
axisLabel: {show: false},
axisLine: {show: false},
splitLine: {show: false},
axisTick: {show: false},
min: -1,
max: 1
},
yAxis: {
axisLabel: {show: false},
axisLine: {show: false},
splitLine: {show: false},
axisTick: {show: false},
min: -1,
max: 1
}
};
为什么呢?难道我使用方法错了么?
2017年10月19日 09点10分 1
level 1
在线定制js即可,富文本标签是在 ECharts v3.7以后才增加的功能;在 ECharts v3.7之前的版本中,只能对整个块进行统一样式的设置,而且只可以设置字体和颜色,不易于制作表达能力更强的文字描述信息。
2018年03月19日 06点03分 2
level 1
你用的是什么版本的,textStyle里面没有lable属性啊
2019年11月29日 07点11分 3
4.0之前的吧,我也不知道了 反正之前有版本是有这个属性的
2019年11月29日 09点11分
1