Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure label for knots #83

Open
Laurie-Enveil opened this issue Sep 3, 2024 · 4 comments
Open

Configure label for knots #83

Laurie-Enveil opened this issue Sep 3, 2024 · 4 comments

Comments

@Laurie-Enveil
Copy link

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.

@chird
Copy link
Owner

chird commented Sep 9, 2024

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.

@Laurie-Enveil
Copy link
Author

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

@Laurie-Enveil
Copy link
Author

Laurie-Enveil commented Sep 11, 2024

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
Copy link
Author

I figured out what I was doing wrong with the windspeedProfileAxis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants