0

Using Indicator to change the color of a line on a graph

I'm hoping someone can help me do something I thought would be pretty simple.  I have a bar/line graph that contains a trend line and I want to have that trend line be red if it is going down or green if it is going up.  I've tested several things and the closest I can get is the attached screenshot which shows the dots as being the correct color but not the lines  (I've tried changing the properties of the line to not even show the dots and still get this result). 

I am storing the first/last values from my trend line into a data element so I can reference them in the indicators and verified they values are being interpreted correctly by throwing in labels with their values and one with a simple if statement comparing the values which is producing the expected results.

Any help would be greatly appreciated.

2 comments

  • Avatar
    Parker Selman Official comment

    Hi Jesse,

    Thanks for the post! 

    Indicators aren't able to override a series' line colour, but you should be able to get this working with two separate trend lines - one for a positive trend and another for a negative trend. These series can have green and red lines and dots respectively, without the need for indicators. However, in the formula for each trendline, you will need to run an IF condition such that if (for the negative trend) LastTrendValue is less than FirstTrendValue, display the trendline as you've already formatted it, and if not, display a blank (using the BLANK() function). The same logic would go for the positive trendline, with the condition reversed. Then, you'll need to ensure that 'Leave gaps for blank values' is selected in the series properties for each series, so only one trendline is displayed at a time. 


    I hope this helps! Please reach out to support@klipfolio.com if you have further questions around this,

    Parker

  • 0
    Avatar
    Jesse Sticka

    Thank you! I was able to make it work as you described, I hadn't thought about that approach and appreciate your assistance.

Please sign in to leave a comment.