JavaScript
window.onload = function () {
var chart = new CanvasJS.Chart("chartContainer",
{
width: 320,
title:{
text: "scaling"
},
axisY:{
/* title: 'gauge', */
gridThickness: 0,
/* labelFormatter: () => '', */
},
axisX:{
minimum: 0
},
data: [
{
type: "line",
dataPoints: [
{ x: 0, y: 13 },
{ x: 1, y: 15 },
{ x: 2, y: 13 },
{ 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 },
]
},
{
type: "line",
markerType: "none",
lineDashType: "dash",
color:"red",
toolTipContent: null,
dataPoints: [
{x: 0, y: 10},
{x: 3, y: 10},
]
},
{
type: "line",
markerType: "none",
lineDashType: "dash",
color:"red",
toolTipContent: null,
dataPoints: [
{x: 3, y: 11},
{x: 7, y: 11}
]
}
]
});
chart.render();
}