# XY chart series values color not changing according to theme selection

**URL:** <https://forum.inductiveautomation.com/t/xy-chart-series-values-color-not-changing-according-to-theme-selection/61382>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 30, 2022, 7:44am UTC](https://forum.inductiveautomation.com/t/xy-chart-series-values-color-not-changing-according-to-theme-selection/61382 "2022-06-30T07:44:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amruth\_Jois](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Amruth\_Jois](https://forum.inductiveautomation.com/u/Amruth_Jois)\
**Post date:** [June 30, 2022, 7:44am UTC](https://forum.inductiveautomation.com/t/xy-chart-series-values-color-not-changing-according-to-theme-selection/61382/1 "2022-06-30T07:44:37Z")

</div>

How can i change the color of X and Y series values according to light and dark themes.??  
i tried may time and many ways to set --neutral-90 but nothing has changed.  
 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/e/7eb43b225f2085afadac538a653e1f5668fea933.png)

---

<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 30, 2022, 8:11am UTC](https://forum.inductiveautomation.com/t/xy-chart-series-values-color-not-changing-according-to-theme-selection/61382/3 "2022-06-30T08:11:57Z")

</div>

The XY Chart component is an implementation of [AM Charts XY Chart](https://www.amcharts.com/docs/v4/reference/xychart/). Some of these external components are not theme aware.

I have worked around the problem as follows:

- Assume that any dark them will start with the letters “dark”.
- Create a Perspective session custom object. I called mine _sessChartColorSet_. Create enough values for the maximum number of pens you need.
- Create an expression binding on each of the values something like this:

```auto
if(left({this.props.theme}, 4) = 'dark',
	"#0000cc",
	"#000033"
)

```

- Bind each chart `props.series.0.line.appearance.stroke.color` to the appropriate session color. In this case it would be `session.custom.sessChartColorSet[0]`.

It’s a bit of trouble but worth the effort if you are allowing users to select the theme. The default colors are a bit too similar to allow easy visual differentiation.

* * *

Tip: there’s an edit button (pencil icon) below your post which allows you to edit your post rather than create a second post with a correction.
