Black Lives Matter. Please consider donating to Black Girls Code today.

Conditional formatting of plots

Hello, I am trying to plot monitoring data, and I would like to have a style (for ex. blue color) for the “normal values” and another one (let’s say red) when the value goes below a tolerated minimum or above a tolerated maximum.
Is it currently possible in plotly?
I couldn’t find any help online.
Many thanks!!

1 Like

Hi! I don’t believe there’s currently support for this. You can always compute the colors outside of plotly.js and pass in an array of colors for your points. If you’re using plotly.js directly anyway, I’d think that might be possible.

(An advanced approach that currently requires working through some of the plotly.js source would be to register your own transform that examines the data and applies the desired colors, but that may or may not be interesting to you.)