krispo / ng2-nvd3

Angular2 component for nvd3
http://krispo.github.io/ng2-nvd3/
MIT License
328 stars 104 forks source link

How to properly use NvD3 methods to destroy the chart? #94

Closed cassmtnr closed 1 year ago

cassmtnr commented 7 years ago

I have a lineChart and when I navigate to a children route or a parent route, the tooltips keep on my DOM, if I use

ngOnDestroy() { .selectAll('.nvtooltip').remove(); }

It will destroy my tooltips, but I wanted to destroy my chart too.

What about the method clearElement(), how do I use that referencing to the nvd3 chart? Tried with viewChild on my chart but it didn't worked.

cht8687 commented 7 years ago

+1