Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Extend spec of graph panel to expose fieldConfig #14

Closed
wants to merge 1 commit into from
Closed

Extend spec of graph panel to expose fieldConfig #14

wants to merge 1 commit into from

Conversation

pdreker
Copy link

@pdreker pdreker commented May 2, 2021

I had quite some trouble making a graph panel use a unit using grafonnet-7.0, as the documentation does not hint at how to do that and trying to do it using ".addYaxis" always resulted in empty graphs. In the stats panel this can be achieved using setFieldConfig, but the graph panel does not have this method.

So here is a PR, which extends the graph panel spec, by adding min, max and unit to the fieldConfig defaults, which in turn makes the generated Jsonnet code for the graph panel have a setFieldConfig method, which allows globally setting the unit for the graph.

I tested this against my 7.4.2 grafana, and it works and it does, what I need...

I have no idea, if this is even remotely the right thing to do, but I'll take pointers to how to do it, if it is wrong. ;-)

* add min/max/unit fieldConfigs
@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

@pdreker
Copy link
Author

pdreker commented Jun 16, 2022

I got the message to sign the CLA (which I'd do happily) but the resulting page just shows an empty version field and has no button for me to use or anything else to interact.

@pdreker
Copy link
Author

pdreker commented Jun 16, 2022

... and of course after 27 (just kidding) attempts it worked...

@pdreker pdreker closed this by deleting the head repository Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants