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

Profile tool : wrong display for large z number #748

Closed
sebbelese opened this issue Mar 4, 2022 · 2 comments
Closed

Profile tool : wrong display for large z number #748

sebbelese opened this issue Mar 4, 2022 · 2 comments

Comments

@sebbelese
Copy link
Contributor

sebbelese commented Mar 4, 2022

Hi,

I am using the profile control tool to display different types of data along lines.

However, for large values, the display is wrong with hidden digits, some of which are also placed under the vertical label.

I think that this behaviour could be easily improved by switching to floating point notation when the numbers are too large, i.e. modifying line 705:

             if (this.get('zunit') != 'km') ctx.fillText(i.toFixed(fix), -4*ratio, i*scy+dy);

Maybe linked with #738

image

@Viglino
Copy link
Owner

Viglino commented Mar 4, 2022

Profile control is mainly designed to display altitude (at least 4 digits) and there is no origine offset.
Using zunit = 'km' lets you divide values Z value by 1000 (kilo units) for more visibility (floating point), use zDigits to set the number of digit you want (default is 0).
Graduations are rounded for display, you have to set the graduation option to fit a round coordinate on the Z axis.

I think you can try setting:
zunit: 'km',
graduation: 1000,
zDigits: 1

@sebbelese
Copy link
Contributor Author

sebbelese commented Mar 7, 2022

Thanks for your reply.

I understand that the tool mainly targets altitude but it is very general, certainly enough to be used for any kind of profile, except maybe due to the formatting of these labels.

If you are interested to improve this, I proposed some changes in a post request that I just created (#749).

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

No branches or pull requests

2 participants