dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.41k stars 1.81k forks source link

How to create new chart using HTMLelement ? #1820

Closed Madasamy26 closed 3 years ago

Madasamy26 commented 3 years ago

I am trying to create new chart with typescript like below

let chart = new barChart("#id");

But I want to create a new chart using HTMLElement node let chart = new barChart(node);

But in barChart type restricts the HTMLElement !!!

How to do that?

kum-deepak commented 3 years ago

Internally the charts use d3 selection. If it is a string, it is passed to d3.select, if not it is assumed to be d3 selection. So, you should try the following:

let chart = new barChart(d3.select(node));