From 778788ce2b3451dc75ca31624b1b7a99b822d340 Mon Sep 17 00:00:00 2001 From: Juan Felipe Botero Date: Thu, 17 Jun 2021 09:26:58 -0500 Subject: [PATCH] This are new chages to the development --- pipeexcersice/pipe.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pipeexcersice/pipe.js b/pipeexcersice/pipe.js index 55b9058..1e76399 100644 --- a/pipeexcersice/pipe.js +++ b/pipeexcersice/pipe.js @@ -87,10 +87,7 @@ function getResults() { } } graphGradient(min, max, velMin, diameter); - console.log(min) - console.log(max) - console.log(velMin) - console.log(diameter) + result.innerHTML += "Minimun diameter = " + diameter + " (mm)
" } @@ -218,12 +215,13 @@ function graphGradient(vmin, vmax, vel, diameter) { text.font = "15px Arial"; text.fillText("Vmin", 0, 120); text.fillText("Vmax", 260, 120); - text.fillText(diameter, (300 * ((vmax - vmin) / (vel - vmin))), 30); + var xDistance = 300 * (((vmax - vmin) / (vel - vmin))/100) + text.fillText(diameter, (xDistance)-10, 30); //lines in canvas lines = canvas.getContext("2d"); lines.beginPath(); - lines.moveTo(200, 40); - lines.lineTo(200, 130); + lines.moveTo(xDistance, 40); + lines.lineTo(xDistance, 130); lines.stroke(); ///Graphic of gradient graphic = canvas.getContext("2d");