Jump to content
We've recently updated our Privacy Statement, available here. ×

Gauge's calculated value resets itself when I change filters or click on other text areas


Corinne Tamburis

Recommended Posts

Hi all,

I have a problem with a Gauge's calculated value (defined as ratio of two colums): when I open the dxp, the gauge's calculated value correctly appears (fig. 1), but if I change any filters value or I click on another text area, the gauge's calculated value resets itself (fig. 2, where I uncheck two filters).

As js I used the following one:

 

 

 

 

 

resource=[

"//cdn.jsdelivr.net/raphael/2.1.0/raphael-min.js",

"//cdn.jsdelivr.net/npm/justgage@1.2.2/justgage.min.js"

]

//add scripts to head

$.getScript(resource[0],function(){

$.getScript(resource[1],init)

})

init = function(){

//var perc = "55";

var g = new JustGage({

id: "gauge",

value: $('#calcValue').text().replace(',', '.'),

min: 0,

max: 100,

decimals: 2,

title: "Tasso Acquisizione Globale",

levelColors : [ "#FF0000", "#FFE000", "#00FF00" ],

levelColorsGradient: true,

symbol:'%',

pointer: true,

gaugeWidthScale: 0.7,

counter: true,

relativeGaugeSize: true,

});

//refresh gauge when calcvalue changes

$(calcValue).one('DOMSubtreeModified',function(){

g.refresh($(this).text())

})

 

}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...