function drawStack(context, value, color, w, h, dX, dY, sX, sY){ //var value = document.getElementById(value).value; var c = document.getElementById(context); var ctx = c.getContext("2d"); var width = w; var height = h; var distanceX = dX; var distanceY = dY+1; var shiftX = sX; var shiftY = sY; ctx.clearRect(0, 0, 300, 300); ctx.beginPath(); // determine number of whole coins (1 coin = 10 ECUs) nFullCoin = (value - (value%10))/10; /////// draw full coins var currentTower = 0; var currentLevel = -1; for(var i=0; i= 50){ shift+=(width+distance); index = 0; } if(k%amount[z]==0 && amount[z]!=1){ ctx.fillText(amount[z], shift+distance-5, c.height-5) } else if (k%(amount[z]*stack[z])==0 && amount[z]==1) { ctx.fillText(amount[z]*stack[z], shift+distance-5, c.height-5) } height = 5; posY = c.height-y-height-20; ctx.rect(shift+10,posY-(index)*4,width, 5); index+=1; } shift+=(width+distance); } var total = 0; for(p = 0; p< amount.length; p++){ total+=stack[p]*amount[p]; } ctx.stroke(); ctx.font = "bold 15px Segoe UI"; //ctx.fillText(total+" ECU", 65,295); ctx.stroke(); */ }