amcharts / amcharts4

The most advanced amCharts charting library for JavaScript and TypeScript apps.
https://www.amcharts.com/
1.16k stars 322 forks source link

enhancement - Plot negative values in ValueAxis when logarithmic = true #2100

Closed lucasgdutra closed 4 years ago

lucasgdutra commented 4 years ago

enhancement - Plot negative values in ValueAxis when logarithmic = true

Is not possible to compute log10(x) when x <= 0, but negatives values can be calculated with Math.log10(Math.abs(x)) and then inverted multipling by-1

To maintaining continuity when closer to 0log10(x) can be approximated by log10(1 + Math.abs(x/1))

resulting in function below presented by J. Beau W. Webber y = Math.sign(x) * Math.log10(1 + Math.abs((x/1)))

The Aproximation is great to values > |10|

reference: https://www.mathworks.com/matlabcentral/fileexchange/57902-symlog https://pdfs.semanticscholar.org/70d5/3d9f448e6f2c10bd87a4a058be64f5af7dbc.pdf

zeroin commented 4 years ago

Thank you for suggestion, we will consider it.

martynasma commented 4 years ago

Hi again. Sorry for the wait. We have decided not to implement this feature at this point. Sorry.