Commit db1f5761 authored by Bastien Durel's avatar Bastien Durel
Browse files

add COL_avg columns to the view to get 7-days averages

parent b3cd2fd1
......@@ -21,7 +21,7 @@ case 'rea':
break;
}
$sql = "select *, $col val from covid_agg order by jour";
$sql = "select *, $col val, ${col}_avg avg_val from covid_agg order by jour";
$rs = $conn->prepare($sql);
$rs->execute();
......
......@@ -133,6 +133,7 @@
data.forEach(function(d) {
d.date = parseTime(d.jour);
d.val = +d.val;
d.avg = +d.avg_val;
map[d.date] = d;
});
x.domain(d3.extent(data, d => parseTime(d.jour)));
......
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