<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Visual retains old data on update in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Visual-retains-old-data-on-update/m-p/812696#M21030</link>
    <description>&lt;P&gt;I worked out what was wrong as I read through the post to check for spelling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You shouldn't append two different objects (in my case rect and text) to the same group with the same data bound to it.&amp;nbsp; Splitting the two object types into two different groups solved the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;</description>
    <pubDate>Tue, 08 Oct 2019 17:36:21 GMT</pubDate>
    <dc:creator>_JamesB</dc:creator>
    <dc:date>2019-10-08T17:36:21Z</dc:date>
    <item>
      <title>Visual retains old data on update</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Visual-retains-old-data-on-update/m-p/811408#M21017</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having an issue with a custom visual that I am developing.&amp;nbsp; 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.&amp;nbsp; When the data that feeds into my visual changes, the old data is retained such that text becomes illegible (see screenshots at the bottom).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An example of the code that draws out the values:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    let Values = container
            .selectAll('.value')
            .data(viewModel.dataPoints)

        Values.enter()
            .append('rect')
            .classed('.value', true)

        Values
            .attr({
                width: d =&amp;gt; d.Width,
                height: d =&amp;gt; d.ValueHeight,
                x: d =&amp;gt; d.ValueX,
                y: d =&amp;gt; d.ValueY
            })
            .style({
                'display': 'block',
                'stroke': "Black",
                'fill': "none",
                'stroke-width': 1
            })

        Values.enter()
            .append('text')
            .classed('.value', true)

        Values
            .text(d =&amp;gt; d.DisplayValue)
            .style({
                "display": "block",
                "font-size": "14px",
                "text-anchor": "middle",
                "alignment-baseline": "central",
                "fill": "Black"
            })
            .attr({
                width: d =&amp;gt; d.Width,
                height: d =&amp;gt; d.ValueHeight,
                x: d =&amp;gt; d.ValueX + d.Width / 2,
                y: d =&amp;gt; d.ValueY + d.ValueHeight / 2
            })&lt;/PRE&gt;&lt;P&gt;Does anyone know why this isn't working?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="When I first load the visual" style="width: 163px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/198357iB54FFD817F8DA8D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="On Load.png" alt="When I first load the visual" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;When I first load the visual&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="After I cause an update via a Slicer" style="width: 163px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/198356i8AA54283E172C9E9/image-size/large?v=v2&amp;amp;px=999" role="button" title="After update.png" alt="After I cause an update via a Slicer" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;After I cause an update via a Slicer&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2019 13:57:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Visual-retains-old-data-on-update/m-p/811408#M21017</guid>
      <dc:creator>_JamesB</dc:creator>
      <dc:date>2019-10-07T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: Visual retains old data on update</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Visual-retains-old-data-on-update/m-p/812696#M21030</link>
      <description>&lt;P&gt;I worked out what was wrong as I read through the post to check for spelling.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You shouldn't append two different objects (in my case rect and text) to the same group with the same data bound to it.&amp;nbsp; Splitting the two object types into two different groups solved the issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;</description>
      <pubDate>Tue, 08 Oct 2019 17:36:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Visual-retains-old-data-on-update/m-p/812696#M21030</guid>
      <dc:creator>_JamesB</dc:creator>
      <dc:date>2019-10-08T17:36:21Z</dc:date>
    </item>
  </channel>
</rss>

