meteoJS icon indicating copy to clipboard operation
meteoJS copied to clipboard

Configure label for knots

Open Laurie-Enveil opened this issue 1 year ago • 4 comments

The aviation standard for knots is kt while the ISO standard is kn. It would be great if we could pass in kt as a label option for windspeed.

Laurie-Enveil avatar Sep 03 '24 13:09 Laurie-Enveil

It is possible to use kt as a label text. Unfortunately, the option is called prefix but it is actually a suffix.

E.g. see the answers in #60 or #54.

By the way, the unit of the hover text can also be customized. See also #60.

chird avatar Sep 09 '24 19:09 chird

Thank you. I will take a look sometime this week and I will let you know if I run into issues.

Laurie-Enveil avatar Sep 09 '24 20:09 Laurie-Enveil

The windspeed profile labels is working well. I tried something similar for the windspeedProfileAxis and hodograph without luck. It looks like windspeedProfileAxis doesn't support label changes at all, but the hodograph seems like it should. I'm thinking this is user error in how I set it up?

let td = new ThermodynamicDiagram({
      renderTo: diagramRef.value.$el,
      height: diagramHeight,
      width: diagramWidth,
      hodograph: {
        visible: isHodographEnabled,
        hoverLabels: {
          windspeed: {
            windspeed: {
              unit: 'kn',
              decimalPlaces: 1,
              prefix: ' kt'
            }
          }
        }
      },
      windspeedProfile: {
        hoverLabels: {
          windspeed: {
            windspeed: {
              unit: 'kn',
              decimalPlaces: 1,
              prefix: ' kt'
            }
          }
        }
      },

Screenshot 2024-09-11 at 2 24 46 PM

Laurie-Enveil avatar Sep 11 '24 18:09 Laurie-Enveil

I figured out what I was doing wrong with the windspeedProfileAxis

Laurie-Enveil avatar Sep 12 '24 12:09 Laurie-Enveil