Highcharts: Displaying zero values in logarithmic scale

大憨熊 提交于 2019-12-29 08:08: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 answers that changing the zero values to null solve the problem, but it is not working for me. See the example: http://jsfiddle.net/QEK3x/15/

Thank you in advance.


回答1:


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



来源:https://stackoverflow.com/questions/19447408/highcharts-displaying-zero-values-in-logarithmic-scale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!