Skip to content

How can I add Value Mappings to a stats panel? #220

Answered by hlolli
timeout asked this question in Q&A
Discussion options

You must be logged in to vote

The error messages aren't very good, but I discovered with trial and error, that it's possible to make it work like this

+ g.panel.stat.standardOptions.withMappings([{
    type: 'value',
    options: {
      '0': {
        color: 'red',
        index: 1,
        text: 'server.com is DOWN',
      },
      '1': {
        color: 'green',
        index: 0,
        text: 'server.com is UP',
      },
    },
  }])

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@timeout
Comment options

Answer selected by timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants