Mapping using grafonnet #83
-
Hi, I'm currently trying to create mappings for one of my panels using grafonnet, but can't quite figure out how to get started. How could I make a simple value mapping modeled after this grafana json? "mappings": [ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The value mappings are documented here: https://grafana.github.io/grafonnet/API/panel/timeSeries/valueMapping.html |
Beta Was this translation helpful? Give feedback.
-
The value mappings object is a separate object, it can be added to the mappings array of a panel with local valueMapping = star.valueMapping;
stat.standardOptions.withMappings([
valueMapping.RangeMap.options.withFrom(0)
+ valueMapping.RangeMap.options.withTo(0)
+ valueMapping.RangeMap.options.result.withText('Down')
+ valueMapping.RangeMap.options.result.withColor('Red'),
valueMapping.RangeMap.options.withFrom(1)
+ valueMapping.RangeMap.options.withTo(1)
+ valueMapping.RangeMap.options.result.withText('Up')
+ valueMapping.RangeMap.options.result.withColor('Green'),
]) Documentation for this needs improvement. |
Beta Was this translation helpful? Give feedback.
The value mappings object is a separate object, it can be added to the mappings array of a panel with
standardOptions.withMappings
.Documentation for this needs improvement.