jakezatecky / d3-funnel

A JavaScript library for rendering funnel charts using the D3.js framework.
http://jakezatecky.github.io/d3-funnel/
MIT License
330 stars 97 forks source link

Power BI Custom Visual #124

Closed grajamanickam closed 4 years ago

grajamanickam commented 4 years ago

@jakezatecky Thanks for the excellent d3-funnel library. I am trying to create a Power BI custom visual using your d3-funnel library. I can't able to get the funnel drawn

Here is my code

this.svg = d3.select(options.element) .append('svg') .classed('d3Funnel', true);

this.container = this.svg.append("g") .classed('container', true) .attr("id", "container");

this.funnel = this.container.append("div") .classed("bhFunnel", true) .attr("id", "bhFunnel");

const data = [ { label: 'Inquiries', value: 5000 }, { label: 'Applicants', value: 2500 }, { label: 'Admits', value: 500 }, { label: 'Deposits', value: 200 }, ];

const option = { chart: { height: 400, }, block: { dynamicHeight: true, minHeight: 15, }, };

const chart = new D3Funnel(this.funnel); chart.draw(data, option);

grajamanickam commented 4 years ago

Started working now after I changed the code to var chart = new D3Funnel("#container");