complete the first 'getting-started' example (#8829)

This page is very likely the first example a new user sees, so we should make it clear how to actually use the config and setup show to actually render a chart.
This commit is contained in:
mjcross 2021-04-06 23:54:18 +01:00 committed by GitHub
parent ac0a86b95d
commit b4d118e6e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,6 +53,19 @@ module.exports = {
};
```
Finally, render the chart using our configuration:
```html
<script>
// === include 'setup' then 'config' above ===
var myChart = new Chart(
document.getElementById('myChart'),
config
);
</script>
```
It's that easy to get started using Chart.js! From here you can explore the many options that can help you customise your charts with scales, tooltips, labels, colors, custom actions, and much more.
All our examples are [available online](https://www.chartjs.org/samples/latest/) but you can also download the `Chart.js.zip` archive attached to every [release](https://github.com/chartjs/Chart.js/releases) to experiment with our samples locally from the `/samples` folder.