gpt4 book ai didi

javascript - 如何在过滤图表后获取当前组大小

转载 作者:行者123 更新时间:2023-12-03 08:59:05 25 4
gpt4 key购买 nike

我有 2 个图表。在过滤第二个图表时,如何获得过滤后的firstchartGroup大小,就像过滤后的firstchartDim一样?

我试过了

chart2.on("filtered",function(chart)
{
console.log(firstchartDim.top(Infinity).length);//including filters
console.log(firstchartGroup.size());//independent of filters

});

有什么建议吗?

最佳答案

当垃圾箱变空时,交叉过滤器不会将其删除,因此您在计算垃圾箱时必须手动忽略零。这是执行此操作的一种方法,adapted from the FAQ :

console.log(firstchartGroup.all().filter(function(d) { return d.value != 0; }).length);

关于javascript - 如何在过滤图表后获取当前组大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32370113/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com