Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
ConnectedRoman
Frequent Visitor

Image leaves behind artifacts when resized

Hello,

 

I have finally succeeded in creating a working custom visual.

 

I have also successfully added an image to the visual:

 

let image = this.svg.append("svg:image")
        .attr('x', 15)
        .attr('y', -10)
        .attr('width', width * 0.2)
        .attr('height', height * 0.2)
        .attr("xlink:href", logo) //logo is a path
 

However, resizing this image with transparent background leaves behind artifacts, like this:

 ImageArtifact.PNG

Using a picture with a white background works better, but it doesn't really fix the problem as resizing the picture quickly leaves the same trail. I can "draw" with the picture, so if I rezize the visual slowly enough I can hide the artifacts. That is not my goal though, as those artifacts shouldn't be there in the first place.

 

How do I fix that?

 

EDIT: I just noticed, that it doesn't leave behind artifacts if the visual is resized with the "latches" on the top or left side. Those only stay there if the middle right, bottom right, and bottom middle ones are used. Is the problem somehow with points the image is attached to?

1 ACCEPTED SOLUTION

@ConnectedRoman,

 

That's because 'svg:image' is not a valid selector.

d3.selectAll('svg > image').remove();
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@ConnectedRoman,

 

Every time the custom visual is resized, it will call update method. So in your case, more and more new images are appended.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft

 

Thank you for your answer - that's what I thought. 

 

How should I got about fixing it?

 

Adding a 

 

d3.selectAll('svg:image').remove();

before the code where I add the picture only accomplishes that the image doesn't even show up in the visual. I also tried initializing image in the class scope but the image still doesn't show up that way.

 

 

@ConnectedRoman,

 

That's because 'svg:image' is not a valid selector.

d3.selectAll('svg > image').remove();
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That worked, thank you for bearing with my noobines.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.