JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<br/><!-- Just so that JSFiddle's Result label doesn't overlap the Chart -->
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Line Chart"
},
axisY: {
minimum: 30,
maximum: 100
},
data: [{
type: "line",
dataPoints: [{
x: 1,
y: 30
},
{
x: 2,
y: 50
},
{
x: 3,
y: 75
},
]
}]
});
chart.render();
var axisY = chart.axisY[0];
axisY.addTo("stripLines", {
value: axisY.viewportMinimum,
label: axisY.viewportMinimum,
labelPlacement: "outside",
labelFontColor: axisY.labelFontColor,
color: axisY.tickColor,
labelBackgroundColor: chart.backgroundColor,
thickness: 0
});