lundi 20 août 2018

Need to remove one meter box using HTML,CSS and Javascript

I have a code For HTML,CSS and JavaScript for a meter.Now the issue is for this code I am getting two same meters just one after another from top to bottom where as I need only one.I am not be able to understand how to resolve this issue.My code is given below:

Edit html
<DIV id=Gauge style="HEIGHT: 150px; WIDTH: 200px"></DIV><SPAN id=calcValue><SpotfireControl id="fd2a50e39d384ff2b5c0c9bb03d15137" /></SPAN>

Javascript

//define your javascript libraries
resource=[
 "//cdn.jsdelivr.net/raphael/2.1.0/raphael-min.js",
 "//cdn.jsdelivr.net/justgage/1.0.1/justgage.min.js"
]

//add scripts to head
$.getScript(resource[0],function(){
 $.getScript(resource[1],init)
})

//start your widget
init=function(){
  var g = new JustGage({
    id: "Gauge", 
    value:  parseInt($("#fd2a50e39d384ff2b5c0c9bb03d15137").text()), 
    min: -1000,
    max: 1000,
    title: "Operating Margin%"
  });

  //refresh gauge when calcvalue changes
  $(calcValue).on('DOMSubtreeModified',function(){
    g.refresh($(this).text())
  })
}

How to resolve this issue so that I am getting only one meter box instead of two?




Aucun commentaire:

Enregistrer un commentaire