Need help ggploly is showing labels but no lines

I have a dataset that consists of 600 entries. these 600 entries are divided in 10 sub cathagories that want to plot in corresponding colors.
for some reason the plotting is not returning errors it plots without showing the geom. lines. When hovering over the chart the labels are shown with the correct information but no lines are visible.

any suggestions on this issue?
ps if I have to add the data please tell me how, I just started with reprex and R so Newbie
the plotting code is at the bottom of my code.

library(reshape2)
library(tidyr)
#> 
#> Attaching package: 'tidyr'
#> The following object is masked from 'package:reshape2':
#> 
#>     smiths
library(ggplot2)
#> Registered S3 methods overwritten by 'ggplot2':
#>   method         from 
#>   [.quosures     rlang
#>   c.quosures     rlang
#>   print.quosures rlang
library(plotly)
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
#library(plyr)
library(RColorBrewer)
#library(pls)
library(tcltk)
#library(profvis)
#library(signal)

library(tidyverse)
library(dplyr)
library(prospectr)
#> Loading required package: RcppArmadillo
library(chipPCR)
library(parallel)
library(matrixStats)
#> 
#> Attaching package: 'matrixStats'
#> The following object is masked from 'package:dplyr':
#> 
#>     count

#Fuctions--------------------------------------------------------------------------------------------------
ConvertToNumeric <- function(DF)
{
DF[sapply(DF, is.factor)] <- lapply(DF[sapply(DF, is.factor)], as.numeric)
return(DF)
}
#Cast datatype to numeric
Factor2Numeric <- function(DF)
{
#str(DF)
for (i in 1:ncol(DF)) 
{
 if(is.factor(DF[,i])==TRUE)
 {
   print(i+10)
   print(is.factor(DF[,i]))
   DF[,i] <- as.numeric(as.character(DF[,i]))
   print(is.factor(DF[,i]))
 }
}
#str(DF)
return(DF)
}
#Select file from browser
SelectFile <- function(DataLocation,EggColour,TrayColour,CaptionType)
{
if (DataLocation == "Local")
{
 Root <- "D:/Projects/AED/AED_R_V1"
}
else if (DataLocation == "Remote")
{
 Root <- "r:/R&D-Groups/Detection/10_Projects/Kyowa_Abnormal/07-Testdata" 
}

if (EggColour == "White")
{
DataDir <- c("20190521 Dataset witte eieren")
}
else if (EggColour == "Brown")
{
DataDir <- c("20190529 Dataset bruine eieren")
}
 if ((TrayColour == "Yellow")&(CaptionType == "txt"))
 {
   CaptionDir  <- "Set_1_GeleTray_GoedeEieren"
   CaptionFile <- "Spectra_Set_1_GeleTray_Smoothed__ColumnWise_400nm_1000nm.txt"
 }
 if ((TrayColour == "Yellow")&(CaptionType == "csv"))
 {
   CaptionDir  <- "Set_1_GeleTray_GoedeEieren"
   CaptionFile <- "YellowTray.csv"
 }
 if ((TrayColour == "Red")&(CaptionType == "txt"))
 {
   CaptionDir  <- "Set_2_RodeTray_Goede eieren"
   CaptionFile <- c("Spectra_Set_2_RodeTray_Smoothed__ColumnWise_400nm_1000nm.txt")
 }
 if ((TrayColour == "Red")&(CaptionType == "csv"))
 {
   CaptionDir  <- "Set_2_RodeTray_Goede eieren"
   CaptionFile <- "RedTray.csv"
 }
 if ((TrayColour == "Green")&(CaptionType == "txt"))
 {
   CaptionDir <- "Set_3_GroeneTray_GoedeEieren"
   CaptionFile <- c("Spectra_Set_3_GroeneTray_Smoothed__ColumnWise_400nm_1000nm.txt")
 }
 if ((TrayColour == "Green")&(CaptionType == "csv"))
 {
   CaptionDir <- "Set_3_GroeneTray_GoedeEieren"
   CaptionFile <- "GroeneTray.csv"
 }
 if ((TrayColour == "Blue")&(CaptionType == "txt"))
 {
   CaptionDir <- "Set_4_BlauweTray_BloedEieren"
   CaptionFile <- c("Spectra_Set_4_BlauweTray_Smoothed__ColumnWise_400nm_1000nm.txt")
 }
 if ((TrayColour == "Blue")&(CaptionType == "csv"))
 {
   CaptionDir <- "Set_4_BlauweTray_BloedEieren"
   CaptionFile <- "Blauwetray.csv"
 }
 if ((TrayColour == "Pulp")&(CaptionType == "txt"))
 {
   CaptionDir <- "Set_5_PulpTray_XLeieren"
   CaptionFile <- c("Spectra_Set_5_PulpTray_Smoothed__ColumnWise_400nm_1000nm.txt")
 }
 if ((TrayColour == "Pulp")&(CaptionType == "csv"))
 {
   CaptionDir <- "Set_5_PulpTray_XLeieren"
   CaptionFile <- "PulpTray.csv"
 }
 SelectedFile <-c(Root,DataDir,CaptionDir,CaptionFile)
 SelectedFile <- paste(SelectedFile, collapse = "/")

return(SelectedFile)

}
#rename columns of dataframes verified
RenameVerified <- function(DF)
{
DataVerified <- DF
colnames(DataVerified) <- c('EggID','Diameter','Blood','Shellstrength','Rotten','DoubleYolk','Shellthickness','Supplier','Red','Green','Blue','Hue','Saturation','Value','Red/Green')
DataVerified <- DataVerified[!is.na(names(DataVerified))]
DataVerified <- DataVerified %>% select(-starts_with("X"))
DataVerified <- DataVerified[,1:7]
#DataVerifiedYellow <- DataVerified
return(DataVerified) 
}  
#Combine spectral data with Verified data 
DataCombine <- function (DF, DFVer)
{ 
DFMatrix <- as.matrix(DF) 
mode(DFMatrix) <- "double"
DFTranspose <- t(DFMatrix)
#mode(DFTranspose) <- "double"
DFTranspose[,1:ncol(DFTranspose)] <- as.numeric(as.character(DFTranspose[,1:ncol(DFTranspose)]))
Names <- (1:2048)
DataLenght <- (nrow(DFTranspose))
colnames(DFTranspose) <- (Names[1:ncol(DFTranspose)])
colnames(DFTranspose) <- paste("Idx", colnames(DFTranspose), sep = "")
#extract variable names from the Verified Dataset---------------------------------------------------------------------
#colnames(DataVerified)[colnames(DataVerified)=="diameter"] <- "Diameter"

#Add diameter values to dataFrame-------------------------------------------------------------------------------------
#DataVerified$Diameter <- DataEggSize$Diameter

#add_row(DataVerified,brown=NA,blood=NA,double.yolk=NA,diameter=NA,bloodspot=NA,rotten=NA,meat=NA, .before=1)---------
DFVer <- DFVer[1:(DataLenght-1),]
InsertDf <- rep(NA, ncol(DFVer))
DFVer <- rbind(InsertDf,DFVer)

#Transpose spectral dataframe so additional obeservations can be added.-----------------------------------------------
DataCombined <- as.data.frame(cbind(DFTranspose, DFVer))
#DataCombined <- t(DataCombine)

return(DataCombined)
}
FilterBlood <- function(MinValue, DF)
{
Data1 <- DF %>%
 rownames_to_column('gene')
Data2 <- Data1 %>% 
 filter(Blood <= 6 ,Blood >= MinValue)
Data3 <- Data2 %>% 
 column_to_rownames('gene')
return(Data3)
}
FilterClean <- function(MinValue, DF)
{
Data1 <- DF %>%
 rownames_to_column('gene')
Data2 <- Data1 %>% 
 filter(Blood < MinValue)
Data3 <- Data2 %>% 
 column_to_rownames('gene')
return(Data3)
}
SetNames <- function (DF,ColumnName)
{
#DF <- as.data.frame(DF)
PrefixNames <- c(ColumnName,"Egg")
PrefixNames <- paste(PrefixNames, collapse = "_")
EGGIdNames <- DF["EggID",]
#EGGIdNames <- DF["EggID",]
# #Seperate Spectral data from data set-----------------------------------------------------------------------
DF <- as.data.frame(DF[1:2048,])
#Change Column names to EggNumberIndex and add prefix-"EGG"----------------------------------------------------------
colnames(DF) <- EGGIdNames[1:ncol(DF)]
colnames(DF) <- paste(PrefixNames, colnames(DF), sep = "")
# colnames(DF) <- as.character(unlist(EGGIdNames[1,]))
# colnames(DF) <- paste(PrefixNames, as.character(unlist(EGGIdNames[1,])), sep = "")
# #Create new dataframes to be used in SG filtering
DFPlot <- as.matrix(DF)
return(DFPlot)
}
Transpose <-  function  (DF)
{
DFMatrix <- as.matrix(DF) 
mode(DFMatrix) <- "double"
DFTranspose <- t(DFMatrix) 
return(DFTranspose)
}

#Read data from files---------------------------------------------------------------------------------------------------------------------
# AEDData is spectral data from avantes spectrumanalyzer
# DataVerified is data collected manually after breaking all the eggs in the test set
# DataEggSize is eggsize data collected from the crackdetector.
# Choose Files for analysis
DataLocation <- "Local"
#DataLocation <- "Remote"
EggColour <- "White"
#EggColour <- "Brown"

TrayColour <- "Yellow"
CaptionType <- "txt"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
#ChooseFile <- "r:/R&D-Groups/Detection/10_Projects/Kyowa_Abnormal/07-Testdata/20190521 Dataset witte eieren/Set_1_GeleTray_GoedeEieren/Spectra_Set_1_GeleTray_Smoothed__ColumnWise_400nm_1000nm.txt"
#DataYellow<-read.delim(ChooseFile,header = TRUE ,sep = "t") #Data
DataYellow<-read.delim2(ChooseFile,header = TRUE ,sep = "\t") #Data
CaptionType <- "csv"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
VerifiedYellow <- read.csv(ChooseFile,header = TRUE , sep = ",") #Verified

TrayColour <- "Red"
CaptionType <- "txt"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
DataRed<-read.delim(ChooseFile,header = TRUE ,sep = "\t") #Data
CaptionType <- "csv"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
VerifiedRed <- read.csv(ChooseFile,header = TRUE , sep = ",") #Verified

TrayColour <- "Green"
CaptionType <- "txt"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
DataGreen<-read.delim(ChooseFile,header = TRUE,sep = "\t") #CleanData
CaptionType <- "csv"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
VerifiedGreen <- read.csv(ChooseFile,header = TRUE , sep = ",")

TrayColour <- "Blue"
CaptionType <- "txt"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
DataBlue<-read.delim(ChooseFile,header = TRUE,sep = "\t")
CaptionType <- "csv"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
VerifiedBlue <- read.csv(ChooseFile,header = TRUE , sep = ",")

TrayColour <- "Pulp"
CaptionType <- "txt"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
DataPulp<-read.delim(ChooseFile,header = TRUE,sep = "\t")
CaptionType <- "csv"
ChooseFile <- SelectFile(DataLocation,EggColour,TrayColour,CaptionType)
VerifiedPulp <- read.csv(ChooseFile,header = TRUE , sep = ",")

#Aditional variables to store data read from files----------------------------------------------------------------------
AEDDataYellow       <- DataYellow           #previous clean data
AEDDataRed          <- DataRed
AEDDataGreen        <- DataGreen
AEDDataBlue         <- DataBlue             #previous blood data
AEDDataPulp         <- DataPulp

DataVerifiedYellow  <- VerifiedYellow
DataVerifiedRed     <- VerifiedRed
DataVerifiedGreen   <- VerifiedGreen
DataVerifiedBlue    <- VerifiedBlue
DataVerifiedPulp    <- VerifiedPulp

#Remove all not relevant columns in Dataverified starting with 'x'
DataVerifiedYellow  <- RenameVerified(DataVerifiedYellow)
DataVerifiedRed     <- RenameVerified(DataVerifiedRed)
DataVerifiedGreen   <- RenameVerified(DataVerifiedGreen)
DataVerifiedBlue    <- RenameVerified(DataVerifiedBlue)
DataVerifiedPulp    <- RenameVerified(DataVerifiedPulp)

#Rowbind all Verified Data-------------------------------------------------------------------------------------------
 #DataVerified <- rbind(DataVerifiedYellow,DataVerifiedRed,DataVerifiedGreen,DataVerifiedBlue,DataVerifiedPulp)
#Transpose AED_Data so extra data columns can be added----------------------------------------------------------------
YellowCombined  <- DataCombine(AEDDataYellow, DataVerifiedYellow)
RedCombined     <- DataCombine(AEDDataRed, DataVerifiedRed)
GreenCombined   <- DataCombine(AEDDataGreen, DataVerifiedGreen)
BlueCombined    <- DataCombine(AEDDataBlue, DataVerifiedBlue)
PulpCombined    <- DataCombine(AEDDataPulp, DataVerifiedPulp)
# 
#Filter the data in clean and blood------------------------------------------------------------------------------------
LowerBloodBoundary <- 1
YellowClean   <- FilterClean(LowerBloodBoundary, YellowCombined)
YellowBlood   <- FilterBlood(LowerBloodBoundary, YellowCombined)
RedClean      <- FilterClean(LowerBloodBoundary, RedCombined)
RedBlood      <- FilterBlood(LowerBloodBoundary, RedCombined)
GreenClean    <- FilterClean(LowerBloodBoundary, GreenCombined)
GreenBlood    <- FilterBlood(LowerBloodBoundary, GreenCombined)
BlueClean     <- FilterClean(LowerBloodBoundary, BlueCombined)
BlueBlood     <- FilterBlood(LowerBloodBoundary, BlueCombined)
PulpClean     <- FilterClean(LowerBloodBoundary, PulpCombined)
PulpBlood     <- FilterBlood(LowerBloodBoundary, PulpCombined)

#Extract Wavelength column -------------------------------------------------------------------------------------------
 Wavelength <- as.data.frame(AEDDataYellow$Wavelength)
 WavelengthTrans <- t(Wavelength)
 
 YellowCleanData   <- Transpose(YellowClean)
 YellowBloodData   <- Transpose(YellowBlood)
 RedCleanData      <- Transpose(RedClean)
 RedBloodData      <- Transpose(RedBlood)
 GreenCleanData    <- Transpose(GreenClean)
 GreenBloodData    <- Transpose(GreenBlood)
 BlueCleanData     <- Transpose(BlueClean)
 BlueBloodData     <- Transpose(BlueBlood)
 PulpCleanData     <- Transpose(PulpClean)
 PulpBloodData     <- Transpose(PulpBlood)
 

 
 # #Create new dataframes to be used in SG filtering---------------------------------------------------------------------
 YellowCleanData   <- SetNames(YellowCleanData,"Y_Cl")
 YellowBloodData   <- SetNames(YellowBloodData,"Y_Bld")
 RedCleanData      <- SetNames(RedCleanData,"R_Cl")
 RedBloodData      <- SetNames(RedBloodData,"R_Bld")
 GreenCleanData    <- SetNames(GreenCleanData,"G_Cl")
 GreenBloodData    <- SetNames(GreenBloodData,"G_Bld")
 BlueCleanData     <- SetNames(BlueCleanData,"B_Cl")
 BlueBloodData     <- SetNames(BlueBloodData,"B_Bld")
 PulpCleanData     <- SetNames(PulpCleanData,"P_Cl")
 PulpBloodData     <- SetNames(PulpBloodData,"P_Bld")
 
 
 YellowClean <- YellowCleanData
 YellowBlood <- YellowBloodData   
 RedClean    <- RedCleanData      
 RedBlood    <- RedBloodData      
 GreenClean  <- GreenCleanData    
 GreenBlood  <- GreenBloodData    
 BlueClean   <- BlueCleanData     
 BlueBlood   <- BlueBloodData     
 PulpClean   <- PulpCleanData     
 PulpBlood   <- PulpBloodData     
 
 # Create mean data for Blood and Clean dataset----------------------------------------------------------------------
 CleanData <- cbind(YellowCleanData, RedCleanData, GreenCleanData, BlueCleanData, PulpCleanData)
 BloodData <- cbind(YellowBloodData, RedBloodData, GreenBloodData, BlueBloodData, PulpBloodData)
 CleanDataMean <- as.data.frame(rowMeans(CleanData))
 BloodDataMean <- as.data.frame(rowMeans(BloodData))                               
 colnames(CleanDataMean)[1] <- 'Mean_Clean'
 colnames(BloodDataMean)[1] <- 'Mean_Blood'
 
  # (data.frame,differantiation factor,polynomal order, windowsize (must be odd).....)
 DataCombined <- cbind(CleanData, BloodData, CleanDataMean, BloodDataMean)
 tDataCombined <- t(DataCombined)
 
 m = 1
 p = 3
 w = 35
 n = 111
 s = 13
 AEDPlotDataSG <- savitzkyGolay(tDataCombined,m,p,w)
 AEDPlotDataSG <- cbind(tDataCombined[,1:((w-1)/2)],AEDPlotDataSG,tDataCombined[,(ncol(tDataCombined)-(((w-1)/2)-1)):ncol(tDataCombined)])
 
 #reduce wavelength area for analysis------------------------------------------------------------------------------------------------
 CenterWavelength <- 550
 BandwidthWavelength <- 60
 AEDPlotDataSG <- (AEDPlotDataSG[,(CenterWavelength - BandwidthWavelength):(CenterWavelength + BandwidthWavelength)])
 WavelengthShort <- Wavelength[(CenterWavelength - BandwidthWavelength):(CenterWavelength + BandwidthWavelength),1]
 AEDPlotSG <- as.data.frame(t(AEDPlotDataSG))
 
 #AEDPlotDataSG Scaling-------------------------------------------------------------------------------------------------------------------
 SelectedWavelength <-(569.05)
 WavelengthVector <- as.vector(WavelengthShort)
 Index <- match(SelectedWavelength, WavelengthShort)
  AEDPlotSG <- cbind(WavelengthShort,AEDPlotSG)
 colnames(AEDPlotSG)[1] <- "Wavelength"
 #--------------------------------------------------------------------------------------------------------------------------------   
 
 YellowBloodVar <- ncol( AEDPlotSG %>% 
                           select(starts_with("Y_Bld")))
 YellowCleanVar <- ncol( AEDPlotSG %>% 
                           select(starts_with("Y_Cl")))
 RedBloodVar <- ncol( AEDPlotSG %>% 
                        select(starts_with("R_Bld")))
 RedCleanVar <- ncol( AEDPlotSG %>% 
                        select(starts_with("R_Cl")))
 GreenBloodVar <- ncol( AEDPlotSG %>% 
                          select(starts_with("G_Bld")))
 GreenCleanVar <- ncol( AEDPlotSG %>% 
                          select(starts_with("G_Cl")))
 BlueBloodVar <- ncol( AEDPlotSG %>% 
                         select(starts_with("B_Bld")))
 BlueCleanVar <- ncol( AEDPlotSG %>% 
                         select(starts_with("B_Cl")))
 PulpBloodVar <- ncol( AEDPlotSG %>% 
                         select(starts_with("P_Bld")))
 PulpCleanVar <- ncol( AEDPlotSG %>% 
                         select(starts_with("P_Cl")))
 
 AEDDataMelt <- data.frame( melt(AEDPlotSG, id.vars = 'Wavelength', variable = 'series'))
 MyLineType <- rep.int(2,((YellowBloodVar+YellowCleanVar+RedBloodVar+RedCleanVar+GreenBloodVar+GreenCleanVar+BlueBloodVar+BlueCleanVar+PulpBloodVar+PulpCleanVar)))
 #Add linetype 1 (solid) as indication of mean value and calculate the lenght of the array------------------------------------------------
 MyLineType <- append(MyLineType,c(1,1),after = length(MyLineType))
 MyColorsYellowBlood <- rep.int("lightgoldenrod4",YellowBloodVar)
 MyColorsRedBlood    <- rep.int("red4",RedBloodVar)
 MyColorsGreenBlood  <- rep.int("green4",GreenBloodVar)
 MyColorsBlueBlood   <- rep.int("blue",BlueBloodVar)
 MyColorsPulpBlood   <- rep.int("antiquewhite",PulpBloodVar)
 
 MyColorsYellowClean <- rep.int("lightgoldenrod1",YellowCleanVar)
 MyColorsRedClean    <- rep.int("red",RedCleanVar)
 MyColorsGreenClean  <- rep.int("green",GreenCleanVar)
 MyColorsBlueClean   <- rep.int("cadetblue1",BlueCleanVar)
 MyColorsPulpClean   <- rep.int("antiquewhite3",PulpCleanVar)
 
 MyColors <- c(MyColorsYellowClean, MyColorsRedClean, MyColorsGreenClean, MyColorsBlueClean, MyColorsPulpClean, MyColorsYellowBlood,
               MyColorsRedBlood,MyColorsGreenBlood,MyColorsBlueBlood,MyColorsPulpBlood, "red", "blue")
 
 
 

 #colour = series, linetype = series
 Q <- ggplot(AEDDataMelt) +
   geom_line(aes(Wavelength, value, colour = series, linetype = series)) +
   # #       # First n lines are of one type, last line is reference and should be different
   scale_linetype_manual(values = MyLineType)+
   # #       # First six lines are from the brewer pallette, last one a custom colour
   scale_colour_manual(values = MyColors)
 
 ggplotly(Q) %>%
   layout(
     xaxis = list(
       dtick = (BandwidthWavelength/100),
       tick0 = (CenterWavelength - BandwidthWavelength),
       tickmode = "linear"
     ))