https://github.com/alexandrehiroyuki/chartjs-practice
https://github.com/alexandrehiroyuki/chartjs-practice
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexandrehiroyuki/chartjs-practice
- Owner: AlexandreHiroyuki
- Created: 2022-04-26T19:54:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-27T00:38:33.000Z (about 4 years ago)
- Last Synced: 2025-05-18T21:06:28.732Z (about 1 year ago)
- Language: HTML
- Homepage: https://alexandrehiroyuki.github.io/ChartJS-Practice/
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Chart.js Practice
```
const mixedChart = new Chart(document.getElementById('lineChart'), {
data: {
labels: ['January', 'February', 'March', 'April', 'May', 'June'],
datasets: [
{
type: 'bar',
label: 'Bar Dataset',
data: [10, 20, 30, 40],
backgroundColor: '#ff5555',
borderColor: '#ff7777'
},
{
type: 'line',
label: 'Line Dataset',
data: [20, 30, 40, 50],
backgroundColor: '#5555ff',
borderColor: '#7777ff'
}
]
},
options: {
y: {
beginAtZero: true
}
}
})
```
- data - The data object containing the chart data.
- labels - The labels for the chart(X axis).
- datasets - The datasets for the chart.
- type - The type of chart.
- label - The label for the dataset.
- data - The data for the dataset.
- backgroundColor - The background color for the dataset.
- borderColor - The border color for the dataset.
- borderWidth - The border width for the dataset.
- options - The options object for the chart.