homeautomationstatus-graphisch
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| homeautomationstatus-graphisch [2021/12/05 15:08] – varnholt | homeautomationstatus-graphisch [2021/12/05 15:15] (aktuell) – varnholt | ||
|---|---|---|---|
| Zeile 3: | Zeile 3: | ||
| Schon lange im Einsatz, aber noch nicht dokumentiert. Ich nutze Chart.js | Schon lange im Einsatz, aber noch nicht dokumentiert. Ich nutze Chart.js | ||
| - | Erst muss man es mal installieren. Erstmal amp installieren | + | Erst muss man es mal [[installieren|installieren]]. Nachdem |
| - | + | ||
| - | Ok, jetzt nur noch das Beispiel zum laufen bekommen, das natürlich auch erst nicht ging. Mein Minimal-Beispiel ist: | + | |
| - | < | + | |
| - | < | + | |
| - | <script src=" | + | |
| - | <canvas id=" | + | |
| - | < | + | |
| - | const ctx = document.getElementById(' | + | |
| - | const myChart = new Chart(ctx, { | + | |
| - | type: ' | + | |
| - | data: { | + | |
| - | labels: [' | + | |
| - | datasets: [{ | + | |
| - | label: '# of Votes', | + | |
| - | data: [12, 19, 3, 5, 2, 3], | + | |
| - | backgroundColor: | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | 'rgba(153, 102, 255, 0.2)', | + | |
| - | ' | + | |
| - | ], | + | |
| - | borderColor: | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ' | + | |
| - | ], | + | |
| - | borderWidth: | + | |
| - | }] | + | |
| - | }, | + | |
| - | options: { | + | |
| - | scales: { | + | |
| - | y: { | + | |
| - | beginAtZero: | + | |
| - | } | + | |
| - | } | + | |
| - | } | + | |
| - | }); | + | |
| - | </ | + | |
| - | + | ||
| - | </ | + | |
homeautomationstatus-graphisch.1638713302.txt.gz · Zuletzt geändert: 2021/12/05 15:08 von varnholt
