I'm trying to show some data using a Line chart from Chart.js
My current chart looks like this:
My desired output should be displayed as follows:
My code for the first chart is the following:
var chart = new Chart(ctx, {
type: "line",
data: {
labels: This.xAxis,
datasets: [{
backgroundColor: gradient,
pointBackgroundColor: "white",
borderWidth: 1,
borderColor: "#5946B0",
pointRadius: 2,
displayColors: false,
data: This.yAxis
}]
},
options: {
title: {
display: false,
text: "Test"
},
tooltips: {
backgroundColor: "#FAFAFA",
borderColor: "lightgreen",
borderWidth: 1,
titleFontColor: "black",
titleFontStyle: "normal",
displayColors: false,
bodyFontColor: "black"
},
legend: {
display: false
},
plugins: {
zoom: {
pan: {
enabled: true,
mode: "x",
speed: 10,
threshold: 10
},
zoom: {
enabled: true,
mode: "y"
}
}
}
}
});