Home forums Report Bugs Breaking logarithmic yAxis for negative values

Tagged: ,

This topic contains 3 replies, has 2 voices, and was last updated by  Vishwas R 2 months, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24766

    Hello,

    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.

      “logarithmic”: true / false
      “y”: -0.000007314814396825603, / 0.000007314814396825603

    Lemme know in case you need anything more. Thank you, your help is really appreciated.

    #24770

    @ayanghatak,

    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.


    Vishwas R
    Team CanvasJS

    #24773

    Hi @vishwas,

    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.
    https://jsfiddle.net/AyanGhatak/Lst8ek6c/9/embedded/result,js

    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,
    Ayan

    #24790

    @ayanghatak,

    Thanks for your comparison and suggestion. We will reconsider this behavior in future releases.


    Vishwas R
    Team CanvasJS

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.