# Change single label color in xy Chart

**URL:** <https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 15, 2024, 7:50am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902 "2024-06-15T07:50:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 15, 2024, 7:50am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/1 "2024-06-15T07:50:20Z")

</div>

Good morning,  
I would like to set the labels forecolor of the Y chart differently in an xy chart in Perspective.  
In particular I need to change the color from white to red if I have a bool condition.

Should be possible?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 15, 2024, 8:52am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/2 "2024-06-15T08:52:54Z")

</div>

Create an expression binding on,  
`yAxes.0.appearance.labels.color`

The expression binding would look something like,  
`if({[default]myBool}, "red", "white")`

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 15, 2024, 8:54am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/3 "2024-06-15T08:54:13Z")

</div>

Hi @Transistor, actually I would like to change the single label, I have something like this in the Yaxis

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/0/70e0f372f45c6962c6499716a7d0fde69c988941.png)

For example I need to turn red only the 04 or 06

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 15, 2024, 9:03am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/4 "2024-06-15T09:03:35Z")

</div>

If you check with your browser's Developer Tools I think you will see that there is no unique identifier on each of the labels. That implies that it wouldn't be possible to target one of them for a color change.

Since it's an XY Chart you might be able to add another datasource and draw a triangle closed shape to point at the relevant label from inside the chart area.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 15, 2024, 9:07am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/5 "2024-06-15T09:07:49Z")

</div>

Yes you're right, I check with the Developer Tools and I see nothing, but maybe I was missing something.

> [@Transistor](#):
>
> Since it's an XY Chart you might be able to add another datasource and draw a triangle closed shape to point at the relevant label from inside the chart area.

This is an interesting thing, but you mean I could add something like an icon connected to the label or add a new series with the same Yaxis?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [June 15, 2024, 9:14am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/6 "2024-06-15T09:14:40Z")

</div>

> [@Aiasa21](#):
>
> ... or add a new series with the same Yaxis?

This one. It should be easy if the X-axis render mode is set to value. For category or date rendering it wouldn't work. (Maybe it would for date if it accepts time values as well.)

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 15, 2024, 9:18am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/7 "2024-06-15T09:18:12Z")

</div>

In my case I have catergory in the Yaxis and date in the Xaxis, so it looks quite hard to do. That's a pity.

Thank you for your help 👍🏻

---

<div class="post-metadata">

**Author:** ![Ujwal\_Wankhede](https://avatars.discourse-cdn.com/v4/letter/u/4af34b/32.png) [@Ujwal\_Wankhede](https://forum.inductiveautomation.com/u/Ujwal_Wankhede)\
**Post date:** [June 15, 2024, 9:43am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/8 "2024-06-15T09:43:51Z")

</div>

Found an easy solution. Category axis label support in-line TextFormatter.

> [@Aiasa21](#):
>
> I have catergory in the Yaxis and date in the Xaxis, so it looks quite hard to do

Example with sample XY chart data.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/d/5d7b873c6fdb7ee62dd5edcaea1dd9d0f358fc4b.png)

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [June 15, 2024, 9:58am UTC](https://forum.inductiveautomation.com/t/change-single-label-color-in-xy-chart/91902/9 "2024-06-15T09:58:31Z")

</div>

@Ujwal_Wankhede, this is so simple! I've already implemented it

Thank you too for the help
