Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I am trying to create a rect object and set its fill using a pattern. So I create a defs element, create a pattern, set an image and in the fill property of the rect object set it fill using the css url. Like so:
this.imageRect = this.svg .append('rect') .classed('engine-rect', true); let defs = this.svg .append('defs'); defs.append('pattern') .attr({ id: 'image', height: '100%', width: '100%', patternContentUnits: 'objectBoundingBox' }) .append('image') .attr({ height: 1, width: 1, preserveAspectRatio: 'none', 'xlink:href': "../assets/engine_part.png" }) this.imageRect .attr({ x: 50, y: 50, width: 50, height: 50, fill: 'url(#image)' })
This doesn't work. When I inspect the defs element in the browser I see the following:
I can see that PowerBI is treating the path to the image as a link and not a local file. How can I fix this?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
13 | |
2 | |
2 | |
1 | |
1 |