0
votes

I am working on d3.js and dc.js libraries from few weeks. I have created scatter plot in d3.js and bar graph in dc.js. I want to know that is there possibility to interact between these two different graphs created in two different javascripts. In short, is it possible to interact between two different graphs created in d3.js and dc.js?

thank you.

1
The short answer is yes.Lars Kotthoff
thank you sir. for your reply. but can you give me an example with code so that i can understand it properly. also you can mail me on [email protected]user3560535
It really depends on what kind of interaction and charts you have. What specifically are you having trouble with?Lars Kotthoff

1 Answers

0
votes

Not going to give you the codes, sorry.

You'll want to use crossfilter as the bridge between the graphs, though:

  • create a dimension which is for the scatterplot (different from the dimensions used in the dc.js charts, but same crossfilter instance)
  • react to the interaction in d3 and set the filter on that dimension

Often when creating a dimension for a scatterplot, you will use a key that is unique for each row, or barring that, the row index itself. If you search around for dc.js scatterplot or bubblechart, you ought to find examples.

Also dc.js has a scatterplot now. It needs some love and is not as feature-rich as the bubble plot, but it exists.