Search code examples
highchartsaxislogarithm

Highcharts - Line disappears when using logarithmic axis


If I change the y-axis type to logarithmic on the meteogram example of the highcharts demo, the temperature line stops being visible. Is this a bug or is there something in the code preventing it from displaying when in logarithmic mode?

The only change I made to the demo was to add type: 'logarithmic' on line 492:

yAxis: [{ // temperature axis
        type: 'logarithmic',

See this jsFiddle.

Any ideas? Thanks!


Solution

  • It seems like this is a (solvable and unknown?) bug indeed.

    Somehow a logarithmic y-axis is not compatible with a negativeColor attribute.

    Go to line 594 of your meteogram example and remove the negativeColor: '#48AFE8' attribute:

    592|  zIndex: 1,
    593|  color: '#FF3333',
    594|  negativeColor: '#48AFE8'     << remove this line
    

    Now the logarithmic plot will work as expected. See DEMO.

    I have also set the y-axis min, max properties and both startOnTick and endOnTick to false to make the graph look a bit better. I hope this helps you out :)


    Update 1: This bug has now been reported to GitHub

    Update 2: Highcharts developers have solved this bug as of June 3, 2015 in commit fde07c2