Merge pull request #6 from F1Vis/flo_branch

Fixed undefined time texts
This commit is contained in:
Flo 2017-12-29 17:13:16 +01:00 committed by GitHub
commit 9a94ac0cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -301,11 +301,18 @@ function createLineGraph(containerId, raceData){
}
function getLapTextArray(raceData, d){
var driverText = getDriverCodeById(raceData,d.driverId);
var lapText = "Lap: " + d.lap;
var posText = "Pos: " + d.position;
var returnArr = [driverText, lapText, posText];
if(d.time){
var timeText = "Time: " + d.time;
return [driverText, lapText, posText, timeText];
returnArr.push(timeText);
}
return returnArr;
}
function getPitStopTextArray(raceData, d){