Data x = DataUtil.scale(xData);
Data max = DataUtil.scaleWithinRange(minMin, maxMax, maxData);
Data mean = DataUtil.scaleWithinRange(minMin, maxMax, meanData);
Data min = DataUtil.scaleWithinRange(minMin, maxMax, minData);
XYLine maxLine = Plots.newXYLine(x, max);
maxLine.addShapeMarkers(Shape.SQUARE, Color.GRAY, 2);
maxLine.setColor(Color.RED);
maxLine.setLineStyle(LineStyle.THIN_LINE);
maxLine.setLegend("Max");
XYLine meanLine = Plots.newXYLine(x, mean);
meanLine.addShapeMarkers(Shape.SQUARE, Color.GRAY, 2);
meanLine.setColor(Color.YELLOW);
meanLine.setLineStyle(LineStyle.THIN_LINE);
meanLine.setLegend("Mean");
XYLine minLine = Plots.newXYLine(x, min);
minLine.addShapeMarkers(Shape.SQUARE, Color.GRAY, 2);
minLine.setColor(Color.GREEN);
minLine.setLineStyle(LineStyle.THIN_LINE);
minLine.setLegend("Min");
String title = String.format("%s (k=%d, %d trials per data point)", estimator, k, NUM_TRIALS);
XYLineChart chart = GCharts.newXYLineChart(maxLine, meanLine, minLine);