function RAGGED(average){
// This returns the correct colour red, amber or green depending on the value presented
    if (average <= -1) {
        return "red";
    } 
    if (average >= 2) {
        return "green";
    } 
    return "#ff9b21";
}



function getAverage(prefix) {
    //console.log("Prefix:", prefix);

    const elements = Array.from(document.querySelectorAll(`svg[id^="${prefix}"] tspan.average`));

    const numbers = elements.map(el => {
        const text = el.textContent;
        //console.log("Raw text content:", text);
        const value = parseFloat(text);
        //console.log("Parsed value:", value);
        return value;
    }).filter(n => !isNaN(n));

    //console.log("Parsed numeric values:", numbers);

    if (numbers.length === 0) {
        console.warn("No valid numbers found!");
        return NaN;
    }

    const avg = numbers.reduce((sum, n) => sum + n, 0) / numbers.length;
    console.log("Average of averages:", avg);
    return avg;
}


function getSurveyData(){

    // Reset all comments
    document.getElementById("greatOwners").innerHTML = "";
    document.getElementById("greatLeaders").innerHTML = "";
    document.getElementById("greatGovernance").innerHTML = "";
    document.getElementById("greatCulture").innerHTML = "";
    document.getElementById("greatEngagement").innerHTML = "";
    document.getElementById("greatStewardship").innerHTML = "";
    document.getElementById("greatStrategy").innerHTML = "";
    document.getElementById("greatInnovation").innerHTML = "";
    document.getElementById("greatAdvantage").innerHTML = "";
    document.getElementById("greatMeasurement").innerHTML = "";
    document.getElementById("greatEvaluation").innerHTML = "";
    document.getElementById("greatImpact").innerHTML = "";

    // Reset all averages
    document.getElementById("Owners_avg").innerHTML = "";
    document.getElementById("Leaders_avg").innerHTML = "";
    document.getElementById("Governance_avg").innerHTML = "";
    document.getElementById("Culture_avg").innerHTML = "";
    document.getElementById("Engagement_avg").innerHTML = "";
    document.getElementById("Stewardship_avg").innerHTML = "";
    document.getElementById("Strategy_avg").innerHTML = "";
    document.getElementById("Innovation_avg").innerHTML = "";
    document.getElementById("Advantage_avg").innerHTML = "";
    document.getElementById("Measurement_avg").innerHTML = "";
    document.getElementById("Evaluation_avg").innerHTML = "";
    document.getElementById("Impact_avg").innerHTML = "";



    console.log("gettingSurveyData");

    let survey=document.getElementById("surveyId").value;
    console.log("Survey is:"+survey);

    let Q1=document.getElementById("location").value;
    let Q2=document.getElementById("level").value;
    let Q3=document.getElementById("gov").value;


    let amber = '#ff9b21'; 
    //doBigWhiteTriangle('svg1');
    //drawtriangle('#svg1','Roles','#008845',[0.5,0.6,0.5],'red', { x: 0, y: 350 },-0.7);
    //drawtriangle('#svg1','Actions','#b2c8c4',[0.1,0.6,0.5],'green',{ x: 370, y: 350 },2.3);
    //drawtriangle('#svg1','Approach','#ed4c0c',[0.3,0.6,0.5],amber,{ x: 185, y: 30 },1.4);
    //drawtriangleinverted('#svg1','Impact','#74469c',[0.7,0.6,0.8],'green',{ x: 185, y: 243},2.4);
    //makeSvgRightClickable('svg1');



    //doLittleWhiteTriangle('svg2');
    //drawtriangle('#svg2','Roles','#008845',[0.5,0.6,0.5],'', { x: 0, y: 100 },-0.7);

    //EO ROLES
    //Great Employee Owners
    resetSvg('svg1_1');
    let average = doBarData('#svg1_1','QID35_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg1_2');
    doBarData('#svg1_2','QID35_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg1_3');
    doBarData('#svg1_3','QID35_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg1_4');
    doBarData('#svg1_4','QID35_9',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');
    resetSvg('svg1_5');
    doBarData('#svg1_5','QID35_10',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');



    //Great EO Leaders
    resetSvg('svg2_1');
    average = doBarData('#svg2_1','QID36_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg2_2');
    doBarData('#svg2_2','QID36_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg2_3');
    doBarData('#svg2_3','QID36_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg2_4');
    doBarData('#svg2_4','QID36_9',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Governance
    resetSvg('svg3_1');
    average = doBarData('#svg3_1','QID37_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg3_2');
    doBarData('#svg3_2','QID37_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg3_3');
    doBarData('#svg3_3','QID37_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg3_4');
    doBarData('#svg3_4','QID37_20',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');
    resetSvg('svg3_5');
    doBarData('#svg3_5','QID37_21',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');
    resetSvg('svg3_6');
    doBarData('#svg3_6','QID37_22',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');


    //EO APPROACH
    //Great EO Culture
    resetSvg('svg4_1');
    average = doBarData('#svg4_1','QID2_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg4_2');
    doBarData('#svg4_2','QID2_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg4_3');
    doBarData('#svg4_3','QID2_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg4_4');
    doBarData('#svg4_4','QID2_9',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Engagement
    resetSvg('svg5_1');
    average = doBarData('#svg5_1','QID33_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg5_2');
    doBarData('#svg5_2','QID33_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg5_3');
    doBarData('#svg5_3','QID33_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg5_4');
    doBarData('#svg5_4','QID33_9',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Stewardship
    resetSvg('svg6_1');
    average = doBarData('#svg6_1','QID34_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg6_2');
    doBarData('#svg6_2','QID34_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg6_3');
    doBarData('#svg6_3','QID34_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg6_4');
    doBarData('#svg6_4','QID34_17',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //EO ACTIONS
    //Great EO Strategy
    resetSvg('svg7_1');
    average = doBarData('#svg7_1','QID40_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg7_2');
    doBarData('#svg7_2','QID40_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg7_3');
    doBarData('#svg7_3','QID40_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg7_4');
    doBarData('#svg7_4','QID40_9',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Innovation
    resetSvg('svg8_1');
    average = doBarData('#svg8_1','QID41_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg8_2');
    doBarData('#svg8_2','QID41_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg8_3');
    doBarData('#svg8_3','QID41_19',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg8_4');
    doBarData('#svg8_4','QID41_20',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');
    resetSvg('svg8_5');
    doBarData('#svg8_5','QID41_21',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');


    //Great EO Advantage
    resetSvg('svg9_1');
    average = doBarData('#svg9_1','QID42_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg9_2');
    doBarData('#svg9_2','QID42_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg9_3');
    doBarData('#svg9_3','QID42_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');


    //EO RESULTS
    //Great EO Measurement
    resetSvg('svg10_1');
    average = doBarData('#svg10_1','QID44_21',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg10_2');
    doBarData('#svg10_2','QID44_7',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg10_3');
    doBarData('#svg10_3','QID44_2',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg10_4');
    doBarData('#svg10_4','QID44_8',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Evaluation
    resetSvg('svg11_1');
    average = doBarData('#svg11_1','QID45_24',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg11_2');
    doBarData('#svg11_2','QID45_25',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg11_3');
    doBarData('#svg11_3','QID45_26',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg11_4');
    doBarData('#svg11_4','QID45_29',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');


    //Great EO Impact
    resetSvg('svg12_1');
    average = doBarData('#svg12_1','QID46_27',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_1');
    resetSvg('svg12_2');
    doBarData('#svg12_2','QID46_28',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_2');
    resetSvg('svg12_3');
    doBarData('#svg12_3','QID46_29',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg12_4');
    doBarData('#svg12_4','QID46_30',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');
    resetSvg('svg12_5');
    doBarData('#svg12_5','QID46_31',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');
    resetSvg('svg12_6');
    doBarData('#svg12_6','QID46_32',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');
    resetSvg('svg12_7');
    doBarData('#svg12_7','QID46_33',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_3');
    resetSvg('svg12_8');
    doBarData('#svg12_8','QID46_34',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_4');
    resetSvg('svg12_9');
    doBarData('#svg12_9','QID46_36',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');
    resetSvg('svg12_10');
    doBarData('#svg12_10','QID46_37',survey,Q1,Q2,Q3);
    //makeSvgRightClickable('svg1_5');





    // Make sure that evreything is loaded!
    setTimeout(() => {
        console.log("Waited 8 seconds");
    // We now have access to all of the averages, so can calculate the basic triangle.

    //EO ROLES
    document.getElementById("Owners_avg").innerHTML = getAverage("svg1_").toFixed(2);
    document.getElementById("Leaders_avg").innerHTML = getAverage("svg2_").toFixed(2);
    document.getElementById("Governance_avg").innerHTML = getAverage("svg3_").toFixed(2);
    let svg1_avg = (getAverage("svg1_")+3)/7;  //Owners
    let svg2_avg = (getAverage("svg2_")+3)/7;  //Leaders
    let svg3_avg = (getAverage("svg3_")+3)/7;  //Governance
    let roles_avg = (7*(svg1_avg+svg2_avg+svg3_avg)/3)-3;  // this converts the scales lengths to the correct value

    //console.log(svg1_avg,svg2_avg,svg3_avg, roles_avg);

    doLittleWhiteTriangle('svg_roles');
    //drawtriangle('#svg_roles','Roles','#008845',[0.25,0.5,0.75],'', { x: 0, y: 100 },roles_avg.toFixed(1));
    drawtriangle('#svg_roles','Roles','#008845',[svg2_avg,svg3_avg,svg1_avg],'', { x: 0, y: 100 },roles_avg.toFixed(1));
    //makeSvgRightClickable('svg_roles');

    doLittleWhiteTriangle('svg_roles_RAG');
    drawtriangle('#svg_roles_RAG','Roles','#008845',[svg2_avg,svg3_avg,svg1_avg],RAGGED(roles_avg), { x: 0, y: 100 },roles_avg.toFixed(1));
    //makeSvgRightClickable('svg_roles_RAG');

    doLittleWhiteTriangle('svg_roles_test');
    drawtriangle('#svg_roles_test','Roles','#008845',[0.9,0.9,0.9],RAGGED(roles_avg), { x: 0, y: 100 },roles_avg.toFixed(1));
    //makeSvgRightClickable('svg_roles_test');


    //EO APPROACH
    document.getElementById("Culture_avg").innerHTML = getAverage("svg4_").toFixed(2);
    document.getElementById("Engagement_avg").innerHTML = getAverage("svg5_").toFixed(2);
    document.getElementById("Stewardship_avg").innerHTML = getAverage("svg6_").toFixed(2);
    let svg4_avg = (getAverage("svg4_")+3)/7;  //Culture
    let svg5_avg = (getAverage("svg5_")+3)/7;  //Engagement
    let svg6_avg = (getAverage("svg6_")+3)/7;  //Stewardship
    let approach_avg = (7*(svg4_avg+svg5_avg+svg6_avg)/3)-3;  // this converts the scales lengths to the correct value

    console.log(svg4_avg,svg5_avg,svg6_avg,approach_avg);

    doLittleWhiteTriangle('svg_approach');
    //drawtriangle('#svg_approach','Approach','#008845',[0.25,0.5,0.75],'', { x: 0, y: 100 },average_avg.toFixed(1));
    drawtriangle('#svg_approach','Approach','#ed4c0c',[svg4_avg,svg5_avg,svg6_avg],'', { x: 0, y: 100 },approach_avg.toFixed(1));
    //makeSvgRightClickable('svg_approach');

    doLittleWhiteTriangle('svg_approach_RAG');
    drawtriangle('#svg_approach_RAG','Approach','#ed4c0c',[svg4_avg,svg5_avg,svg6_avg],RAGGED(approach_avg), { x: 0, y: 100 },approach_avg.toFixed(1));
    //makeSvgRightClickable('svg_approach_RAG');

    doLittleWhiteTriangle('svg_approach_test');
    drawtriangle('#svg_approach_test','Approach','#ed4c0c',[0.9,0.9,0.9],RAGGED(approach_avg), { x: 0, y: 100 },approach_avg.toFixed(1));
    //makeSvgRightClickable('svg_approach_test');


    //EO ACTIONS
    document.getElementById("Strategy_avg").innerHTML = getAverage("svg7_").toFixed(2);
    document.getElementById("Innovation_avg").innerHTML = getAverage("svg8_").toFixed(2);
    document.getElementById("Advantage_avg").innerHTML = getAverage("svg9_").toFixed(2);
    let svg7_avg = (getAverage("svg7_")+3)/7;  //Strategy
    let svg8_avg = (getAverage("svg8_")+3)/7;  //Innovation
    let svg9_avg = (getAverage("svg9_")+3)/7;  //Advantage
    let actions_avg = (7*(svg7_avg+svg8_avg+svg9_avg)/3)-3;  // this converts the scales lengths to the correct value

    console.log(svg7_avg,svg8_avg,svg9_avg,actions_avg);

    resetSvg('svg_actions');
    //drawtriangle('#svg_actions','Actions','#b2c8c4',[0.25,0.5,0.75],'', { x: 0, y: 100 },actions_avg.toFixed(1));
    drawtriangle('#svg_actions','Actions','#b2c8c4',[svg8_avg,svg9_avg,svg7_avg],'', { x: 0, y: 100 },actions_avg.toFixed(1));
    //makeSvgRightClickable('svg_actions');

    resetSvg('svg_actions_RAG');
    drawtriangle('#svg_actions_RAG','Actions','#b2c8c4',[svg8_avg,svg9_avg,svg7_avg],RAGGED(actions_avg), { x: 0, y: 100 },actions_avg.toFixed(1));
    //makeSvgRightClickable('svg_actions_RAG');

    resetSvg('svg_actions_test');
    drawtriangle('#svg_actions_test','Actions','#b2c8c4',[0.9,0.9,0.9],RAGGED(actions_avg), { x: 0, y: 100 },actions_avg.toFixed(1));
    //makeSvgRightClickable('svg_actions_test');


    //EO IMPACT
    document.getElementById("Measurement_avg").innerHTML = getAverage("svg10_").toFixed(2);
    document.getElementById("Evaluation_avg").innerHTML = getAverage("svg11_").toFixed(2);
    document.getElementById("Impact_avg").innerHTML = getAverage("svg12_").toFixed(2);
    let svg10_avg = (getAverage("svg10_")+3)/7;
    let svg11_avg = (getAverage("svg11_")+3)/7;
    let svg12_avg = (getAverage("svg12_")+3)/7;
    let results_avg = (7*(svg10_avg+svg11_avg+svg12_avg)/3)-3;  // this converts the scales lengths to the correct value

    console.log(svg10_avg,svg11_avg,svg12_avg,results_avg);

    resetSvg('svg_results');
    //drawtriangle('#svg_results','Results','#74469',[0.25,0.5,0.75],'', { x: 0, y: 100 },impact_avg.toFixed(1));
    drawtriangleinverted('#svg_results','Results','#74469c',[svg11_avg,svg12_avg,svg10_avg],'', { x: 0, y: 0 },results_avg.toFixed(1));
    //makeSvgRightClickable('svg_results');

    resetSvg('svg_results_RAG');
    drawtriangleinverted('#svg_results_RAG','Results','#74469c',[svg11_avg,svg12_avg,svg10_avg],RAGGED(results_avg), { x: 0, y: 0 },results_avg.toFixed(1));
    //makeSvgRightClickable('svg_results_RAG');

    resetSvg('svg_results_test');
    drawtriangleinverted('#svg_results_test','Results','#74469c',[0.9,0.9,0.9],RAGGED(results_avg), { x: 0, y: 0 },results_avg.toFixed(1));
    //makeSvgRightClickable('svg_results_test');


    //Clear up the pyramids by resetting the html
    document.getElementById("pyramids").innerHTML = `
        <svg class="pyramid" style="display: inline-block" xmlns="http://www.w3.org/2000/svg" id="svg_pyramid" width="1000" height="1000"></svg>
        <svg class="pyramid" style="display: inline-block" xmlns="http://www.w3.org/2000/svg" id="svg_pyramid_RAG" width="1000" height="1000"></svg>
        <svg class="pyramid no-axis no-text big-number" style="display: inline-block" xmlns="http://www.w3.org/2000/svg" id="svg_pyramid_RAG_test" width="1000" height="1000"></svg>
        <svg class="pyramid no-axis big-number" style="display: inline-block" xmlns="http://www.w3.org/2000/svg" id="svg_pyramid_RAG_test2" width="1000" height="1000"></svg>
   `;
  

    doBigWhiteTriangle('svg_pyramid');
    drawtriangle('#svg_pyramid','Roles','#008845',[svg1_avg,svg2_avg,svg3_avg],'', { x: 0, y: 350 },roles_avg.toFixed(1));
    drawtriangle('#svg_pyramid','Actions','#b2c8c4',[svg4_avg,svg5_avg,svg6_avg],'',{ x: 370, y: 350 },actions_avg.toFixed(1));
    drawtriangle('#svg_pyramid','Approach','#ed4c0c',[svg7_avg,svg8_avg,svg9_avg],'',{ x: 185, y: 30 },approach_avg.toFixed(1));
    drawtriangleinverted('#svg_pyramid','Results','#74469c',[svg10_avg,svg11_avg,svg12_avg],'',{ x: 185, y: 243},results_avg.toFixed(1));
    //makeSvgRightClickable('svg_pyramid');



    doBigWhiteTriangle('svg_pyramid_RAG');
    drawtriangle('#svg_pyramid_RAG','Roles','#008845',[svg1_avg,svg2_avg,svg3_avg],RAGGED(roles_avg), { x: 0, y: 350 },roles_avg.toFixed(1));
    drawtriangle('#svg_pyramid_RAG','Actions','#b2c8c4',[svg4_avg,svg5_avg,svg6_avg],RAGGED(actions_avg),{ x: 370, y: 350 },actions_avg.toFixed(1));
    drawtriangle('#svg_pyramid_RAG','Approach','#ed4c0c',[svg7_avg,svg8_avg,svg9_avg],RAGGED(approach_avg),{ x: 185, y: 30 },approach_avg.toFixed(1));
    drawtriangleinverted('#svg_pyramid_RAG','Results','#74469c',[svg10_avg,svg11_avg,svg12_avg],RAGGED(results_avg),{ x: 185, y: 243},results_avg.toFixed(1));
    //makeSvgRightClickable('svg_pyramid_RAG');


    doBigWhiteTriangle('svg_pyramid_RAG_test');
    drawtriangle('#svg_pyramid_RAG_test','Roles','#008845',[0.9,0.9,0.9],RAGGED(roles_avg), { x: 0, y: 350 },roles_avg.toFixed(1));
    drawtriangle('#svg_pyramid_RAG_test','Actions','#b2c8c4',[0.9,0.9,0.9],RAGGED(actions_avg),{ x: 370, y: 350 },actions_avg.toFixed(1));
    drawtriangle('#svg_pyramid_RAG_test','Approach','#ed4c0c',[0.9,0.9,0.9],RAGGED(approach_avg),{ x: 185, y: 30 },approach_avg.toFixed(1));
    drawtriangleinverted('#svg_pyramid_RAG_test','Results','#74469c',[0.9,0.9,0.9],RAGGED(results_avg),{ x: 185, y: 243},results_avg.toFixed(1));
    //makeSvgRightClickable('svg_pyramid_RAG_test');


    //doBigWhiteTriangle('svg_pyramid_RAG_test2');
    //drawtriangle('#svg_pyramid_RAG_test2','Roles','#008845',[0.95,0.95,0.95],RAGGED(roles_avg), { x: 0, y: 350 },roles_avg.toFixed(1));
    //drawtriangle('#svg_pyramid_RAG_test2','Actions','#b2c8c4',[0.95,0.95,0.95],RAGGED(actions_avg),{ x: 370, y: 350 },actions_avg.toFixed(1));
    //drawtriangle('#svg_pyramid_RAG_test2','Approach','#ed4c0c',[0.95,0.95,0.95],RAGGED(approach_avg),{ x: 185, y: 30 },approach_avg.toFixed(1));
    //drawtriangleinverted('#svg_pyramid_RAG_test2','Results','#74469c',[0.95,0.95,0.95],RAGGED(results_avg),{ x: 185, y: 243},results_avg.toFixed(1));
    //makeSvgRightClickable('svg_pyramid_RAG_test2');


    }, 800);



}
