Highcharts: Displaying zero values in logarithmic scale

前端 未结 1 1916
别那么骄傲
别那么骄傲 2020-12-19 21:07

I am working with logarithmic scale in the y-axis

I know that log(0) doesn\'t exist but I need to draw 0 values, and I need a log scale.

I read in other answ

相关标签:
1条回答
  • 2020-12-19 22:01

    Although not perfect, the best I came up with was to set the zero point to 0.0001 and then set the y-axis min to 0.0001:

    http://jsfiddle.net/6LHT8/

    yAxis: {        
        min:0.0001,
        type: 'logarithmic'
    },
    
    series: [{
        data: [100,10,0.0001,0.1,0.01,0.1]
    }]
    

    Also, this answer may nelp: Highcharts - best way to handle and display zero (or negative) values in a line chart series with logarithmic Y axis

    0 讨论(0)
提交回复
热议问题