Home Forums Report Bugs Column chart display error when all values same

Column chart display error when all values same

Viewing 2 posts - 1 through 2 (of 2 total)
  • #15641

    Run into this bug which occurs when you have a column chart where each of the values is high (42935017 in the example), all values are equal and includeZero is not set / set to false.

    Example:

    <!DOCTYPE HTML>
    <html>
    <head>
      <script type="text/javascript">
      window.onload = function () {
    
        var data = {
          axisY: {
            includeZero: false
          },
          data: [{
            type: "column",
            dataPoints: [
              { x: 10, y:  42935017 },
              { x: 20, y: 42935017 },
              { x: 30, y: 42935017 },
              { x: 40, y: 42935017 }
            ]
          }]
        };
        
        // 2 Charts 1 Config
        var chart = new CanvasJS.Chart("chartContainer", data);
        var chart2 = new CanvasJS.Chart("chartContainer2", data);
    
        chart.render();
        chart2.render();
      }
      </script>
      <script type="text/javascript" src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
    </head>
    <body>
      
      <!-- height 561px and below display columns aligned to bottom -->
      <div id="chartContainer" style="height: 561px; width: 1000px;"></div>
      
      <!-- height 562px and above display columns just going buck wild and rendering near the top -->
      <div id="chartContainer2" style="height: 562px; width: 1000px;"></div>
      
    </body>
    </html>

    This is running in jsbin [here](https://jsbin.com/yecogoy/4/edit?html,output). You may need to alter the values based on your screen size, as this seems to be directly caused by the automatic scaling of the graph. The values in the example are what I experienced, but if you set #chartContainer‘s height to 400px and #chartContainer2‘s height to 1000px you should see the same thing.

    Also, just in case you don’t immediately see the issue, here is a video of that minimal use case:

    https://youtu.be/BKYJ-RbmOdU

    • This topic was modified 6 years, 8 months ago by Hannah.
    • This topic was modified 6 years, 8 months ago by Hannah.
    • This topic was modified 6 years, 8 months ago by Hannah.
    #15690

    Hannah,

    Thank you for reporting this. We are looking into the issue and will get back to you at the earliest.

    —-
    Bivek Singh,
    Team CanvasJS

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

You must be logged in to reply to this topic.