Dashboard displaying XY chart data failing

Howdy all

I’m having some trouble getting a Dashboard to display my data.
I’m trying to create an XY Chart to plot a bunch of lines.

The data will be one line per Id , the x-axis will be the log timestamp, and the y-axis a numeric value from the log.
So far I have a query which will fetch the data using {container="someContainer"} | json | keep timestamp, id, value.

The XY Chart currently just shows Err.
I’ve been trying to apply data transforms - currently using Extract fields followed by Group by (which is configured as Id: Group by, timestamp: Calculate (All Values) and value: Calculate (All Values)) - with no luck.
The visualization axis settings don’t pick up any of the 3 labels so I can’t manually select them.

Any help/advice would be greatly appreciated!

So, just checking - XY supporting time as an x axis is extremely new, are self hosted and pulling main ? https://github.com/grafana/grafana/pull/106459

Sorry for not specifying: this is Grafana Cloud, not self-hosted

What would really help is the chart’s specifying, somewhere, the exact format they expect data.
There are really nice debugging tools which allow us to see the format of the data produced by queries but it’s still a guessing game as to what format charts expect (sorry if this information already exists somewhere, I’ve been struggling to find it)

I’m guessing you mean in the UX somewhere, and that is very fair, but we do try keep our documentation up to date with information like this. Like with the current version, https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/xy-chart/#supported-data-formats

I understand, and you make a fair point.
However, sorry I kind of diverted the conversation away from my primary question: how can I select those fields in the XY Chart axis selection? I’m assuming I’m missing a data transform of some kind? Or perhaps it’s something else?

Can you click the upper right question mark and let me know what it says under help? For Grafana Cloud, I’d expect something like “Grafana Cloud (fast)” or “Grafana Cloud (steady)”

(basically I just want to know if you would have the code change in that PR or not)

I’m assuming I need fast to get the change you’re referring to?

let me check when steady would get it… might not be long

Yay, steady has it I’m pretty sure. Let me check with a fake log line and send you a link to a demo - thank you for your patience

That would be great, thank you!

Okay so TIL extract fields doesnt have logfmt :sweat_smile: - I’ll get that fixed but the key/value one works fine for now

https://play.grafana.org/d/feavrpzb4wu0wa/kristina-demos?orgId=1&from=now-30d&to=now&timezone=utc&var-fruit=apple&var-fuelType=Battery%20storage&var-stand=ice-king&var-employeeLastName=Swan&tab=transformations&editPanel=27|https://play.grafana.org/d/feavrpzb4wu0wa/kristina-demos?orgId=1&from=now-30d&to=now&[…]g&var-employeeLastName=Swan&tab=transformations&editPanel=27

What you’re gonna want to do is flip on the table view for your data after you extract fields to parse out what you need. Anything with a cursive “A” At the front is a string and will need to be converted to a number or time field to work for XY. In my case, the time field is already parsed because Grafana just does it, but if I want my status field to be part of the chart, I need to make it a number.

If you cant get this working, if you can send me an example of a log line (redact anything sensitive) I can try to build a regex to help you get stuff out of it

Table view is the toggle next to the time picker above the visualization, if youve never played with that before

That doesn’t give me exactly what I’m after but it does give me data in the XY Chart so it should work as a starting point.
Thank you!

Okay sounds good - but yeah basically TLDR any data in that table view will need the little square symbol before the field name to work for XY, except for the time field which has a lil clock

if theres something thats missing let me know too, but we’re probably in feature request territory at that point :sweat_smile:

One last question: does XY Chart support groups of data?
I’ve got a load of log lines which are grouped by an Id field (using the Group By transformation), meaning the value is an array of numbers and I want to display one line, on the chart, per group.
Is this supported? Or is it a feature request?

hmm interesting, let me try to replicate this and see what I can find

X would basically be the index of the number in the array I’m guessing?