How to add dc-addons/dc-leaflet.js to an Angular project?

123 views Asked by At

I am building an Angular app with dc and leaflet. The dc charts work fine,but on including the dc.leafletCustomChart for including the map, an error comes up saying dc.leafletCustomChart is not a function. That is because it is an extension of the dc library which is available in dc-addons.

Now I have installed dc, leaflet, dc-addons and dc.leaflet and imported d3,dc,crossfilter2,leaflet,dc-addons and dc.leaflet to the component.

I even tried going to angular-cli.json and add

"scripts": [ "../node_modules/dc-addons/dist/leaflet-map/dc-leaflet.js" ]

Even then I keep getting the error dc.leafletCustomChart is not a function in Component.

Where am I going wrong? Any kind of help would be greatly appreciated. Thanks.

0

There are 0 answers