gpt-4.1-2025-04-14· OpenAI
LMArena Human Preference 140K
Grafana. How can I configure a graph so that on the left the y axis has one measure…
- 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) ?
- 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)
-
Add two queries:
- A:
count_over_time(...) - B:
avg_over_time(...)(e.g., duration)
- A:
-
Overrides:
- Click "Overrides" → "Add field override".
- Select the field (e.g.,
B). - Add override: "Y-Axis" → "Right".
- Add override: "Unit" → e.g.,
msfor milliseconds.
-
Axes:
- In the "Panel options" → "Axes", you can label each axis.
Summary Table
Query Y-Axis Unit A Left count B Right ms/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!
- In your panel (e.g., Time series or old Graph panel), add both queries:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.