]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
complete the first 'getting-started' example (#8829)
authormjcross <mjcross@users.noreply.github.com>
Tue, 6 Apr 2021 22:54:18 +0000 (23:54 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Apr 2021 22:54:18 +0000 (18:54 -0400)
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.

docs/getting-started/index.md

index aa6cb821739cceae5464410c6caa91e5f9df6360..8513c04ae9dc992da828d026408628f8e183f0e2 100644 (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.