Dan
Dan

Reputation: 829

Multiple d3 charts on one page

I have a cubism d3 chart on my page. I also want to add more charts to the page. Is it possible to add more d3 charts in the same page or will i have to use some other libraries?

I am asking this because every visualization in d3 uses .axis and if i give some style to cubism graph then it would affect other graphs as well.

Upvotes: 0

Views: 805

Answers (1)

user4815162342
user4815162342

Reputation: 1688

I would recommend wrapping the entire generating code in a function which specifies which DOM element you want to put the chart in as a parameter. This will leverage javascript closure and everything should work itself out.

Upvotes: 1

Related Questions