在我的饼图的某些情况下,我想向用户显示 the percentage relative to slices of the Pie Chart instead of showing the values of the slices .
例如:我的馅饼中有三个切片: A
代表馅饼的70%, B
代表馅饼的15%, C
代表馅饼的15% .
当我单击隐藏切片 A
时,我想向用户显示剩余切片的百分比,在此示例中,它将是 B
= 50%和 C
= 50% .
Is it possible in NVD3?
Important: 我不想在点击隐藏某些切片时重新加载图表 .
1 回答
您可以使用
chart.tooltipContent
覆盖图表工具提示标签 . 以下内容改编自NVD3网站上的实时代码示例 . http://nvd3.org/livecode/#codemirrorNav示例:http://plnkr.co/edit/UiGLIj?p=preview