Corinne Tamburis Posted March 11, 2020 Posted March 11, 2020 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()) }) }
Khushboo Rabadia Posted March 11, 2020 Posted March 11, 2020 There is one dxp present in this post -https://community.spotfire.com/questions/gauge-chart-linking-data-project It contains JS script which would work for your case.
Corinne Tamburis Posted March 12, 2020 Author Posted March 12, 2020 Already tried using the js included in that working_gauge.dxp, but it keeps not working
Khushboo Rabadia Posted March 12, 2020 Posted March 12, 2020 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/>
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now