(dataPoint: number[])
| 80 | } |
| 81 | |
| 82 | addDataPoint(dataPoint: number[]) { |
| 83 | if (dataPoint.length !== this.numLines) { |
| 84 | throw Error("Length of dataPoint must equal number of lines"); |
| 85 | } |
| 86 | dataPoint.forEach(y => { |
| 87 | this.minY = Math.min(this.minY, y); |
| 88 | this.maxY = Math.max(this.maxY, y); |
| 89 | }); |
| 90 | |
| 91 | this.data.push({x: this.data.length + 1, y: dataPoint}); |
| 92 | this.redraw(); |
| 93 | } |
| 94 | |
| 95 | private redraw() { |
| 96 | // Adjust the x and y domain. |