47 lines
1.4 KiB
HTML
Executable File
47 lines
1.4 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<canvas id="myChart" width="800" height="400"></canvas>
|
|
<script>
|
|
const ctx = document.getElementById("myChart").getContext("2d");
|
|
const myChart = new Chart(ctx, {
|
|
type: "line",
|
|
data: {
|
|
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"],
|
|
datasets: [
|
|
{
|
|
label: "Data Set 1",
|
|
data: [1, 4, 2, 5, 3, 7, 6],
|
|
backgroundColor: "rgba(255, 99, 132, 0.2)",
|
|
borderColor: "rgba(255, 99, 132, 1)",
|
|
borderWidth: 1
|
|
},
|
|
{
|
|
label: "Data Set 2",
|
|
data: [2, 5, 4, 7, 6, 9, 8],
|
|
backgroundColor: "rgba(54, 162, 235, 0.2)",
|
|
borderColor: "rgba(54, 162, 235, 1)",
|
|
borderWidth: 1
|
|
}
|
|
]
|
|
},
|
|
options: {
|
|
scales: {
|
|
xAxes: [
|
|
{
|
|
type: "time",
|
|
time: {
|
|
unit: "month"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|