【发布时间】:2014-04-22 09:28:40
【问题描述】:
我正在使用基于 d3 和 crossfilter 的 Dimensional Charting javascript 库 dc.js 制作行图。我正在显示顶部(10)数据的行图。但我正在尝试显示底部(10)数据的行图,但图形可以显示与顶部(10)数据相同。如何显示底部(10)数据。
constRowChart.width(350)
.height(1000)
.margins({top: 20, left: 120, right: 10, bottom: 20})
.transitionDuration(750)
.dimension(density)
.group(const_total)
.renderLabel(true)
.gap(1)
.title(function (d) {
return "";
})
.elasticX(true)
.colors(d3.scale.category20c())
.ordering(function(d) { return d.value })
.xAxis().ticks(3).tickFormat(d3.format("s"));
constRowChart.data(function (group) {
return group.top(10);
});
【问题讨论】:
-
没有
bottom功能,但您可以尝试颠倒元素的顺序并再次获得前 10 名。 -
感谢@LarsKotthoff 帮助回答了这么多问题。即使您不关心声誉,也请考虑使用“答案”部分,以便我们可以将更多这些问题标记为已回答。它会让我的“园艺”更容易。