set output "${chartFileName}"
set xlabel "Build"
set ylabel "${units}"
-set yrange [0 : ${y_max} < *]
-set style line 1 lc rgb '#d3d3d3' lt 1 lw 1 dashtype 2
+
+# Set y-axis range based on y_max
+set yrange [0 : ${y_max}]
+
+set style line 1 lc rgb '#d3d3d3' lt 1 lw 1 dashtype 2 # Grid style
+set style line 2 lc rgb '#0000FF' lt 1 lw 1 # threshold - Blue
+set style line 3 lc rgb '#00FF00' lt 1 lw 1 # cps-limit - Green
+set style line 4 lc rgb '#800080' lt 1 lw 1 # measured - Purple
+
set grid ytics ls 1
set xtics rotate
-plot '$dataFile' using 1:3:xtic(sprintf("%d", column(1))) with linespoints title "measured", \
- '$dataFile' using 1:2 with lines linestyle 2 title "limit"
+
+# Use plot command with explicit column assignments and lines for all series
+plot '$dataFile' using 1:2 with lines linestyle 2 title "threshold", \
+ '$dataFile' using 1:3 with lines linestyle 3 title "cps-limit", \
+ '$dataFile' using 1:4:xtic(1) with linespoints linestyle 4 title "measured"
EOT
# Run the temporary Gnuplot script
awk -F, '{
if ($2 > max) max = $2;
if ($3 > max) max = $3;
+ if ($4 > max) max = $4;
} END {
+ if (max == 0) {
+ max = 100;
+ }
print max * 1.2;
}' "$dataFile"
}