We have time series data with an overlay of the linear regression to indicate the trend
Now we would like to color it red if the trend is declining as shown here
See the example
We have tried various ways with parameters but did not manage to have the color dependent on the trend. Our approach was focused on getting the slope and check if it was positive or negative.
2
Answers
For those looking for a version with the gradient switching colors as well (and dynamic tooltip).
Here's what we ended up with
Here you go. I’ll let you fix the gradient.