JSFiddle - React, Tailwind, and code Playground
startValue - Sets Starting Value for Strip Line on Axis Y - 0 | JSFiddle Sample Code
HTML
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 360px; width: 100%;"></div>
JavaScript
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer", {
title: {
text: "Chart with Striplines"
},
axisX: {
valueFormatString: "####",
stripLines:[{
value: 1930
}, {
value: 1950
}]
},
data: [{
type: "spline",
dataPoints: [
{ x: 1910, y: 5 },
{ x: 1920, y: 9 },
{ x: 1930, y: 17},
{ x: 1940, y: 32},
{ x: 1950, y: 22},
{ x: 1960, y: 14},
{ x: 1970, y: 25},
{ x: 1980, y: 18},
{ x: 1990, y: 20}
]
}]
});
chart.render();
chart.addTo("data", {
type: "line",
markerSize: 0,
toolTipContent: null,
highlightEnabled: false,
lineThickness: 2,
color: "orange",
dataPoints: [
{ x: 1930, y: 25 },
{ x: 1950, y: 25 }
]
})
}