[英]How to get total number of levels in sunburst chart?
I'm using a sunburst chart and trying to show the total number of levels in chart.title.我正在使用森伯斯特图表并尝试在chart.title 中显示级别总数。 I have read about Levels and Leaves but I haven't found anything that gives me the total number of levels.
我已经阅读了有关Levels 和 Leaves 的内容,但我没有找到任何可以提供级别总数的信息。 Example
例子
To achieve that you'll need to use the tree data traverser: https://api.anychart.com/v8/anychart.data.Traverser .为此,您需要使用树数据遍历器: https : //api.anychart.com/v8/anychart.data.Traverser 。 It'll help you go through the data and count the maximum number of levels.
它将帮助您浏览数据并计算最大级别数。 Check this sample: https://playground.anychart.com/2iq3nYxu .
检查此示例: https : //playground.anychart.com/2iq3nYxu 。 Please note that counting starts from 0, which means you'll have to add 1 to the value when showing the result (line 22).
请注意,计数从 0 开始,这意味着您必须在显示结果(第 22 行)时将值加 1。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.