# Perspective Time Series Chart - Pen Colors

**URL:** <https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479>\
**Category:** Ignition Early Access\
**Created:** [August 15, 2019, 3:56pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479 "2019-08-15T15:56:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vcgasman](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vcgasman](https://forum.inductiveautomation.com/u/vcgasman)\
**Post date:** [August 15, 2019, 3:56pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/1 "2019-08-15T15:56:41Z")

</div>

I have configured three series along with three plots. Each series(two data points in each) is on its own plot, see screenshot. I am trying to get different pen colors for each plot but I can’t find where to configure this. It appears that the first color that I specify goes to the first data point name in the series, and the second color goes to the second data point name in the series and so on. Same applies for the colorScheme property.  
For example, I want red and blue on plot 0, orange and green on plot 1, grey and pink on plot 2.  
Thanks-

 ![Capture2](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/29d12b9a901592ce501f001643e465c82bec74b2.jpeg)

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [August 15, 2019, 4:32pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/2 "2019-08-15T16:32:19Z")

</div>

Hi @vcgasman, those `defaultStyles` apply to all charts. To create a unique style for each trend, there is a `columns` array where you can limit or configure the columns to display in the trend. You’ll need to enter the column `key` (which is the column name in the series to which the trend is bound), and then you’ll have the ability to apply style to that specific column. You can either give it a `color`, or you can provide styles for any of the four states (normal, highlighted, selected, and muted). Note that these styles are additive. Anything that you configured in `defaultStyles` will be taken into account, but these column-specific styles will override in the case of a style conflict.

---

<div class="post-metadata">

**Author:** ![vcgasman](https://avatars.discourse-cdn.com/v4/letter/v/ecc23a/32.png) [@vcgasman](https://forum.inductiveautomation.com/u/vcgasman)\
**Post date:** [August 15, 2019, 5:00pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/3 "2019-08-15T17:00:14Z")

</div>

Ok- Thank you. I had missed that. And thanks for the quick reply on all of my posts. It is appreciated.

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [August 15, 2019, 9:51pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/4 "2019-08-15T21:51:21Z")

</div>

No prob!

---

<div class="post-metadata">

**Author:** ![chuache\_sanse](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@chuache\_sanse](https://forum.inductiveautomation.com/u/chuache_sanse)\
**Post date:** [December 19, 2019, 12:45pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/5 "2019-12-19T12:45:42Z")

</div>

Hi Jball,

I have a similar question with perspective. I have a chart with 2 datasources.

DataSource 1 it is a yellow line in the graphic.  
DataSource 2 there are some green bars in the graphic.

I want to change the color of DataSource 2 depending of DataSource 1. Meaning, If my green bar is smaller than the yellow line, I want to display red color in the bar, otherwise, I will keep the green color. Is this possible?

I have like 8 different bars in my graphic but I just want to change the colors of the one´s smaller than my yellow line.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/0/0e156154edca039041da3b5443ae90bb14a8e40f.png)

Thanks,  
Juan.

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [December 19, 2019, 7:24pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/6 "2019-12-19T19:24:44Z")

</div>

Hi @chuache_sanse, yes that would be possible by using a [property change script](https://docs.inductiveautomation.com/display/DOC80/Perspective+Property+Change+Scripts) to interrogate the dataset that you have bound to the chart. You could have custom view properties that can hold a color value that you can change based on data conditions in your property change script. Those properties can then be bound to the fill/stroke colors of the chart.

---

<div class="post-metadata">

**Author:** ![chuache\_sanse](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@chuache\_sanse](https://forum.inductiveautomation.com/u/chuache_sanse)\
**Post date:** [December 20, 2019, 8:45am UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/7 "2019-12-20T08:45:10Z")

</div>

Hi jball,

If I bound my dataset to the fill property, t doesn´t take the colours, it just not recognise the data and gives me the default blue colour.

Also, if I give the fill property a specific colour, it changes the colour of all the bars in my graphic. Is it possible to decide individually even thought all the bars have the same fill property?

---

<div class="post-metadata">

**Author:** ![jball](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jball/32/11128_2.png) [@jball](https://forum.inductiveautomation.com/u/jball)\
**Post date:** [December 20, 2019, 6:05pm UTC](https://forum.inductiveautomation.com/t/perspective-time-series-chart-pen-colors/27479/8 "2019-12-20T18:05:44Z")

</div>

> Also, if I give the fill property a specific colour, it changes the colour of all the bars in my graphic. Is it possible to decide individually even thought all the bars have the same fill property?

Yes, you can create a `trend` that is bound to the `series` that you want to display. Each trend has the ability to specify the `columns` that you want to show under its properties. This configuration is exclusive, so once you've properly configured a column, only this configuration will be used to chart your data. Use the `key` property of the column to point to the column in your series data that you want to show. From there, you can either specify a `color` property for the column, or you can use the `styles` property for tighter control of the style for all of the different states.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/cfc8288385f31ccf88a29a2004f767dd807728dc.png)

> If I bound my dataset to the fill property, t doesn´t take the colours, it just not recognise the data and gives me the default blue colour.

To use dataset values as a way to change the color of columns in your trends, you'll need to do the following:

1. Setup a view property to which you will set a color value based on conditions being met in your dataset. You'll want to default this value to an initial color.
2. Bind the `color` property of the `column` that will change to this view property.
3. Create a [property change script](https://docs.inductiveautomation.com/display/DOC80/Perspective+Property+Change+Scripts) on your series data where you handle the comparison of data values to determine if you should change the color of your trend. When you determine that a color change should be made, write the color value to that view property.
