Roundar Chart
Generate rounded SVG radar charts for your web app
// Code to modify #roundar-chart and #chart-style const chart = document.getElementById("roundar-chart"); chart.replaceChildren( window.roundar( { infection: "Infection Risk", hospitalization: "Hospitalization Risk", death: "Mortality Risk", }, [ { fill: "blue", class: "flu", infection: 0.85, hospitalization: 0.35, death: 0.08, }, { fill: "yellow", "stroke-dasharray": "1 0.67", infection: 0.35, hospitalization: 0.23, death: 0.64, }, ], { size: 100, // size of the chart axes: true, // display axes scales: 10, // how many scale marks labels: true, // display labels padding: 15, // the padding around the chart in svg units labelFontSize: 2.75, // font size in ems dx: -2, // horizontal offset of chart dy: 8, // vertical offset of chart } ) ); const style = document.getElementById("chart-style"); style.innerText = ` .scale { fill: rgb(200, 0, 0); fill-opacity: 0.03; } .axis { cursor: crosshair; } .shape { fill-opacity: 0.2; } .label { text-shadow: 1px 1px 1px white; cursor: default; } .flu { fill-opacity: 0.33; cursor: crosshair; transition: 100ms ease-in-out; } .flu:hover { fill-opacity: 0.67; } `;