Calcul boite
- Détails
- Écrit par : thierry.trupot@gmail.com
- Catégorie : Uncategorised
- Temps de lecture : 1 min
- Clics : 29
function draw(){ var canvas = document.getElementById('main'); if (canvas.getContext){ main.width = 700; main.height = 300; main.style.left = "70px"; main.style.top = "60px"; main.style.position = "absolute"; var ctx = canvas.getContext('2d'); var rx = 0.005 ; var ry = 0.04 ; var x1 = 10; var x2 = 110; var y2 = 110; var regmin = 1000; var regmax = 7000; var dem = 1; main.height = regmax*ry; calcul(); for (j = 0; j < 4; j++){ if (Graph[j][5] == 1) { for (i = 1; i < 5; i++){ dem = Graph[j][i]; ctx.beginPath(); x1 = dem * regmin * rx; y1 = (regmax-regmin) * ry; x2 = dem * regmax * rx; y2 = (regmax-regmax) * ry; ctx.strokeStyle=Graph[j][0]; ctx.moveTo(x1,y1); ctx.lineTo(x2,y2); ctx.stroke(); } } } } else{ window.location.href="comparatifboiteie.html"; } } function testCocher(id){ var aComparer = new Array("boite1", "boite2", "boite3", "boite4"); var select = document.getElementById('1-3' ); var valeur = select.options[select.selectedIndex].value; for (val in aComparer){ if(document.getElementById(aComparer[val]).checked == true) { alert(aComparer[val]+' '+ valeur+' : Coche'); } } }