问题
I'm new on dc.js and I have some questions about flexibility of dc.
First, I have looked for answers but haven't yet found any of them.
1) I'm using dc.sunburst chart. I was wondering if it was possible to create Zoomable sunburst as it is actually the case with d3.js. If yes, can you provide a piece of code please..?
2) I'm using crossfilter for interacting several graphs together. However I would like that one of them would not be possible to filter with. I mean that it updates with his dimension/group when filtering on other chart but that filtering other chart clicking on it would be impossible. Any ideas ?
Like: dc.rowChart().on("click", Do not filter)
3) I want to create a dropdown
(using dc.menuSelect
and crossfilter
) on a two-dimension. When I create this chart the dropdown
is like:
- Bâle, A1
- Bâle, A2
- ...
- Bâle, N2
And I would like something more like:
- Bâle
- A1
- A2
- ...
- N2
- Zürich
- A1
- ...
- N2
Thanks for your answer !!
回答1:
I'll answer just question number 2, since I know the answer to that one.
dc.js does not provide an option to disable the click behavior for the row chart. However, in this case you can just override the handler:
rowChart.onClick = function() {};
The greatest strength of dc.js is also its greatest weakness: there have been a lot of contributors, which means the library has a ton of features. However, the interface may not always be consistent. In this case, many of the charts can have filtering disabled by calling .brushOn(false)
- but not the row chart!
At the same time, dc.js is designed with an open architecture and there is almost always a way to workaround or patch in extra features.
来源:https://stackoverflow.com/questions/50645419/dc-sunburst-dc-menuslect-dc-non-interactive-graph