Changing XYChart Line Stroke Color based on target line. - Perspective

Expressions aren't scripts. Think of them as like Excel functions. They return a value which you can bind to a property. Try this:

if({tag A} < {tag B},
    '#ff0000',
    '#001aff'
)

Or better again, use the built-in Perspective theme colors:

if({tag A} < {tag B},
    '--error',
    '--success'
)

or whatever you prefer. These CSS theme colors will adjust to suit when you change themes and are a much easier way of maintaining consisten look and feel across your site.


Please, please, post formatted code (using the </> button) rather than pictures of code, resize the windows and crop the images. 90% of the top one is irrelevant.

1 Like