Created
January 31, 2024 19:54
-
-
Save psbrandt/82ec94ef33dcc3201d40302b27d8e19f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title>Chart.js</title> | |
| </head> | |
| <body> | |
| <div style="width: 50%"> | |
| <canvas id="myChart"></canvas> | |
| </div> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <script> | |
| const ctx = document.getElementById('myChart'); | |
| new Chart(ctx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], | |
| datasets: [{ | |
| label: '# of Votes', | |
| data: [12, 19, 3, 5, 2, 3], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| scales: { | |
| y: { | |
| beginAtZero: true | |
| } | |
| } | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment