目录
1.环状饼图默认显示第一条数据及提示框
- 效果展示:
// 默认展示第一条数据的提示框 myChart.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: 0 }); // 默认高亮展示第一条数据 myChart.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 }); myChart.on('mouseover', (v) => { if (v.dataIndex != 0) { // 高亮显示悬停的那块 myChart.dispatchAction({ type: 'hideTip', seriesIndex: 0, dataIndex: 0 }); // 当检测到鼠标悬停事件,取消所有选中高亮 myChart.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: 0 }); } }); // 检测鼠标移出后显示之前默认高亮的那块 myChart.on('mouseout', (v) => { myChart.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: 0 }); myChart.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: 0 }); });
2.环状饼图鼠标移动上去后不突出显示
- 效果展示:鼠标移动上去之后,图表保持原样,而不是像 1 中那样突出展示
- 扇形不突出:series / hoverAnimation: false
3.环状饼图中间展示指定样式数字
- 效果展示:见 2 中的环状图中间文字数字的效果
- 为中间内容指定单独样式: series / emphasis / label / formatter + rich
emphasis: { label: { // 未指定元素时,其他文本的样子



2万+

被折叠的 条评论
为什么被折叠?



