如何刷新画布尺?

时间:2019-09-21 17:15:18

标签: javascript asp.net canvas gauge

我希望更改SQL数据库中的数据而无需刷新页面-我正在使用画布规。我该怎么办?

      'use strict';
/** @type {!Array} */
var timers = [];
/**
 * @return {undefined}
 */
function animateGauges() {
  document.gauges.forEach(function(gauge) {
    setInterval(() => {
      /** @type {string} */
      gauge.value = document.getElementById("canvas").innerHTML.replace();
    }, 1000);
  });
}
;
<canvas runat="server" id="canvas" data-type="radial-gauge" data-units="m/min" data-min-value="0" data-max-value="50.00"
    data-major-ticks="0,5,10,15,20,25,30,35,40,45,50" data-width="300" data-height="300" data-bar-width="10"
    data-bar-shadow="5" data-color-bar-progress="rgba(86,86,86,.75)" data-minor-ticks="9" data-stroke-ticks="false"
    data-highlights='[
    { "from": 0, "to": 22, "color": "rgba(255,30,0,.25)" },
    { "from": 40, "to": 50, "color": "red" }
]'></canvas>

0 个答案:

没有答案