Google 图表在图例中显示空项目
在 Google Charts 中使用饼图时,它似乎会忽略值为零的项目。我真的很想让这些项目显示在图例中,即使它们的值为零,以便用户知道这是问题的可能答案。有没有办法让零值项目仍然显示在图例中?
When working with the pie chart in Google Charts it seems to ignore items with a value of zero. I would really like to get these items to show up in the legend even though their value is zero so that the users knows that it was a possible answer to the question. Is there a way to have a zero value item still show up in the legend?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将切片可见性阈值设置为 0 为我解决了这个问题。请注意最后一个选项
sliceVisibilityThreshold
。(取自示例饼图)。
默认情况下,阈值设置为 1/720,这意味着(来自文档):
Setting the slice visibility threshold to 0 solved it for me. Notice the last option
sliceVisibilityThreshold
.(taken from the sample pie chart).
By default, the threshold is set to 1/720, which means (from the docs):