toorshia/justgage

Changing value dynamically?

beicnet opened this issue ยท 1 comments

Hi there,

How can I change the value dynamically with Ajax or JavaScript?

Thank you for the answer! ๐Ÿ˜‰

Kind regards,
Viktor

you can do it using the refresh function

let g = new JustGage({
      id: "gauge",
      value: 67,
      min: 0,
      max: 100,
      title: "Water Level",
      symbol: "%",
      // levelColors: "#209CEE"
      levelColors: ["#209CEE", "#209CEE", "#209CEE"]
    })

    // wil change the value from 67 to 42
    g.refresh(42)