6
问题简述 (One-line summary)
tooltip使用formatter后,类目值前面的有色圆点就没了。
版本及环境 (Version & Environment)- ECharts 版本 (ECharts version):
- 浏览器类型和版本 (Browser version):chrome;版本 54.0.2840.87 m
- 操作系统类型和版本 (OS Version):windows10
1. 2.
期望结果 (Expected behaviour)tooltip使用formatter后,各类目值前面的圆点都还在
可能哪里有问题 (What went wrong) ECharts配置项 (ECharts option)option = {
tooltip: {
trigger: 'axis',
axisPointer: { // 坐标轴指示器,坐标轴触发有效
type: 'shadow', // 默认为直线,可选为:'line' | 'shadow'
},
formatter: params => (`${params[0].name}<br/>${params[0].seriesName}:${params[0].value}<br/>${params[1].seriesName}:${(params[1].value + params[0].value)}`),
},
grid: {
left: '3%',
right: '8%',
bottom: '3%',
containLabel: true,
},
xAxis: [
{
type: 'value',
name: '(/万)',
nameTextStyle: {
color: '#838F9A',
fontSize: 14,
},
axisLabel: {
textStyle: {
color: '#838F9A',
fontSize: 14,
},
},
axisLine: {
lineStyle: {
color: '#282f3b',
},
},
axisTick: {
show: false,
},
splitLine: {
lineStyle: {
color: '#282f3b',
},
},
},
],
yAxis: [
{
type: 'category',
axisTick: { show: false },
name: '项目名称',
nameTextStyle: {
color: '#838F9A',
fontSize: 14,
},
nameGap: 15,
data: trustNames,
axisLabel: {
textStyle: {
color: '#838F9A',
fontSize: 14,
},
},
axisLine: {
lineStyle: {
color: '#282f3b',
},
},
splitLine: {
lineStyle: {
color: '#282f3b',
},
},
},
],
series: [
{
name: '资金余额',
type: 'bar',
itemStyle: {
normal: {
color: '#00CC99',
},
},
stack: 'one',
data: balances,
},
{
name: '放款规模',
type: 'bar',
itemStyle: {
normal: {
color: '#0066CC',
},
},
stack: 'one',
data: remainAmounts,
},
],
};
return { option, trustNames };
}
其他信息 (Other comments)