Sorted out refreshing of graphics for inverted triangles and also for bar graphs if no data was available
This commit is contained in:
32
savesvg.js
32
savesvg.js
@@ -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('*');
|
||||
|
||||
Reference in New Issue
Block a user