Untitled
unknown
html
3 years ago
1.0 kB
11
Indexable
// Import the Chart.js library using a <script> tag
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
// Define an array of tasks
const tasks = [
{
name: "Write report",
date: "2022-12-10",
duration: 120
},
{
name: "Prepare presentation",
date: "2022-12-11",
duration: 60
},
{
name: "Attend meeting",
date: "2022-12-12",
duration: 30
}
];
// Draw a time series chart using the tasks array
drawTimeSeriesChart(tasks);
<!DOCTYPE html>
<html>
<head>
<title>Time Series Chart</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js"></script>
</head>
<body>
<h1>Time Series Chart</h1>
<script>
// Define an array of tasks
const tasks = [
{
name: "Write report",
date: "2022-12-10",
duration: 120
},
{
name: "Prepare presentation",
date: "2022-12-11",
duration: 60
},
{
name: "Attend meeting",
date: "2022-12-12
Editor is loading...