echarts [Bug] 饼形图当position为center时触摸其他区块显示的name跟默认name重叠

iqih9akk  于 2023-02-04  发布在  Echarts
关注(0)|答案(5)|浏览(234)

Version

5.4.1

No response

Steps to Reproduce

option = {
color: ['#4992FF', '#394F71'],
tooltip: {
show: false,
trigger: 'item'
},
legend: {
bottom: '5%',
left: 'center',
show: false
},
series: [
{
name: '合格率',
type: 'pie',
hoverAnimation: true,
radius: ['60%', '100%'],
label: {
show: true,
position: 'center',
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' }
]
}
]
};

Current Behavior

我使用实例代码当我触摸其他区块时默认显示的name和我触摸的区块name发生了重叠现象

Expected Behavior

我想要在触摸其他区块时饼形图中间name只显示我触摸的区块

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

pobjuy32

pobjuy321#

@HanQiCheng It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗
TRANSLATED

TITLE

[Bug] When the position of the pie chart is center, the name displayed by touching other blocks overlaps with the default name

BODY

Version

5.4.1

No response

Steps to Reproduce

option = {
color: ['#4992FF', '#394F71'],
tooltip: {
show: false,
trigger: 'item'
},
legend: {
bottom: '5%',
left: 'center',
show: false
},
series: [
{
name: 'pass rate',
type: 'pie',
hoverAnimation: true,
radius: ['60%', '100%'],
label: {
show: true,
position: 'center',
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' }
]
}
]
};

Current Behavior

I use the example code. When I touch other blocks, the name displayed by default overlaps with the name of the block I touched.

Expected Behavior

I want the name in the middle of the pie chart to only display the block I touched when other blocks are touched

Environment

- OS:
-Browser:
- Framework:

Any additional comments?

No response

bvpmtnay

bvpmtnay2#

Why not use label.position: 'inner' ? Demo Code

j5fpnvbx

j5fpnvbx3#

You can use the emphasis api, like this:

label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: 40,
          fontWeight: 'bold'
        }
      },

Version

5.4.1

No response

Steps to Reproduce

option = { color: ['#4992FF', '#394F71'], tooltip: { show: false, trigger: 'item' }, legend: { bottom: '5%', left: 'center', show: false }, series: [ { name: '合格率', type: 'pie', hoverAnimation: true, radius: ['60%', '100%'], label: { show: true, position: 'center', }, data: [ { value: 1048, name: 'Search Engine' }, { value: 735, name: 'Direct' } ] } ] };

Current Behavior

我使用实例代码当我触摸其他区块时默认显示的name和我触摸的区块name发生了重叠现象

Expected Behavior

我想要在触摸其他区块时饼形图中间name只显示我触摸的区块

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

lzfw57am

lzfw57am4#

You can use the emphasis api, like this:

label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: 40,
          fontWeight: 'bold'
        }
      },

Version

5.4.1

No response

Steps to Reproduce

option = { color: ['#4992FF', '#394F71'], tooltip: { show: false, trigger: 'item' }, legend: { bottom: '5%', left: 'center', show: false }, series: [ { name: '合格率', type: 'pie', hoverAnimation: true, radius: ['60%', '100%'], label: { show: true, position: 'center', }, data: [ { value: 1048, name: 'Search Engine' }, { value: 735, name: 'Direct' } ] } ] };

Current Behavior

我使用实例代码当我触摸其他区块时默认显示的name和我触摸的区块name发生了重叠现象

Expected Behavior

我想要在触摸其他区块时饼形图中间name只显示我触摸的区块

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response
You can use the emphasis api, like this:

label: {
        show: false,
        position: 'center'
      },
      emphasis: {
        label: {
          show: true,
          fontSize: 40,
          fontWeight: 'bold'
        }
      },

Version

5.4.1

No response

Steps to Reproduce

option = { color: ['#4992FF', '#394F71'], tooltip: { show: false, trigger: 'item' }, legend: { bottom: '5%', left: 'center', show: false }, series: [ { name: '合格率', type: 'pie', hoverAnimation: true, radius: ['60%', '100%'], label: { show: true, position: 'center', }, data: [ { value: 1048, name: 'Search Engine' }, { value: 735, name: 'Direct' } ] } ] };

Current Behavior

我使用实例代码当我触摸其他区块时默认显示的name和我触摸的区块name发生了重叠现象

Expected Behavior

我想要在触摸其他区块时饼形图中间name只显示我触摸的区块

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Although this is a good idea, it doesn't meet my needs

lvmkulzt

lvmkulzt5#

Why not use label.position: 'inner' ? Demo Code

Thank you for reminding me that I have applied it to my project, but I still hope that the development team of echart can solve my problems

相关问题