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", {
theme: "dark1",
axisX: {
lineThickness: 0,
tickLength: 0,
labelFormatter: function(e) {
return "";
}
},
axisY: {
lineThickness: 0,
tickLength: 0,
gridThickness: 0,
includeZero: false,
labelFormatter: function(e) {
return "";
}
},
data: [{
type: "line",
color: "white",
dataPoints: [
{ x: 1, y: 2.2, indexLabel: "PGCE 2.2" },
{ x: 2, y: 0.8, indexLabel: "ICCT 0.8" },
{ x: 5, y: 1, indexLabel: "Today", color: "#ce0031", indexLabelBackgroundColor: "white", indexLabelFontColor: "black" },
{ x: 6, y: 1 },
{ x: 7, y: 1.8, indexLabel: "CTC 1.8" }
]
}]
});
chart.render();