title: canvas gauge dynamic object update value
body: <p>I am using Canvas-gauge from here <a href="https://canvas-gauges.com" rel="nofollow noreferrer">canvas-gauges.com</a></p>
  
  <p>I create multiple gauges dynamically in a loop as follows (loop not shown);</p>
  
  <pre><code>&lt;canvas id="canvas_&lt;?php echo $device_pk; ?&gt;"&gt;&lt;/canvas&gt;
  
  &lt;script type="text/javascript"&gt;
      var gg = "gauge_" + "&lt;?php echo $device_pk; ?&gt;";
      this[gg] = new RadialGauge({
          renderTo: 'canvas_&lt;?php echo $device_pk; ?&gt;',
          height: 200,
          .....other properties here.....
      }).draw();
  &lt;/script&gt;
  </code></pre>
  
  <p>which displays the gauges correctly.</p>
  
  <p>I then want to update the gauge values using javascript/ajax. In ajax, I post each/all the $device_pk values and the result returned is a json string formatted as <code>{"gauge_8":"22.3","gauge_12":"0","gauge_15":"-5"}</code> which I then do</p>
  
  <pre><code>success : function(result) {
      var data = $.parseJSON(result);
      $.each(data, function (k,v) {
           console.log(k + ' is ' + v);
           //k.value = v;
           //k.value = Number(v);
           k['value']= Number(v);
       });
   },
  </code></pre>
  
  <p>which shows me the correct 'k' and 'v'info in the console log.
  What I can't work out is how to update the gauge named 'k' with the data value 'v'.
  This is normally done using <code>gauge_23.value = 10.2;</code> on the condition that the created gauge is called 'gauge_23' of course.</p>
  
  <p>Just to test, I identified a correct gauge name for a gauge being displayed and temporarily hard coded in <code>gauge_23.value = 10.2;</code> to occur from a button click and it works and updates the gauge.</p>
  
  <p>I am certain the problem lay in the way I am trying to update the dynamically created gauge objects (are they objects?) or the way I am creating them, but I have just about given up.</p>