>>396
Good morning,I've written a JavaScript function
that can generate bar charts.
Please feel free to use it.
/**
* Draw a bar graph in svg
* (The width depends on its parent element.)
* rate: 0-100 %, integer
* h: bar height, integer
* color: bar color(e.g.,"gray", "#cccccc"), string
*/
function svgBar(rate, h, color) {
return `<svg viewbox=\"0 0 100 ${h}\" style=\"background: white; border: 2px solid black;\"><rect width=\"${rate}\" height=\"${h}\" stroke=\"none\" fill=\"${color}\"/></svg>`;
}

document.getElementById('exp').innerHTML = svgBar(exp, 3, '#cc3333');

https://i.imgur.com/2sZOUmk.jpeg