}
private void updateChart(VariableThroughputTimer tg) {
model.clear();
chart.clearErrorMessage();
AbstractGraphRow row = new GraphRowExactValues();
row.setColor(Color.BLUE);
row.setDrawLine(true);
row.setMarkerSize(AbstractGraphRow.MARKER_SIZE_NONE);
row.setDrawThickLines(true);
long now = System.currentTimeMillis();
int rowsCount = tableModel.getRowCount();
row.add(now, 0);
row.add(now, tg.getRPSForSecond(0));
int duration = 0;
for (int i = 0; i < rowsCount; i++) {
row.add(now + (duration + 1) * 1000, tg.getRPSForSecond(duration + 1));
int rowVal = getIntFromRow(i, 2);
if (rowVal < 0) {
chart.setErrorMessage("The values entered cannot be rendered in preview...");
break;
}
duration = duration + rowVal;
row.add(now + duration * 1000, tg.getRPSForSecond(duration));
}
chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1)); //-1 because row.add(thread.getStartTime() - 1, 0)
chart.setForcedMinX(now);