title: nvd3 js - Refresh a "chart" data but keep filtered values
body: <p>When I filter some data in my nvd3 pieChart (using the built-in filter in the pieChart legend) and refresh/update my pieChart data, my previous filter is reset.</p>
  
  <p>I want to update the pieChart data, but I want to keep my filtered values.</p>
  
  <p>To update my pieChart data, I'm doing:</p>
  
  <pre><code>    function updateData3() {
          $.getJSON('/wso2-ui/dashboard3Servlet', function(data) {
              console.log(data)
  
              d3.select("#chart3")
              .datum(data)
              .transition().duration(1200)
              .call(chart3);
  
              nv.utils.windowResize(chart3.update);
  
              return chart3;
          });
      }
  </code></pre>
  
  <p>Here is an example:</p>
  
  <p>In image 1, I have my pieChart populated with data from a JSON.</p>
  
  <p>In image 2, I uncheck the "option Four" in the pieChart legend, and then my pieChart is updated properly.</p>
  
  <p>In image 3, as I'm doing a pieChart update with the code above, my pieChart legend is also updated (i.e. the option "Four" is checked again, automatically). This is what I don't want to happen.</p>
  
  <p>How can I update the pieChart with updated JSON <em>without losing the filters</em> applied via the pieChart legend ("One", "Two"...)?</p>
  
  <p><a href="https://i.stack.imgur.com/8YPOW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8YPOW.png" alt="enter image description here"></a></p>