1👍
✅
Floating bars are availble sind Chart.js v2.9.0.
<html>
<head>
<title>Floating Bars</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
<style>
canvas {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div>
<canvas id="canvas" height="120"></canvas>
</div>
<script>
window.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
window.myBar = new Chart(ctx, {
type: 'bar',
data:{
labels:[1,2, 3, 4],
datasets:[{
label:'data1',
data:[[-3, 5], [2,10],[2, 3], [4, 8]],
backgroundColor:'rgba(255,99,132, 0.6)'
}]
},
options: {
responsive: true,
legend: {
position: 'top',
},
title: {
display: true,
text: 'Chart.js Bar Chart'
}
}
});
};
</script>
</body>
</html>
Source:stackexchange.com