JSFiddle - React, Tailwind, and code Playground
by mustadirmahmood
HTML
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
<div id="chartContainer" style="height: 300px; width: 100%;">
</div>
JavaScript
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",
{
width: 342,
title:{
text: "scaling 1:2"
},
axisY:{
/* title: 'gauge', */
gridThickness: 0,
/* labelFormatter: () => '', */
suffix: 'mm'
},
axisX:{
minimum: 0,
interval: 1,
},
data: [
{
type: "line",
dataPoints: [
{ x: 0, y: 0 },
{ x: 1, y: 15 },
{ x: 2, y: 30 },
{ x: 3, y: 11 },
{ x: 4, y: 9 },
{ x: 5, y: 12 },
{ x: 6, y: 11 },
{ x: 7, y: 12 },
{ x: 8, y: 14 },
{ x: 9, y: 13 },
{ x: 10, y: 13 },
{ x: 11, y: 15 },
{ x: 12, y: 13 },
{ x: 13, y: 11 },
{ x: 14, y: 9 },
{ x: 15, y: 12 },
{ x: 16, y: 11 },
{ x: 17, y: 12 },
{ x: 18, y: 14 },
{ x: 19, y: 13 },
{ x: 20, y: 13 },
]
},
]
});
chart.render();
}