Jump to content

Recommended Posts

Posted

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())

})

 

}

Posted
I tried it at my end, it works. On filter change, gauge shows new value. Can you provide sample dxp to look at what is causing it to not refresh data. Did you insert that javascript or just used that javascript in HTML using <script/>

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...