Chart.js/samples/scales/non-numeric-y.html
Jukka Kurkela 986f72f933
Rename dist/Chart* to dist/chart* (#7416)
* Rename dist/Chart* to dist/chart*
* Add a note to migration docs
* Review update
2020-05-25 16:54:22 -04:00

71 lines
1.5 KiB
HTML

<!doctype html>
<html>
<head>
<title>Line Chart</title>
<script src="../../dist/chart.min.js"></script>
<script src="../utils.js"></script>
<style>
canvas{
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div style="width:75%;">
<canvas id="canvas"></canvas>
</div>
<script>
var config = {
type: 'line',
data: {
xLabels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
yLabels: ['', 'Request Added', 'Request Viewed', 'Request Accepted', 'Request Solved', 'Solving Confirmed'],
datasets: [{
label: 'My First dataset',
data: ['', 'Request Added', 'Request Added', 'Request Added', 'Request Viewed', 'Request Viewed', 'Request Viewed'],
fill: false,
borderColor: window.chartColors.red,
backgroundColor: window.chartColors.red
}]
},
options: {
responsive: true,
title: {
display: true,
text: 'Chart with Non Numeric Y Axis'
},
scales: {
x: {
display: true,
scaleLabel: {
display: true,
labelString: 'Month'
}
},
y: {
type: 'category',
position: 'left',
display: true,
scaleLabel: {
display: true,
labelString: 'Request State'
},
reverse: true
}
}
}
};
window.onload = function() {
var ctx = document.getElementById('canvas').getContext('2d');
window.myLine = new Chart(ctx, config);
};
</script>
</body>
</html>