dc.js rowChart-使整个行可单击吗? [英] dc.js rowChart - make entire row clickable?
问题描述
我有一个dc.js rowChart(使用当前的稳定版本)。很美丽。我需要使其更易于触摸。
I've got a dc.js rowChart (using the current stable release). It's beautiful. I need it to be more touch-friendly though.
特别是,值较小的行的条形很小,很难挖掘。我要做的是使用户可以单击行上的任意位置以选择/取消选择该行,而不必直接单击栏。
In particular, rows with small values have very tiny bars and are very hard to tap. What I'd like to do it make it such that the user can click anywhere on a row to select/deselect that row rather than having to click directly on the bar.
这可能吗?
推荐答案
作为一个非常棘手的解决方案,我能够在标签后添加一堆不间断的空格,并获得以下效果:
As a very hacky solution, I was able to add a bunch of non-breaking spaces after the label and get this effect:
.label(function (d) { return /* your label here */ + new Array(100).join('\xa0'); })
(一个看不见的元素会更好。)
(An invisible element would be better.)
这篇关于dc.js rowChart-使整个行可单击吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!