bobs
Posts: 3
Joined: Sun Feb 21, 2021 10:56 pm

Adjusting the ticks on a negative logarithmic chart

Sun Feb 21, 2021 11:52 pm

Hello,

I would like to adjust the ticks on a negative logarithmic chart.

I would like the range to match more closely to the data. Currently it is displaying 0, 10, 100, 1000. Given the data 10 and 100 are not required.

Essentially could the range start at 1000 in both the positive and negative ranges?

I have used the following option but no no avail.

tickPixelInterval
tickInterval
minRange
min
max
tickAmount
alignTicks
endOnTick
startOnTick
tickPositioner

Is there a solution?

Fiddle: https://jsfiddle.net/bobjwatts/8ac17egt/30/

Image

User avatar
sebastian.h
Posts: 779
Joined: Fri Aug 07, 2020 7:08 am

Re: Adjusting the ticks on a negative logarithmic chart

Tue Feb 23, 2021 3:17 pm

Hi,
Welcome to our forum and thanks for contacting us with your question!

It's possible to set series.column.threshold the value on y axis at 1000, and it will be the base for the column.

API References:
https://api.highcharts.com/highcharts/s ... .threshold

Live demo:
https://jsfiddle.net/BlackLabel/my41pu8w/

Let me know if that was what you were looking for.
Best regards.
Sebastian Hajdus
Highcharts Developer

bobs
Posts: 3
Joined: Sun Feb 21, 2021 10:56 pm

Re: Adjusting the ticks on a negative logarithmic chart

Wed Feb 24, 2021 11:21 pm

Hi Sebastian,

Thanks for the reply.

That isn't quite what I'm looking for.

Is it possible to match the chart yAxis values in the jsFiddle to the yAxis values image in my original post?

10000000
1000000
100000
10000
0
-10000
-100000
-1000000
-10000000

Thanks again!
Bob

User avatar
sebastian.h
Posts: 779
Joined: Fri Aug 07, 2020 7:08 am

Re: Adjusting the ticks on a negative logarithmic chart

Thu Feb 25, 2021 8:28 am

Hi,
I have a way to add a custom tick with yAxis.tickPositions but it doesn't work for negative values.
The reason is it's not mathematically correct.

More information you can found in this article: https://www.highcharts.com/blog/snippet ... hmic-axis/

Live demo:
https://jsfiddle.net/BlackLabel/fhvzj1g9/

API References:
https://api.highcharts.com/highcharts/y ... kPositions


Best regards.
Sebastian Hajdus
Highcharts Developer

bobs
Posts: 3
Joined: Sun Feb 21, 2021 10:56 pm

Re: Adjusting the ticks on a negative logarithmic chart

Thu Feb 25, 2021 11:30 pm

Thanks again Sebastian.

I managed to achieve what I was after with a custom range. https://jsfiddle.net/bobjwatts/8ac17egt/438/

User avatar
sebastian.h
Posts: 779
Joined: Fri Aug 07, 2020 7:08 am

Re: Adjusting the ticks on a negative logarithmic chart

Fri Feb 26, 2021 8:01 am

Thats great to hear and thanks for share your solution.

​If you have further inquiries, you may reach out to me at any time.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Usage”