Skip to content

Mapping using grafonnet #83

Closed Answered by Duologic
kelchen123 asked this question in Q&A
Jun 30, 2023 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

The value mappings object is a separate object, it can be added to the mappings array of a panel with standardOptions.withMappings.

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.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@kelchen123
Comment options

@mrpaulmanley
Comment options

@Duologic
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Duologic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants