Announcement
Collapse
No announcement yet.
X
-
Note that we've added Gauge.setValueRange(min, max) in 13.0 - for previous versions, just use the workaround in post #4
-
This behavior, while a bit weird, is actually documented on both setMinValue() and setMaxValue() - your sure-fire workaround right now would be to set one of the values twice - set min, max, min - or max, min, max.
We'll likely add an API that accepts both values in a single call, and we'll update here if we do.Last edited by Isomorphic; 2 Apr 2021, 08:36.
Leave a comment:
-
The behavior was not consistent depending on the new values being displayed, which had baffled me. This was just one use case that I could reproduce consistently. When I added in that workaround, it fixed several cases, but I still saw some issues. After further testing, this is what I discovered:- If the previous minValue is LOWER than the current minValue, then you have to set maxValue first
- If the previous minValue is HIGHER than the current minValue, then you have to set minValue first.
Thanks so much for your assistance!
Leave a comment:
-
This is an order-of-operations issue - you can fix it by just setting the max before setting the min.
We'll address it in the framework in the coming days.
Leave a comment:
-
Updating Gauge Values and Sectors
I'm using SmartClient_v121p_2020-04-14_PowerEdition. I have an application where the user clicks on a row in a ListGrid and a window is created with a Gauge component that is built based on the values in ListGrid record that I am passing in. This works great. What I am having trouble with is that when a new row in the ListGrid is selected, I try to update the Gauge using the new values passed in. The code looks something like this:
Code:// Update gauge let gaugeSectors = [ {value: record.value, fillColor: "green"}, {value: record.maxValue, fillColor: "green"} ]; gauge.setMinValue(record.minValue); gauge.setMaxValue(record.maxValue); gauge.setValue(record.value); gauge.setSectors(gaugeSectors);
Replace the code in the click function of the "Add Sector" button with this:
Code:gauge.setMinValue(2700); gauge.setMaxValue(3000); gauge.setValue(2790); var sectors = [{value: 2790, fillColor: "green"}, {value: 3000, fillColor: "green"}]; gauge.setSectors(sectors);
I know there has to be a minimum of 1 sector. It seems as though setSectors isn't fully replacing the sectors at first.
Thanks for any insight you can provide.Tags: None
Leave a comment: