🎁📬❄️📦 Holiday Shipping Deadlines are approaching! International customers and domestic ground - get your orders in 12/9/2020 📦❄️📬🎁
0

Handling of units after a value
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Handling of units after a value

by cjdshaw on Tue Oct 27, 2020 4:35 pm

I've been experimenting with instead of specifying
value=20.0
including a unit like
value=20.0°C

Sometimes they'll graph properly and sometimes they won't. Or they'll graph properly, but when the page reloads, the graph will have a gap. I haven't been able to spot a pattern.

Is there a proper way to handle this? If not, would it be possible for some of the blocks like Gauge, Slider or Text to have a "Prefix" and "Suffix" field. That way you could have "$" in prefix and "c" in suffix, and have 20.00 displayed as
$20.00c

cjdshaw
 
Posts: 55
Joined: Mon May 08, 2017 4:04 pm

Re: Handling of units after a value

by brubell on Wed Oct 28, 2020 11:51 am

cjdshaw wrote: If not, would it be possible for some of the blocks like Gauge, Slider or Text to have a "Prefix" and "Suffix" field. That way you could have "$" in prefix and "c" in suffix, and have 20.00 displayed as
$20.00c


You can addd Gauge Label, but possibly a prefix/suffix would be more succinct. I'll add it into the internal feature request trackers.


Sometimes they'll graph properly and sometimes they won't. Or they'll graph properly, but when the page reloads, the graph will have a gap. I haven't been able to spot a pattern.

Is this only with the Line Chart Block? or are you experiencing this with other blocks

brubell
 
Posts: 1116
Joined: Fri Jul 17, 2015 10:33 pm

Re: Handling of units after a value

by cjdshaw on Wed Oct 28, 2020 12:22 pm

brubell wrote:You can addd Gauge Label, but possibly a prefix/suffix would be more succinct. I'll add it into the internal feature request trackers.

Labels and titles come out above or below the value, and in a different font size. A prefix/suffix which maintains the style of the value would look much better. Thanks for adding it

brubell wrote:
Sometimes they'll graph properly and sometimes they won't. Or they'll graph properly, but when the page reloads, the graph will have a gap. I haven't been able to spot a pattern.

Is this only with the Line Chart Block? or are you experiencing this with other blocks

It's mainly with the Line Chart Block. It often seems that if you include a suffix, like 32.5c it'll display the value live, but when you refresh the page, it'll vanish from the line chart. Guages seem to just ignore the suffix

cjdshaw
 
Posts: 55
Joined: Mon May 08, 2017 4:04 pm

Re: Handling of units after a value

by brubell on Fri Oct 30, 2020 9:46 am

It's mainly with the Line Chart Block. It often seems that if you include a suffix, like 32.5c it'll display the value live, but when you refresh the page, it'll vanish from the line chart. Guages seem to just ignore the suffix


Thanks for adding more information. I've opened up a ticket on our internal bug tracker and will post here once I have an update.

- Brent R.

brubell
 
Posts: 1116
Joined: Fri Jul 17, 2015 10:33 pm

Re: Handling of units after a value

by linaiah on Thu Nov 19, 2020 6:03 pm

Labels and titles come out above or below the value, and in a different font size. A prefix/suffix which maintains the style of the value would look much better

linaiah
 
Posts: 1
Joined: Thu Nov 19, 2020 5:57 pm

Please be positive and constructive with your questions and comments.