Add full name to tooltip
This commit is contained in:
parent
c24d0ab10a
commit
0a58aad220
|
@ -461,7 +461,7 @@ function createLineGraph(containerId, raceData){
|
|||
}
|
||||
|
||||
function getLapTextArray(raceData, d){
|
||||
var driverText = getDriverCodeById(raceData,d.driverId);
|
||||
var driverText = getDriverCodeById(raceData,d.driverId) + " - " + getDriverNameById(raceData,d.driverId);
|
||||
var lapText = "Lap: " + d.lap;
|
||||
var posText = "Pos: " + d.position;
|
||||
var returnArr = [driverText, lapText, posText];
|
||||
|
|
|
@ -85,6 +85,12 @@ function getDriverCodeAndPositionArray(raceData, lapNumber){
|
|||
return posDriverCode;
|
||||
}
|
||||
|
||||
function getDriverNameById(raceData, driverId){
|
||||
var driverData = raceData.drivers.filter(driv => driv.driverId == driverId)[0];
|
||||
if(driverData === undefined) return "XXX"; // TODO: Do a real fix instead of this quick fix
|
||||
return driverData.forename + " " + driverData.surname;
|
||||
}
|
||||
|
||||
function getDriverCodeById(raceData, driverId){
|
||||
var driverData = raceData.drivers.filter(driv => driv.driverId == driverId)[0];
|
||||
if(driverData === undefined) return "XXX"; // TODO: Do a real fix instead of this quick fix
|
||||
|
|
Loading…
Reference in New Issue