boazreicher / mosaic-plot

Apache License 2.0
11 stars 2 forks source link

Cannot use string fields for rows #2

Closed Sejsel closed 2 years ago

Sejsel commented 2 years ago

I am trying to use the plugin to visualise some simple data, but it doesn't seem to be finding String fields for the row breakdown.

This seems to be caused by the plugin looking for some kind of labels instead of real fields. The labels seem to be some kind of obscure feature that is not even documented by grafana beyond this and there doesn't seem to be any way to set them using my data source.

The documentation of this plugin mentions that fields and makes no mention of labels here and in the screenshot. On the other hand, this page does mention labels but doesn't say what they are.

It would be very nice to have an option to use proper fields instead of some obscure labels.

image image

boazreicher commented 2 years ago

I think you can make it work by adding a adding a "Prepare time series" transform (use "multi-frame time series").

I've tested it with data that (I think) is in the same format as yours: before (The transform there is just to get the row field to be of type string. Yours already is a string)

Like in your example, this doesn't work: No breakdown field is found.

After adding the "Prepare time series" transform, the breakdown field is found: after

And the plot looks as expected for that data: example

While I believe this solve your use case (let me know if it doesn't), I completely agree that the documentation isn't clear around this topic, which is definitely very frustrating for users. I'll update the docs to make it clearer.

Also, I'll work on the plugin to make it able to work on data like this without the need for the "Prepare time series" transform.

boazreicher commented 2 years ago

Updated the docs to highlight this issue: here

boazreicher commented 2 years ago

Hi @Sejsel, I've added a new data format Single Frame (also Regular is renamed to Multi Frame): ex_singleframe

Using this data format should work well with your use case, without requiring any transforms (I've also made a change to support both string and number fields/labels as the Breakdown or Group fields)

This release has all of the changes.

Before I update the docs and publish the new version to Grafana Marketplace, would you mind testing it and confirming that is solves your issue?

Thanks,

boazreicher commented 2 years ago

Fixed in v1.0.13 Updated docs Updated in Grafana Marketplace.