Improvements to the SCPF and FUNC/HA/USECASE front page graphs.
- Legend was moved below the graph.
- Color changes (more notable in SCPF).
- SCPF now displays 50 builds instead of 100.
- Increased text size of x-axis labels on FUNC/HA/USECASE graphs.
- Increase the overall quality of the images.
Change-Id: I65f4aa758ce31ccb3f52a71743b3838ed45becd6
diff --git a/TestON/JenkinsFile/scripts/SCPFLineGraph.R b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
index 376014d..923e787 100644
--- a/TestON/JenkinsFile/scripts/SCPFLineGraph.R
+++ b/TestON/JenkinsFile/scripts/SCPFLineGraph.R
@@ -115,7 +115,7 @@
# - x: x-axis values (usually iterative, but it will become date # later)
# - y: y-axis values (usually tests)
# - color: the category of the colored lines (usually legend of test)
-theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
+theme_set( theme_grey( base_size = 22 ) ) # set the default text size of the graph.
mainPlot <- ggplot( data = dataFrame, aes( x = iterative, y = Values, color = Legend ) )
print( "Formatting main plot." )
@@ -125,23 +125,24 @@
yScaleConfig <- scale_y_continuous( breaks = seq( 0, max( dataFrame$Values ) * 1.05, by = ceiling( max( dataFrame$Values ) / 10 ) ) )
-xLabel <- xlab( "Date" )
+xLabel <- xlab( "Time" )
yLabel <- ylab( args[ 9 ] )
fillLabel <- labs( fill="Type" )
legendLabels <- scale_colour_discrete( labels = names( fileData ) )
centerTitle <- theme( plot.title=element_text( hjust = 0.5 ) ) # To center the title text
-theme <- theme( axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.title = element_text( size = 28, face='bold' ) )
+theme <- theme( axis.text.x = element_blank(), axis.ticks.x = element_blank(), plot.title = element_text( size = 32, face='bold' ), legend.position="bottom", legend.text=element_text( size=13.3, face="bold" ), legend.title = element_blank() )
+colors <- scale_color_manual( values=c( "#111111", "#008CFF", "#FF3700", "#00E043", "#EEB600", "#E500FF") )
-fundamentalGraphData <- fundamentalGraphData + yScaleConfig + xLabel + yLabel + fillLabel + legendLabels + centerTitle + theme
+fundamentalGraphData <- fundamentalGraphData + yScaleConfig + xLabel + yLabel + fillLabel + legendLabels + centerTitle + theme + colors
print( "Generating line graph." )
-lineGraphFormat <- geom_line()
-pointFormat <- geom_point( size = 0.2 )
+lineGraphFormat <- geom_line( size = 0.75 )
+pointFormat <- geom_point( size = 1.75 )
title <- ggtitle( title )
result <- fundamentalGraphData + lineGraphFormat + pointFormat + title
-
+6
# Save graph to file
print( paste( "Saving result graph to", outputFile ) )
-ggsave( outputFile, width = 10, height = 6, dpi = 200 )
-print( paste( "Successfully wrote result graph out to", outputFile ) )
\ No newline at end of file
+ggsave( outputFile, width = 15, height = 10, dpi = 200 )
+print( paste( "Successfully wrote result graph out to", outputFile ) )
diff --git a/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R b/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
index 395823d..3f2d827 100644
--- a/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
+++ b/TestON/JenkinsFile/scripts/testCaseGraphGenerator.R
@@ -120,7 +120,7 @@
# - x: x-axis values (usually iterative, but it will become build # later)
# - y: y-axis values (usually tests)
# - color: the category of the colored lines (usually status of test)
-theme_set( theme_grey( base_size = 20 ) ) # set the default text size of the graph.
+theme_set( theme_grey( base_size = 26 ) ) # set the default text size of the graph.
mainPlot <- ggplot( data = dataFrame, aes( x = iterative, y = Tests, color = Status ) )
print( "Formatting main plot." )
@@ -129,18 +129,21 @@
passedColor <- geom_ribbon( aes( ymin = 0, ymax = dataFrame$num_passed ), fill = "green", linetype = 0, alpha = 0.05 )
plannedColor <- geom_ribbon( aes( ymin = 0, ymax = dataFrame$num_planned ), fill = "blue", linetype = 0, alpha = 0.01 )
+colors <- scale_color_manual( values=c( "#E80000", "#00B208", "#00A5FF") )
+
xScaleConfig <- scale_x_continuous( breaks = dataFrame$iterative, label = dataFrame$Build )
yScaleConfig <- scale_y_continuous( breaks = seq( 0, max( dataFrame$Tests ), by = ceiling( max( dataFrame$Tests ) / 10 ) ) )
xLabel <- xlab( "Build Number" )
yLabel <- ylab( "Test Cases" )
fillLabel <- labs( fill="Type" )
-legendLabels <- scale_colour_discrete( labels = c( "Failed", "Passed", "Planned" ) )
+legendLabels <- scale_colour_discrete( labels = c( "Failed Cases", "Passed Cases", "Planned Cases" ) )
centerTitle <- theme( plot.title=element_text( hjust = 0.5 ) ) # To center the title text
-theme <- theme( plot.title = element_text( size = 28, face='bold' ), axis.text.x = element_text( angle = 45, size = 10 ) )
+theme <- theme( plot.title = element_text( size = 32, face='bold' ), axis.text.x = element_text( angle = 0, size = 14 ), legend.position="bottom", legend.text=element_text( size=18, face="bold" ), legend.title = element_blank() )
+
# Store plot configurations as 1 variable
-fundamentalGraphData <- mainPlot + plannedColor + passedColor + failedColor + xScaleConfig + yScaleConfig + xLabel + yLabel + fillLabel + legendLabels + centerTitle + theme
+fundamentalGraphData <- mainPlot + plannedColor + passedColor + failedColor + xScaleConfig + yScaleConfig + xLabel + yLabel + fillLabel + colors + legendLabels + centerTitle + theme
print( "Generating line graph." )
@@ -152,5 +155,5 @@
# Save graph to file
print( paste( "Saving result graph to", outputFile ) )
-ggsave( outputFile, width = 10, height = 6, dpi = 200 )
+ggsave( outputFile, width = 15, height = 10, dpi = 200 )
print( paste( "Successfully wrote result graph out to", outputFile ) )