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 7 years, 4 months ago by Hannah.
-
This topic was modified 7 years, 4 months ago by Hannah.
-
This topic was modified 7 years, 4 months ago by Hannah.