gpt4 book ai didi

javascript - dc.js中如何控制刷单交易效果?

转载 作者:行者123 更新时间:2023-11-28 06:53:59 24 4
gpt4 key购买 nike

我正在使用 dc.js 构建可视化数据分析工具的原型(prototype)。关于库的画笔功能,如何指定画笔选择的行为(AB)?

我使用相似的代码有两种不同的行为。

A中,选定的条形以“青色”突出显示,未选定的条形呈灰色。

B中,选定的条形也会以“青色”突出显示。然而,这一次它完全隐藏了未选择的栏。

有人可以告诉我应该使用/更改哪个函数/特性来定义AB吗?

A

     s.spendHistChart
.width(350).height(200)
.colors('teal')
.centerBar(true)
.dimension(cAmountDim)
.group(spendHist)
.x(d3.scale.linear().domain([0,100]))
.elasticY(true)

B

         s.chart2
.width(990).height(120)
.colors('teal')
.margins({top: 0, right: 50, bottom: 20, left: 80})
.dimension(s.moveMonths)
.group(s.dateDimensionSpend)
.centerBar(true)
.gap(20)
.x(d3.time.scale().domain([new Date(2013, 0, 1), new Date(2015, 11, 31)]))
.elasticX(false)
.round(d3.time.month.round)
.alwaysUseRounding(true)
.xUnits(d3.time.months);

我肯定错过了一些东西。我希望你能帮助我。

最佳答案

A 是预期的行为。

跨过滤器维度只会观察其他维度的变化。

过滤发生在维度上,但 dc.js 从组中读取数据。

因此,如果图表的组不属于其维度,则图表将观察其自己的过滤器,这通常不是所需的行为。

https://github.com/square/crossfilter/wiki/API-Reference#dimension_group

关于javascript - dc.js中如何控制刷单交易效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32721622/

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