grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
64.24k stars 12.02k forks source link

Allow precise horizontal alignment of graphs #88034

Open ppetr opened 4 months ago

ppetr commented 4 months ago

Why is this needed: When there are multiple graphs with different labels, each of their x axes is aligned slightly differently:

sample graph

This makes it more difficult to analyze times and connections of events occurring in multiple graphs.

What would you like to be added:

  1. Add an option that would cause all graphs to be perfectly horizontally aligned. That is, that two points on the screen corresponding to the same timestamp would have the very same horizontal position on the screen (the same screen x coordinate).
  2. (Can be implemented independently of 1.) When hovering over a graph, show the vertical hover marker (cross) not just in the single graph, but in all graphs at the same timestamp. marker

Who is this feature for?

For data analysts that investigate causality relationships between events.

leeoniya commented 4 months ago

Add an option that would cause all graphs to be perfectly horizontally aligned

this is a hard problem when you can have multiple y axes, different formatting/units, different y ranges, and completely arbitrary panel widths + arrangements.

https://github.com/grafana/grafana/issues/4469

When hovering over a graph, show the vertical hover marker (cross) not just in the single graph, but in all graphs at the same timestamp.

this exists in dashboard settings called Shared crosshair or Shared tooltip.

ppetr commented 4 months ago

this exists in dashboard settings called Shared crosshair or Shared tooltip.

Perfect, I didn't know, thank you!

cschlipf commented 4 months ago

Just specify a fixed width for the y Axis for both charts and the x-Axis will align. You will however have to place all y-Axes on the left.

image

Result:

image
wburglett commented 3 months ago

Specifying Width works for Time Series fields, but I am struggling to align them with Discrete/State Timeline fields (see the OP's request) because they appear to lack the Width option. Is there an existing solution for this? Thanks!

image

My instinct is that moving the field name below the chart (like in Discrete fields) would help, but you may still have to specify a spacing in order to guarantee consistency on all displays (and using Width does not work if you have multiple State Timeline fields with different length names). Discrete fields do not work as their x-axis starts too far to the left

Strunck commented 2 months ago

What about abandoning the idea, that every panels needs its own time-axis? Multipe Axes Using just one time-axis for panels, that belong together.

tdamsma commented 1 month ago

What about abandoning the idea, that every panels needs its own time-axis? Multipe Axes Using just one time-axis for panels, that belong together.

This would greatly improve the usefulness of grafana to me. I am always looking at multiple machine parameters and try to figure out how they relate; what caused what etc. Next to a shared time axis, it would be great if one can hover in the time direction, and then see all the values of all plots as tooltips.