Labels corresponding to y values - CanvasJS

Labels corresponding to y values - CanvasJS

by canvasjs

HTML

<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 280px; width: 100%;"></div>

JavaScript

var chart = new CanvasJS.Chart("chartContainer",
{
	title:{
		text: "Labels corresponding to y values",
	},
    axisY: {
        stripLines: [
            {
                value: 5,
                label: "Australia"
            },
            {
                value: 10,
                label: "New York"
            },
            {
                value: 15,
                label: "London"
            },
            {
                value: 20,
                label: "Paris"
            }
        ],
        maximum: 20
    },
    axisX: {
        interval: 1
    },
	data: [
	{
		type: "column",
		dataPoints: [
            {  y: 5,   x: 1},
            {  y: 10,  x: 2},
            {  y: 15,  x: 3},
            {  y: 20,  x: 4}
		]
	}
	]
});
chart.render();