Skip to content

Commit

Permalink
Update 2023-11-15-data_visualization.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
TripleYei authored Nov 15, 2023
1 parent 09993d4 commit 2db78e5
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion _posts/2023-11-15-data_visualization.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Pie Charts
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart');
Expand Down Expand Up @@ -148,3 +148,51 @@ Bar Charts
</body>
</html>
~~~~

Line Graphs

~~~~
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="myChart"></canvas>
<style>
canvas{
width: 100%;
max-width: 700px;
}
</style>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
const ctx = document.getElementById('myChart');
new Chart(ctx, {
type: 'line',
data: {
labels: ['HTML', 'CSS', 'JS'],
datasets: [{
label: '# of Votes',
data: [12, 19, 3],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
</script>
</body>
</html>
~~~~

0 comments on commit 2db78e5

Please sign in to comment.