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

Gauge Chart - linking to data in project

Byron Kelly

Recommended Posts

Hi All

I am trying to create a Gauge Chart in my Spotfire Analyst project. I have no prior experience using Java Script or HTML code so I am struggling here.

I am trying to link the Gauge Chart to the data in my project, so that when I mark a table/chart, the Gauge Chart will update with revelant data related to the marking.

I have implemented a basic gauge chart based on code I found here :


This plots a static gauge chart, using a static number (#22 for 'visitors'); I would like to change the static number to a number based on my data.

1) How do I link the Gauge Chart to a calculated column in my dataset

2) How do I enable it to updated based on marking my data

I tried to modify the code and replace the #22 'value' with the name of the Calculate Column i want to chart, but it did not work.

I am trying to plot a % (one number divided by another, in this case production/capacity)

Here is what my modified JS looks like (which does not work)


calculated value:













//add scripts to head





init = function(){

var g = new JustGage({

id: "gauge",

value: "Production/Capacity",

min: 0,

max: 1.00

title: "Visitors"



//refresh gauge when calcvalue changes





}Any help would be GREATLY appreciated.



Link to comment
Share on other sites

  • 2 weeks later...
  • 1 year later...

Shandilyas example sometimes failsin 10.0.0 and later versions of Spotfire.


I'm attaching a modifiedexample where aMutationObserver is added, listening to two calculated values, and set the value and color of the gaugedepending on those two calculated values.

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