title: Variable number using easy pie chart library
body: <p>I am trying to create a very simple way to change the value on submit on a variable which dictates the percentage of the pie chart using easy pie library.</p>
  
  <p>Here is the code it is very easy to use.</p>
  
  <pre><code>&lt;span class="chart" data-percent="0"&gt;
  &lt;span class="percent"&gt;&lt;/span&gt;
  &lt;/span&gt;
  &lt;input id="value1" type="text" /&gt;
  &lt;span&gt; + &lt;/span&gt;
  &lt;input id="value2" type="text" /&gt;
  &lt;span class="btn js_update" onclick="output();"&gt;Update chart&lt;/span&gt;
  &lt;p id="result"&gt; &lt;/p&gt;
  </code></pre>
  
  <p>The above starts the pie chart at 0% by setting the data-percent to 0</p>
  
  <pre><code>&lt;script src="../dist/easypiechart.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      function output(){
      var value1 = document.getElementById('value1').value;
      var value2 = document.getElementById('value2').value;
      document.getElementById('result').innerHTML = parseInt(value1) + parseInt(value2);
  }
  
  
  document.addEventListener('DOMContentLoaded', function() {
      var chart = window.chart = new EasyPieChart(document.querySelector('span'), {
          easing: 'easeOutElastic',
          delay: 3000,
          barColor: 'purple',
          trackColor: 'pink',
          scaleColor: false,
          lineWidth: 20,
          trackWidth: 20,
          lineCap: 'butt',
          onStep: function(from, to, percent) {
              this.el.children[0].innerHTML = Math.round(percent);
          }
      });
  
  
  
  
      document.querySelector('.js_update').addEventListener('click', function(e) {
          chart.update(Math.floor(val2));
      });
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>the above builds the pie chart - however I need a simple input field and submit to change the value of the variable <code>val1</code> I tried to use a return value but will not allow for that, I tried using jquery to write the value out but still not sure but I am sure it is a simple thing?</p>