Skip to Content
avatar image
Former Member

How to make Formatting Function dynamic

Below is a screenshot of the dashboard I am currently developing. My issue is with data binding for the gauges. My selectors on the left is supposed to control the data that feed into the bar graphs and the gauges. The bar graphs are responding dynamically based on the value selected from the selectors, but the gauges are not. Here are the things I've tried so far:

1. I used data binding for each gauge. First, I created a global script function that retrieves the data from the data source based on the user selection (I used the .getdata() function and assigned the value in global variables -- each gauge has a unique value; therefore, each gauge has its own variable.).

2. I called the global function when the "Salary Analysis" tab is selected. I then used formatter function to return the value of the variable from the global function. So far, the gauges show the correct values when I first click on the "Salary Analysis" tab, but the values don't change when I change the values of the selectors.

3. I then tried to call the same global function for each selector (I added the function to the "On Select" event scipt) hoping that the global function will be executed and change the values of each variable that are eventually assigned to the gauges, but with no success.

It looks like my other option is to create a button that will execute the global function, but I am trying to avoid that because the customer wants to see data change quickly without having to press a button (i.e. Apply) to see the change. I'm sure there is a way I can make this happen. I have only been using Design Studio for about 2 months now (I used to develop in Xcelsius), so I am not completely familiar with DS just yet. I hope someone can give me some ideas on how to make the gauges to work or the data binding to work dynamically. Thank you!

data-binding.jpg (151.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 12, 2017 at 12:44 AM

    Hi Alexandra,

    What you are facing is probably not an issue related to the Gauge component but related to how you are applying data binding or scripting. Also, I think there is a misunderstanding here about the term "data binding". Data binding involves directly linking a data source value to a component property. If you are using the getData() function then this means you are not in fact using data binding to update the Gauge component but scripting instead.

    As I understand it, you are populating a Global Variable with the Gauge value and then must be using some kind of setter script function to set the value of the Gauge. It would be helpful if you posted the script code that you are applying in the Global Script function as well as the script code in the "On Select" event of the selector controls.

    Regards,

    Mustafa.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 11, 2017 at 06:52 PM

    Hi Alexandra,

    I cant replicate the issue on my end as i dont have Guage component. I had demo from few vendors in the past but we didn't finalize yet.

    However we had similar use case to make Guage dynamic by binding property or using script. May i know where can i get similar Guages as yours please?

    Regards,

    Fahad

    Add comment
    10|10000 characters needed characters exceeded