Sorted out refreshing of graphics for inverted triangles and also for bar graphs if no data was available

This commit is contained in:
2025-06-01 21:58:00 +01:00
parent bf17427cc4
commit 827924bd26
4 changed files with 81 additions and 37 deletions

View File

@@ -50,35 +50,13 @@ function doLittleWhiteTriangle(id){
//triangle.setAttribute("stroke", "black"); // Optional
//triangle.setAttribute("stroke-width", "2"); // Optional
svg.appendChild(triangle);
}
/*
function inlineStyles(svgElement) {
const allElements = svgElement.querySelectorAll('*');
const computedStyles = window.getComputedStyle(svgElement);
// Apply style to root SVG element
svgElement.setAttribute("style", computedStyles.cssText || "");
// Recursively apply computed styles to each element
allElements.forEach(el => {
const computed = window.getComputedStyle(el);
let inline = '';
for (let i = 0; i < computed.length; i++) {
const key = computed[i];
const value = computed.getPropertyValue(key);
inline += `${key}:${value};`;
}
el.setAttribute('style', inline);
});
}
*/
function resetSvg(id){
const svg = document.getElementById(id);
svg.innerHTML="";
}
function inlineStyles(svgElement) {
const allElements = svgElement.querySelectorAll('*');