Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

Grafana. How can I configure a graph so that on the left the y axis has one measure…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with Claudeclaude-3-7-sonnet-20250219’s answer.
  1. User

    Grafana. How can I configure a graph so that on the left the y axis has one measure (like count) and on the right the y axis has another measure (like time) ?

  2. Assistant

    You can absolutely configure a dual Y-axis in Grafana, so that the left Y-axis shows one metric (e.g., count) and the right Y-axis shows another (e.g., time, duration, or a different unit). Here’s how you can do it in Grafana 7.x and later (including Grafana 8, 9, 10):


    Step-by-step: Dual Y-Axis in Grafana

    1. Add Both Queries

    • In your panel (e.g., Time series or old Graph panel), add both queries:
      • Query A: for your first metric (e.g., count)
      • Query B: for your second metric (e.g., time/duration)

    2. Open Panel Editor

    • Click on the panel title → Edit.

    3. Go to the "Field" or "Overrides" Tab

    • In the right panel, find the "Overrides" tab (for Grafana 7+), or "Axes" tab (for older Graph panel).

    4. Assign Series to Right Y-Axis

    • Click "Add field override".
    • In the override, select the series (e.g., by name or regex) that you want on the right Y-axis.
    • Add an override property: "Y-Axis" → set to "Right".

    5. Set Units for Each Axis

    • In the override, you can also set the unit (e.g., count, ms, s, etc.) for each series.
    • For the left axis, set the unit for the first metric.
    • For the right axis, set the unit for the second metric.

    6. (Optional) Adjust Axis Ranges

    • In the "Axes" section, you can set min/max for each axis if needed.

    Example (Grafana 9+ Time Series Panel)

    1. Add two queries:

      • A: count_over_time(...)
      • B: avg_over_time(...) (e.g., duration)
    2. Overrides:

      • Click "Overrides" → "Add field override".
      • Select the field (e.g., B).
      • Add override: "Y-Axis" → "Right".
      • Add override: "Unit" → e.g., ms for milliseconds.
    3. Axes:

      • In the "Panel options" → "Axes", you can label each axis.

    Summary Table

    QueryY-AxisUnit
    ALeftcount
    BRightms/sec

    Screenshot Example

    [image: Grafana dual y-axis example] open


    References


    If you tell me your Grafana version and panel type, I can give you exact click-by-click instructions!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.