Есть код :
<?php
$dataPoints = array();
$test = array();
for ($i=0; $i < 2; $i+=0.1) {
$ara = array("label"=> $i, "y"=> $i);
array_push($dataPoints, $ara);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<script>
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
theme: "light2",
title: {
text: ""
},
axisY: {
suffix: "%",
scaleBreaks: {
autoCalculate: true
}
},
data: [{
type: "column",
yValueFormatString: "",
indexLabel: "",
indexLabelPlacement: "inside",
indexLabelFontColor: "white",
dataPoints: <?php echo json_encode($dataPoints, JSON_NUMERIC_CHECK); ?>
}]
});
chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 370px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
</html>
но при запуске идёт 0.0 0.1 0.2 0.30000000004 0.4 0.5 0.6 0.7 0.8 0.99999999999 1.2
как исправить чтобы было так = 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 ?