Home › forums › Report Bugs › Breaking logarithmic yAxis for negative values
Tagged: Axis, logarithmic
This topic contains 3 replies, has 2 voices, and was last updated by Vishwas R 2 months, 3 weeks ago.
I am using a licensed CanvasJS version in our enterprise product. And, faced a bug with broken axis. Have tried to narrow down the use-case to the following:
I am trying to create a canvasJS line chart along with a logarithmic yAxis. The data has two timeseries and one of a dataPoint has a slight negative number.
Please refer to the fiddle here – https://jsfiddle.net/AyanGhatak/Lst8ek6c/
Toggle any of these values to understand the issue better.
Lemme know in case you need anything more. Thank you, your help is really appreciated.
A logarithmic axis can only plot positive values. There simply is no way to put negative values or zero on a logarithmic axis.
Fundamental: If 10L = Z, then L is the logarithm (base 10) of Z. If L is a negative value, then Z is a positive fraction less than 1.0. If L is zero, then Z equals 1.0. If L is greater than 0, then Z is greater than 1.0. Note that there no value of L will result in a value of Z that is zero or negative. Logarithms are simply not defined for zero or negative numbers.
Thank you, for looking to it. But currently if there are data, that has a negative dataPoint and the axis is in logarithmic, then it should ideally skip that point or at-least not break that along with other series.
e.g. This is a comparison view of same data plotted against Highcharts and CanvasJS under similar conditions.
And as this is a generic error handling specific to every log axis implementation, would you consider putting this check on the library end ?
Thanks for your comparison and suggestion. We will reconsider this behavior in future releases.
You must be logged in to reply to this topic.