Dynamic Bar Colors in Bar Chart Panel Based on Comparison Between Two Fields

I am using Grafana’s Bar Chart panel to compare two numerical fields side-by-side for multiple equipment types. For each equipment, we show:

  • Field A → e.g., CPO Mode iKW/TR (green bar)
  • Field B → e.g., Non-CPO iKW/TR (grey bar)

The bars are drawn correctly and values are accurate.


What I want to achieve

For each equipment row, I want conditional bar colors based on comparison between the two fields:

  • If Field A > Field B, then Field A’s bar color should change (e.g., green → yellow).
  • If Field A ≤ Field B, the default color should remain.

This needs to work row-by-row, since different equipment will have different relationships.


Example

For equipment CWP:

  • Field A (green) = 0.06
  • Field B (grey) = 0.04

Since 0.06 > 0.04, I want the green bar to change to yellow only for this row.

But currently Grafana does not allow dynamic color overrides based on values of another field inside the Bar Chart panel.

Here is an illustration of the problem:

What I already tried

  • Field overrides
  • Series overrides
  • Value mappings
  • Thresholds
  • Transformations (merge, join, and others)

However:

  • Overrides apply to all rows, not row-level comparisons
  • Thresholds apply within a field, not across fields
  • There is no built-in option to compare two fields in the Bar Chart visualization

I was unable to get stock bar chart to do that. another option would be to use Business Chart