# \[BUG\] Linear Scale Range Indicator Negative Extent

**URL:** <https://forum.inductiveautomation.com/t/bug-linear-scale-range-indicator-negative-extent/68337>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [January 6, 2023, 10:52pm UTC](https://forum.inductiveautomation.com/t/bug-linear-scale-range-indicator-negative-extent/68337 "2023-01-06T22:52:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 6, 2023, 10:52pm UTC](https://forum.inductiveautomation.com/t/bug-linear-scale-range-indicator-negative-extent/68337/1 "2023-01-06T22:52:43Z")

</div>

I expected a negative extent to fill from the value, down. It does, but for each -1 it also shifts the displayed value down one.

For example, on a scale from 0 - 100 with a value of 20 and an extent of 20 you get exactly what you'd expect:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/4/6484d3d8b46e3a18617b2b4793a2bddc75e4527a.png)

However, a scale of -20 seems like it doesn't work, but upon further inspection the range is actually just out-of-view below the scale. This can be seen by setting the extend to -10.

-20:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef19a1c3b7d1acae95df254ee55fafbb1c659553.png)

-10:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54c9283efd08d8b17badf1b9cfc437ccff980251.png)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 7, 2023, 5:48pm UTC](https://forum.inductiveautomation.com/t/bug-linear-scale-range-indicator-negative-extent/68337/2 "2023-01-07T17:48:30Z")

</div>

It sure looks like something is wrong here when using a negative value for `extent`, but why wouldn't you just set the `value` to `0` and the `extent` to `20`? It looks like the component was written to always expect `extent` to be a positive value. I don't know if there was a reason for this, and I don't see anything documenting that it _must_ be a positive value. If I open a bug ticket for this, there's a decent chance we would just update the documentation to clarify that a positive value is expected.

Supposing you knew you wanted the extent to be some low value `n` to some other greater value `z` for an indicator `x`, I would expect that I would apply the values like this:

```auto
indicators[x].value = n
indicators[x].extent = z - n

```

This removes any negative value from being in use while maintaining the expected extent.

If you can make a reasonable argument for why that approach won't work, I'll open a bug ticket for evaluation to see if this is something we need to fix.

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [January 9, 2023, 2:32pm UTC](https://forum.inductiveautomation.com/t/bug-linear-scale-range-indicator-negative-extent/68337/3 "2023-01-09T14:32:20Z")

</div>

> [@cmallonee](#):
>
> why wouldn't you just set the `value` to `0` and the `extent` to `20`?

This is exactly what I ended up doing after making the post.

> [@cmallonee](#):
>
> If I open a bug ticket for this, there's a decent chance we would just update the documentation to clarify that a positive value is expected.

Update to the documentation would suffice, considering the workaround makes alot of logical sense.
