andymchugh / andrewbmchugh-flow-panel

Apache License 2.0
34 stars 2 forks source link

value mapping fuction #30

Closed Victordr3 closed 5 months ago

Victordr3 commented 5 months ago

Hello, I am using this panel to visualize my FCU (Fan Coil Unit) data. It is a powerful plugin.

I have the following data and I want to display the number as strings in SVG

0=low 1=middle 2=high 3=auto

image

Is it possible to include value mapping function similar to other Grafana panels in this panel?Thanks Screenshot 2024-04-30 144425

andymchugh commented 5 months ago

thanks for trying the plugin. it does feel like something it should support. Will think it through...

andymchugh commented 5 months ago

This has been added in 1.11.0. Will ping when the release is published. Your data would need config as shown below under the cell.label space. There's an example in provisioning using yaml aliases in https://github.com/andymchugh/andrewbmchugh-flow-panel/blob/main/provisioning/dashboardData/dataMappings.yaml.

label:
  valueMappings:
    - {value: 0, text: "Low"}
    - {value: 1, text: "middle"}
    - {value: 2, text: "High"}
    - {value: 3, text: "auto"}
andymchugh commented 5 months ago

This has been published now if you want to give it a try. Reopen if you still have a problem