Change color based on the dynamic threshold in Metric or Guage visulization

Hi,

I want to visualize the number of requests with the color code to represent whether it's within the expected range as per the current time. Based on the time, max and min thresholds will be changed. Sample documents is like below,

At 10:05 AM
{
"API Name" : "API 1",
"Requests For Last Minute": "32",
"Max Threshold" : "39",
"Min Threshold" : "28",
"Within Threshold" : true
"DataPoint" : "2020-02-27 10:05:00"
}

At 09:10 AM
{
"API Name" : "API 1",
"Requests For Last Minute": "38",
"Max Threshold" : "37",
"Min Threshold" : "28",
"Within Threshold" : false
"DataPoint" : "2020-02-27 09:10:00"
}

So I want change the color of the visualization to green in first case, and red in the second case.

Any idea how to do this? It seems Kibana only allows to change the color based on the static thresholds on the same filed that we visualize. In this case I want to visualize the number based on the field "Requests For Last Minute", but decide the color based on the "Within Threshold"

Thanks

In Time Series Visual Builder (TSVB), you can control the color using "Color Rules".

However, it indeed does not allow to use another field for the threshold.

I suspect you would have to use Vega if you wish to change the color of the visualization based on values in the data.

Thank you for your reply @Liza_Katz. I'll try to use Vega for that. Would it be possible to share any related reference for this? (haven't used Vega visualization before)

Thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.