UNPKG

lightview

Version:

Small, simple, powerful web UI and micro front end creation ... Great ideas from Svelte, React, Vue and Riot combined.

69 lines (67 loc) 2.14 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Lightview:Components:Basic Charts</title> <link href="../css/tutorial.css" rel="stylesheet"> <link href="../slidein.html" rel="module"> <link href="repl.html" rel="module"> <script src="../javascript/highlightjs.min.js"></script> <script src="../javascript/marked.min.js"></script> <script src="../javascript/utils.js"></script> </head> <body class="tutorial-body"> <script src="../javascript/lightview.js"></script> <div class="tutorial-instructions"> <l-slidein src="./contents.html" class="toc"></l-slidein> <div class="markdown"> ## Basic Charts The basic chart component, `l-chart`, supports bar, pie, and column charts through configuration data provided as relaxed JSON in the tag contetn area. </div> <button class="nav-next"><a href="gantt-repl.html" target="content">Next</a></button> </div> <div class="repl"> <h2></h2> <l-repl id="repl" style="min-height:95vh;min-width:600px;" previewpinned path="$location" previewheight="500px"> <div slot="headhtml"></div> <div slot="bodyhtml"></div> <div slot="script"></div> <template slot="src"> <l-head> <link href="./chart.html" rel="module"> <script src="../javascript/lightview.js"></script> </l-head> <l-body> <l-chart id="myPieChart" type="PieChart" style="height:500px;" title="How Much Pizza I Ate Last Night"> { options: { }, columns: [ {label: "Topping", type: "string"}, {label: "Slices", type: "number"} ], rows: [ ["Mushrooms", 3], ["Onions", 1], ["Olives", 1], ["Zucchini", 1], ["Pepperoni", 2] ] } </l-chart> </l-body> <script> const el = document.getElementById("myPieChart"); el.addEventListener("initialized",() => { const chart = el.chart; chart.addRow(["Anchovies",1]); }); </script> </template> </l-repl> </div> <script> processMarkdown(); </script> </body> </html>