JSFiddle - React, Tailwind, and code Playground
by ElanchezhiyanP
January 19, 2023
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", {
axisY: {
maximum: 1000,
gridThickness: 0,
},
data: [{
type: "line",
dataPoints: [
{ x: 10, y: 710 },
{ x: 20, y: 550 },
{ x: 30, y: 500 },
{ x: 40, y: 650 },
{ x: 50, y: 950 },
{ x: 60, y: 680 },
{ x: 70, y: 280 },
{ x: 80, y: 340 },
{ x: 90, y: 140 }
]
},
{
type:"line",
color:"#b3db8f",
markerSize: 0,
toolTipContent: null,
highlightEnabled: false,
dataPoints:[
{x:20, y:0},
{x:20, y:1000}
]
},
{
type:"line",
color:"#b3db8f",
markerSize: 0,
toolTipContent: null,
highlightEnabled: false,
dataPoints:[
{x:50, y:0},
{x:50, y:1000}
]
},
{
type:"line",
color:"#b3db8f",
markerSize: 0,
toolTipContent: null,
highlightEnabled: false,
dataPoints:[
{x:80, y:0},
{x:80, y:1000}
]
},
{
type: "scatter",
markerSize: 0,
toolTipContent: null,
highlightEnabled: false,
indexLabelFontColor: "#b3db8f",
dataPoints: [
{x:20, y:1000, indexLabel: "\u25C0 Injection 1"},
{x:50, y:1000, indexLabel: "\u25C0 Injection 2"},
{x:80, y:1000, indexLabel: "\u25C0 Injection 3"}
]
}
]
});
chart.render();