Forum Discussion

giorgikok's avatar
giorgikok
Frequent Visitor
3 years ago
Solved

Delete/cleanup custom visual whenever the necessary data is not longer bound

Hello, 

I am trying to figure out why my column chart visual is not properly deleting after adding the data and then removing it. For instance, removing categories should void the visual since it can't display it anymore but the columns stay on with the last data they've received also without properly scaling to the visual window. 

I am wondering what the problem might be, the destroy() method only does sets the this.svg to null which should be enough to delete the visual from the display window. 

  • I figured it out: just had to do this.barContainer.selectAll("*").remove(); whenever the necessary conditions for deletion were met. 

1 Reply

  • giorgikok's avatar
    giorgikok
    Frequent Visitor

    I figured it out: just had to do this.barContainer.selectAll("*").remove(); whenever the necessary conditions for deletion were met.