Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi There,
I'm having an issue with a custom visual that I am developing. As far as I can tell there's no real difference from a previous visual that I created that doesn't suffer from this issue. When the data that feeds into my visual changes, the old data is retained such that text becomes illegible (see screenshots at the bottom).
An example of the code that draws out the values:
let Values = container .selectAll('.value') .data(viewModel.dataPoints) Values.enter() .append('rect') .classed('.value', true) Values .attr({ width: d => d.Width, height: d => d.ValueHeight, x: d => d.ValueX, y: d => d.ValueY }) .style({ 'display': 'block', 'stroke': "Black", 'fill': "none", 'stroke-width': 1 }) Values.enter() .append('text') .classed('.value', true) Values .text(d => d.DisplayValue) .style({ "display": "block", "font-size": "14px", "text-anchor": "middle", "alignment-baseline": "central", "fill": "Black" }) .attr({ width: d => d.Width, height: d => d.ValueHeight, x: d => d.ValueX + d.Width / 2, y: d => d.ValueY + d.ValueHeight / 2 })
Does anyone know why this isn't working?
Many Thanks,
James
I worked out what was wrong as I read through the post to check for spelling.
You shouldn't append two different objects (in my case rect and text) to the same group with the same data bound to it. Splitting the two object types into two different groups solved the issue.
Thanks,
James
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
11 | |
3 | |
2 | |
2 | |
2 |