Fixed undefined time texts
This commit is contained in:
parent
0846729561
commit
bc09c1eb17
|
@ -97,6 +97,7 @@ function createLineGraph(containerId, raceData){
|
|||
.attr("data-line", driverLapData.driver.driverId)
|
||||
.attr("data-opacitychange", 0)
|
||||
.attr("data-highlighted", 0)
|
||||
.attr("data-elemtype", elemTypes.linepoint)
|
||||
.attr("fill", getColorValue(driverIndex, enhancedLapData.length))
|
||||
.attr("cx", function(d, i) {return x(d.lap) })
|
||||
.attr("cy", function(d, i) { return y(d.position) })
|
||||
|
@ -299,11 +300,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 timeText = "Time: " + d.time;
|
||||
return [driverText, lapText, posText, timeText];
|
||||
|
||||
var returnArr = [driverText, lapText, posText];
|
||||
if(d.time){
|
||||
var timeText = "Time: " + d.time;
|
||||
returnArr.push(timeText);
|
||||
}
|
||||
|
||||
return returnArr;
|
||||
}
|
||||
|
||||
function getPitStopTextArray(raceData, d){
|
||||
|
|
Loading…
Reference in New Issue