Dynamically replace object values from html textarea
Good Day;
I’m creating bar charts utilizing JavaScript. What i would like is the consumer to enter values for the chart. At the second i wrote code (by way of a tutorial) the place the values are onerous coded on to the script.I have to amend the onerous coded so the worth may be entered by way of a textarea and dynamically the chart modifications in keeping with the values (i choose to not have a button – dynamical modifications).
This is my javascript object:
const traditional = doc.getElementById('traditional').worth; var myBarchart = new BarChart({ canvas: myCanvas, seriesName: "Vinyl records", padding: 40, gridStep: 5, gridColor: "black", information: { Classical_Music: traditional, "Alternative Rock": 12, Pop: 18, Jazz: 32 }, colours: ["#a55ca5", "#67b6c7", "#bccd7a", "#eb9743"], titleOptions: { align: "middle", fill: "black", font: { weight: "daring", dimension: "18px", household: "Lato" } } });
What i would like the worth from the traditional must be used to vary the worth within the information object.
HTML Code:
<physique> <textarea id="traditional"></textarea><br> <canvas id="myCanvas" fashion="background: white;"></canvas> <legend for="myCanvas"></legend> <script kind="textual content/javascript" src="script.js"></script>
Any steerage will likely be appreachiated.
Vinyl
by way of Active questions tagged javascript – Stack Overflow https://ift.tt/AfiLy43
November 1, 2023 at 08:03AM
-
Product on sale
Audiophile Vinyl Records Cleaning BundleOriginal price was: €83.88.€73.88Current price is: €73.88. incl. VAT -
Product on sale
Easy Start Vinyl Records Cleaning KitOriginal price was: €83.88.€73.88Current price is: €73.88. incl. VAT -
Vinyl Records Cleaner Easy Groove Concentrate€41.94 incl. VAT -
Easy Groove Super Set€238.80 incl. VAT -
Easy Groove Enzycaster – vinyl records prewash cleaner€41.94 incl. VAT -
Easy Groove Extreme MK. II- vinyl records prewash cleaner€54.00 incl. VAT -
Vinyl Records Cleaner – Easy Groove Virgin Concentrate€42.00 incl. VAT -
Easy Groove Spray&Wipe vinyl records cleaner€41.94 incl. VAT








