[ONOS-7344]: Adding build numbers to the SCPF front page graphs
Change-Id: Icb2a86c83dd37d4e606ecb1f5a8817256aa10562
diff --git a/TestON/JenkinsFile/scripts/SCPFLineGraph.R b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
index 8417188..8c59c0d 100644
--- a/TestON/JenkinsFile/scripts/SCPFLineGraph.R
+++ b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
@@ -141,6 +141,10 @@
# Create lists c() and organize data into their corresponding list.
print( "Combine data retrieved from databases into a list." )
+buildNums <- fileData$build
+fileData$build <- c()
+print( fileData )
+
if ( ncol( fileData ) > 1 ){
for ( i in 2:ncol( fileData ) ){
fileData[ i ] <- fileData[ i - 1 ] + fileData[ i ]
@@ -163,6 +167,7 @@
# Format data frame so that the data is in the same order as it appeared in the file.
dataFrame$Legend <- as.character( dataFrame$Legend )
dataFrame$Legend <- factor( dataFrame$Legend, levels=unique( dataFrame$Legend ) )
+dataFrame$build <- buildNums
# Adding a temporary iterative list to the dataFrame so that there are no gaps in-between date numbers.
dataFrame$iterative <- rev( seq( 1, nrow( fileData ), by = 1 ) )
@@ -205,9 +210,14 @@
limitExpansion <- expand_limits( y = 0 )
+tickLength <- 3
+breaks <- seq( max( dataFrame$iterative ) %% tickLength, max( dataFrame$iterative ), by = tickLength )
+breaks <- breaks[ which( breaks != 0 ) ]
+
maxYDisplay <- max( dataFrame$Values ) * 1.05
yBreaks <- ceiling( max( dataFrame$Values ) / 10 )
yScaleConfig <- scale_y_continuous( breaks = seq( 0, maxYDisplay, by = yBreaks ) )
+xScaleConfig <- scale_x_continuous( breaks = breaks, label = rev( dataFrame$build )[ breaks ] )
# ------------------------------
# Fundamental Variables Assigned
@@ -224,8 +234,7 @@
imageDPI <- 200
# Set other graph configurations here.
-theme <- theme( axis.text.x = element_blank(),
- axis.ticks.x = element_blank(),
+theme <- theme( axis.text.x = element_text( angle = 0, size = 13 ),
plot.title = element_text( size = 32, face='bold', hjust = 0.5 ),
legend.position = "bottom",
legend.text = element_text( size=22 ),
@@ -251,6 +260,7 @@
fundamentalGraphData <- mainPlot +
limitExpansion +
+ xScaleConfig +
yScaleConfig +
xLabel +
yLabel +