Home forums Report Bugs Zero values in logarithmic mode draw off chart top?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #28654

    This reproduces the bug I’m seeing with logarithmic line charts, in the fiddle box. The only solution I’ve found is to set all 0 values to 1 and live with it being the incorrect value. No amount of changing “includeZero” or adding x values seems to help.

    var chart = new CanvasJS.Chart(“chartContainer”,{
    “axisY”: { “logarithmic”: true },
    “data”: [{
    “type”: “line”,
    “dataPoints”: [{y:10},{y:0},{y:50},{y:65},{y:150},{y:400},{y:950},{y:4500},{y:10000}]
    }] });

    chart.render();

    #28662

    Michael,

    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.

    Considering this as duplicate of Zero values in logarithmic mode draw off chart top?. Hence closing the same.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.