# Time Series Chart - Apply Different Color Scheme to New Trend

**URL:** <https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 16, 2022, 8:02pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857 "2022-06-16T20:02:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![braydon.hancock](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@braydon.hancock](https://forum.inductiveautomation.com/u/braydon.hancock)\
**Post date:** [June 16, 2022, 8:02pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/1 "2022-06-16T20:02:44Z")

</div>

Just like the title says, is it possible to apply a different color scheme to each trend? I have 2 series and the first trend in each is green, they are different scales so they need to be on separate axes.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/b/dbada8ac4ac017d886262799ebf67888fc3f16b7.png)

---

<div class="post-metadata">

**Author:** ![obober](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/obober/32/67865_2.png) [@obober](https://forum.inductiveautomation.com/u/obober)\
**Post date:** [June 21, 2022, 8:45pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/2 "2022-06-21T20:45:50Z")

</div>

Hi Brandon,

[This](https://forum.inductiveautomation.com/t/time-series-chart-change-chart-color/46978) post might help you!

I managed to make a red and blue by adding values to underneath the `colors` property:

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

---

<div class="post-metadata">

**Author:** ![braydon.hancock](https://avatars.discourse-cdn.com/v4/letter/b/c67d28/32.png) [@braydon.hancock](https://forum.inductiveautomation.com/u/braydon.hancock)\
**Post date:** [June 21, 2022, 10:02pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/3 "2022-06-21T22:02:04Z")

</div>

Thanks for the response. This works (as well as changing the colorScheme) for multiple trends in a single series.

However, it doesn’t apply the second color to the first trend in a second series. What I need to do is apply a different colorScheme to the second series instance.

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

---

<div class="post-metadata">

**Author:** ![flavien](https://avatars.discourse-cdn.com/v4/letter/f/f475e1/32.png) [@flavien](https://forum.inductiveautomation.com/u/flavien)\
**Post date:** [July 28, 2022, 9:11am UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/4 "2022-07-28T09:11:28Z")

</div>

Hi,  
Same problem for me. Add manually colors in defaultStyles \>colors doesn’t work.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/74f025d9b9ddcf9756f2bf9101ae184110174283.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/c/fcd24f9a09c9dbe12dfb3d84ce1df2022c4c88ca.png)  
Can you help me ?  
Thanks

---

<div class="post-metadata">

**Author:** ![Micah\_Carr](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Micah\_Carr](https://forum.inductiveautomation.com/u/Micah_Carr)\
**Post date:** [March 2, 2023, 6:29pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/5 "2023-03-02T18:29:50Z")

</div>

I am also looking to have separate colors for different trends.

---

<div class="post-metadata">

**Author:** ![Micah\_Carr](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@Micah\_Carr](https://forum.inductiveautomation.com/u/Micah_Carr)\
**Post date:** [March 2, 2023, 8:49pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/6 "2023-03-02T20:49:51Z")

</div>

I believe I have found a solution.

By inserting blank columns, you can "skip" colors in the trend.

However, the only problem with this, is that the "blank" columns are added to the legend. I have not found a way to hide individual items from the legend. However you could hide the legend, and make your own legend to get around this..

On the binding to the series data add the following script to a script transform. Then in the script, indicate which color you want by changing the value of "requested\_color" (0 based).

```auto
	
	requested_color = 1
	
	if requested_color > 0:	
		table_headers = list(value.getColumnNames())
		
		headers = []
		for table_header in table_headers:
			headers.append(table_header)
		
		for i in range(requested_color):
			headers.insert(1,"blank"+str(i))
		
		
		data=[]
		for i in range(value.getRowCount()):
			thisrow = []
			for header in table_headers:
				thisrow.append(value.getValueAt(i, header))
				
			for i in range(requested_color):
				thisrow.insert(1,None)
			
			data.append(thisrow)
	
		return system.dataset.toDataSet(headers, data)
	
	else:	
		return value

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/0/8014ccd9ba4e50a58a69fa32ffbdb647f2711129.png)

---

<div class="post-metadata">

**Author:** ![Josh\_Davidson](https://avatars.discourse-cdn.com/v4/letter/j/a6a055/32.png) [@Josh\_Davidson](https://forum.inductiveautomation.com/u/Josh_Davidson)\
**Post date:** [April 25, 2024, 8:28pm UTC](https://forum.inductiveautomation.com/t/time-series-chart-apply-different-color-scheme-to-new-trend/60857/7 "2024-04-25T20:28:24Z")

</div>

Unfortunately, I don't believe you are able to assign a `colorScheme` style attribute to series that share a plot (perhaps this should be added in the future). My workaround was to utilize the `trends` array property configured on a `plot` to assign a series to an `axes`. I was then able to reference the `key` of the column for the series and override the default color assigned to the pen. This `key` is the column name of the serie's returned dataset. This way you have to explicitly define each pens' color but is a bit cleaner than the above post's approach.

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