user2462090
user2462090

Reputation: 119

Can d3.js graph put inside a table?

I am new to d3.js, currently i am using this js to generate a graph. The graph is append to a <div>. I am wondering is it possible to put this graph inside a table? Thank you so much!

Upvotes: 2

Views: 1581

Answers (1)

Pablo Navarro
Pablo Navarro

Reputation: 8264

Yes, it's possible. The best way to do it is creating a reusable chart, create a selection with the cells, bind your dataset and invoke the chart using selection.call. You can even create the table with D3.

There is a number of valid reasons to put a chart inside a table. For instance, it can be useful to put sparklines in a table cell to complement the information given in each row.

Upvotes: 3

Related Questions