question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

updated values failed to redraw the correct needle value

See original GitHub issue

When updating the needle values for the radial gauge component, the watch function will not update the needle value on the first try. It settles at zero a few times before accepting the new value.

<template>
  <canvas class="canvas-gauges"></canvas>
</template>

<script>
import { RadialGauge } from 'canvas-gauges'
export default {
  props: {
    value: Number,
    options: {
      type: Object,
      default: () => ({})
    }
  },
  data: function () {
    return {
      chart: null
    }
  },
  mounted: function () {
    this.chart = new RadialGauge(Object.assign({}, this.options, { renderTo: this.$el, value: this.value }))
      .draw()
  },
  beforeDestroy: function () {
    this.chart.destroy()
  },
  watch: {
    value: function (val) {
      this.chart.value = val
    },
    options: function (opt) {
      this.chart.destroy()
      this.chart = new RadialGauge(Object.assign({}, this.options, {renderTo: this.$el, value: this.value})).draw()
    }
  }
}
</script>

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
ptorrentcommented, Jun 14, 2018

Hi there ! Same problem here. If I do gauge.update ({value: 100}) then gauge.value = 2000 the needle is not correct (0 unitl I set a new value) …

It looks like an animation problem. If I disable the animation everything works fine.

Any idea ?

1reaction
ylebrecommented, Feb 8, 2019

@MichaelSprague That fixes the issue for my usecase, let me know if you need help with putting together a pull request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Autoreferencing values for needle missing - Agilent Community
The error in we are seeing reads as "Autoreferencing values for needle missing (EE25146.0). Cold restart, reinstalling the needle seat and loop, ...
Read more >
How to deal with 'Update was terminated' issue - SAP Blogs
And click the 'Display Update Data' button to verify the value of accordingly table and structure.
Read more >
Empty needle error in logs - WordPress.org
hi, it is happening because you have an empty location permalink slug in your settings under Pages > Permalink Slugs. If you add...
Read more >
Certified LabVIEW Associate Developer Exam Test Booklet
Which of the following is the best method to update an indicator on the front panel? a. Use a Value property node b....
Read more >
COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Employee Error Details. Entering work hours before they have actually been worked. Employees are not allowed to record their work time until they...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found