cleaned chart code/added cells chart

This commit is contained in:
Max Robinson
2021-02-11 13:24:42 -07:00
parent 7b19798be9
commit 9626cd54d6
12 changed files with 137 additions and 51 deletions

View File

@@ -18,23 +18,14 @@ class SpeciesChart extends ChartController {
dataPoints: []
}
);
for (var i in FossilRecord.tick_record) {
var t = FossilRecord.tick_record[i];
var p = FossilRecord.species_counts[i];
this.data[0].dataPoints.push({x:t, y:p});
}
this.addAllDataPoints();
}
addNewest() {
var i = FossilRecord.tick_record.length-1;
addDataPoint(i) {
var t = FossilRecord.tick_record[i];
var p = FossilRecord.species_counts[i];
this.data[0].dataPoints.push({x:t, y:p});
}
removeOldest() {
this.data[0].dataPoints.shift();
}
}
module.exports = SpeciesChart;