Commit cfad21f3 authored by Tapio Mäntysalo's avatar Tapio Mäntysalo
Browse files

Task 5 graph improved.

parent c01d54f0
......@@ -33,7 +33,7 @@
<div class="mx-auto" style="width: 200px;">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Choose action</button>
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Choose a task</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="dropdown-main">
<a class="dropdown-item" href="#" id="dropdown-task-1">Task 1</a>
<a class="dropdown-item" href="#" id="dropdown-task-2">Task 2</a>
......@@ -70,8 +70,8 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Preys</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-x"
aria-label="positive-integer-1" aria-describedby="basic-addon1">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-x" aria-label="positive-integer-1" aria-describedby="basic-addon1">
</div>
</td>
<td>
......@@ -79,12 +79,10 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon2">Predators</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-y"
aria-label="positive-integer-2" aria-describedby="basic-addon2">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-y" aria-label="positive-integer-2" aria-describedby="basic-addon2">
</div>
</td>
<td>
</td>
</tr>
<tr>
<td>
......@@ -92,8 +90,9 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Alpha</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-alpha"
aria-label="positive-integer-1" aria-describedby="basic-addon1">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-alpha" aria-label="positive-integer-1"
aria-describedby="basic-addon1">
</div>
</td>
<td>
......@@ -101,12 +100,11 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon2">Beta</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-beta"
aria-label="positive-integer-2" aria-describedby="basic-addon2">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-beta" aria-label="positive-integer-2"
aria-describedby="basic-addon2">
</div>
</td>
<td>
</td>
</tr>
<tr>
<td>
......@@ -114,8 +112,9 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Delta</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-delta"
aria-label="positive-integer-1" aria-describedby="basic-addon1">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-delta" aria-label="positive-integer-1"
aria-describedby="basic-addon1">
</div>
</td>
<td>
......@@ -123,23 +122,21 @@
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon2">Gamma</span>
</div>
<input type="number" class="form-control input-task-5" placeholder="" id="input-task-5-gamma"
aria-label="positive-integer-2" aria-describedby="basic-addon2">
<input type="number" class="form-control input-task-5" placeholder=""
id="input-task-5-gamma" aria-label="positive-integer-2"
aria-describedby="basic-addon2">
</div>
</td>
<td>
</td>
</tr>
</tbody>
</table>
<button type="button" class="btn btn-primary" id="btn-task-5">Calculate</button>
<p>
<button type="button" class="btn btn-primary" id="btn-task-5">Calculate</button>
<div id="task-5-chart-area">
<div id="task-5-chart-div"></div>
</div>
</p>
<p id="card-task-5-result"></p>
<!--Div that will hold the pie chart-->
<div id="task-5-chart-area"><div id="task-5-chart-div"></div></div>
</div>
</div>
......@@ -349,6 +346,7 @@
$(".task-container").hide();
$(".dropdown-item").click(function () {
$(".task-container").hide();
$(".splash-screen").hide();
var selection = $(this).attr("id");
switch (selection) {
case "dropdown-example":
......
......@@ -54,9 +54,13 @@ function drawPredatorPrey(t0, x, y, alpha, beta, delta, gamma, delta_t, simulate
title: 'Time'
},
vAxis: {
title: 'Population'
title: 'Population',
scaleType: 'log',
},
colors: ['#a52714', '#097138']
colors: ['#a52714', '#097138'],
'height': 600,
'legend':'bottom',
'chartArea': {'width': '90%', 'height': '80%'},
};
var chart = new google.visualization.LineChart(document.getElementById('task-5-chart-div'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment