grafana / grafonnet-lib

Jsonnet library for generating Grafana dashboard files.
https://grafana.github.io/grafonnet-lib/
Apache License 2.0
1.08k stars 217 forks source link

Decimals and displayMode #307

Open FinnHuelsbusch opened 3 years ago

FinnHuelsbusch commented 3 years ago

Hello, it is my first time asking in this project, I hope I do it correctly... I want to set the number of shown decimals and the default displayMode for the 'new' tables in Grafana. These fields would fit nicely into the setFieldConfig:

.setFieldConfig(
      displayMode = "color-text", 
      unit = "percent", 
      decimals = 5
    )

the json would look like this:

"defaults": {
    "custom": {
        "displayMode": "color-text"
    },
    "decimals": 5,
    ...
}

I'm not sure if this is useful and if it is, where it would be added, in this repository or in dashboard-spec-repository.

Thank' in advance Finn