如何删除ANTD甜甜圈图表悬停并选择效果
在 @ant-design/int的甜甜圈图中,
- 悬停在甜甜圈图的各个部分周围有一个黑色边界。
- 选择时,单个部分将从中心转移。
如何停止/控制这些行为?
const config = {
appendPadding: 10,
data,
angleField: 'value',
colorField: 'type',
radius: 1,
innerRadius: 0.6,
label: {
type: 'inner',
offset: '-50%',
content: '{value}',
style: {
textAlign: 'center',
fontSize: 14,
},
},
interactions: [
{
type: 'element-selected',
},
{
type: 'element-active',
},
],
statistic: {
title: false,
content: {
style: {
whiteSpace: 'pre-wrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
content: 'AntV\nG2Plot',
},
},
};
In the donut chart in @ant-design/plots,
- There is a black border around the individual sections of the donut chart when hovered.
- The individual section is translated away from the center when selected.
How to stop/ control these behavior?
const config = {
appendPadding: 10,
data,
angleField: 'value',
colorField: 'type',
radius: 1,
innerRadius: 0.6,
label: {
type: 'inner',
offset: '-50%',
content: '{value}',
style: {
textAlign: 'center',
fontSize: 14,
},
},
interactions: [
{
type: 'element-selected',
},
{
type: 'element-active',
},
],
statistic: {
title: false,
content: {
style: {
whiteSpace: 'pre-wrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
content: 'AntV\nG2Plot',
},
},
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
处理配置中的交互
删除对象
类型:'元素激活'
注意:通过在下面的代码中评论来传达删除。
删除对象
类型:“元素选择”'
注意:通过在下面的代码中评论来传达删除。
为了实现这两者,您可以简单地从配置对象中删除
交互
。Deal with interactions in config
Remove the object
type:'element-active'
Note: Removing is conveyed by commenting out in the code below.
Remove the object
type: 'element-selected'
Note: Removing is conveyed by commenting out in the code below.
To achieve both you can simply remove the
interactions
from the config object.