Closed Allusgod closed 1 year ago
I have added the d3-funnel in my Angular project. but While running it show the above error.
html Code is
<div class="funnel-wrapper"> <div id="funnel"></div> </div>
Ts Code is
import { Component, AfterViewInit } from '@angular/core'; import { D3Funnel } from "d3-funnel"; @Component({ selector: 'app-funnel-chart', templateUrl: './funnel-chart.component.html', styleUrls: ['./funnel-chart.component.css'] }) export class FunnelChartComponent implements AfterViewInit { public funnel: any; public ngAfterViewInit() { this.drawFunnelChart(); } private drawFunnelChart(){ let options; if (!options) { options = { block: { minHeight: 15, highlight: true, barOverlay: false, }, label: { enabled: true, fontFamily: null, fontSize: '14px', fill: 'white', format: '{l}: {f}', }, tooltip: { enabled: true, format: '{l}: {f}', }, chart: { animate: 100, width: 500, height: 400, inverted: true, bottomPinch: 1, }, }; } this.funnel = new D3Funnel('#funnel'); this.funnel.draw( [ { label: 'Total 1', value: 90, backgroundColor: '#FF9D1F', }, { label: 'Total 2', value: 60, backgroundColor: '#ac9a1F', }, { label: 'with compliance standard', value: 15, backgroundColor: '#428DEC', }, { label: 'Pass', value: 10, backgroundColor: '#00d2d3', }, { label: 'Pass', value: 50, backgroundColor: '', }, ], options ); } }
It was my mistake. I tried just import D3Funnel from "d3-funnel";
import D3Funnel from "d3-funnel";
I have added the d3-funnel in my Angular project. but While running it show the above error.
html Code is
Ts Code is