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

Suggestion to specify the logarithm base for ValueAxis #1368

Open
oliverpeng opened this issue Mar 3, 2024 · 9 comments
Open

Suggestion to specify the logarithm base for ValueAxis #1368

oliverpeng opened this issue Mar 3, 2024 · 9 comments
Labels
enhancement Feature request

Comments

@oliverpeng
Copy link

Question

For ValueAxis, when the logarithm option is enabled, the labels and tick lines are in base 10 (1, 10, 100, 1000, etc.) It would be great to be able to specify another base, in my particular use case, base 2 (1, 2, 4, 8, 16, 32, 64, etc.)

In photographic applications, base 2 is widely used as a doubling or halving of illumination represents +1 or -1 stop of light.

chart.yAxes.push( am5xy.ValueAxis.new(root, { logarithmic: true, }) ));

@zeroin zeroin added the enhancement Feature request label Mar 4, 2024
@zeroin
Copy link
Collaborator

zeroin commented Mar 4, 2024

I am afraid we do not have plans implementing this in a near future, sorry.

@workingbuddy10
Copy link

This feature will be good to have as many product candles are viewed in the base value, also mentioned the similar issue in #1046

@p3777dev
Copy link

Wanted to know can we achieve this by tweaking some part of amchart code? Or any possible leads.
It's an important feature!

@martynasma

@oliverpeng
Copy link
Author

I was able to follow the following tutorial to hide the default grid & labels and add my own custom (base 2) values using ranges:

https://www.amcharts.com/docs/v5/tutorials/using-axis-ranges-to-place-labels-at-arbitrary-values-or-dates/

@workingbuddy10
Copy link

workingbuddy10 commented Mar 22, 2024

@oliverpeng can you provide any codepen? It would be great!

@oliverpeng
Copy link
Author

@workingbuddy10 https://codepen.io/oliverpeng/pen/bGJWJpb

@oliverpeng
Copy link
Author

Updated the codepen so the labels show 2^n instead of a crazy value like 131,072. Hope this helps anyone looking to do the same.

@workingbuddy10
Copy link

Thanks @oliverpeng for providing the codepen. Really appreciated your efforts.

Actually I was looking for something like this to add :
image

detailed explanation on : #1046

@p3777dev
Copy link

@martynasma It would be great you would consider this enhancement. Anytime soon!

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

No branches or pull requests

4 participants