use of kg.apc.charting.DateTimeRenderer in project jmeter-plugins by undera.
the class VariableThroughputTimerGui method updateChart.
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).getLeft());
int duration = 0;
for (int i = 0; i < rowsCount; i++) {
row.add(now + (duration + 1) * 1000, tg.getRPSForSecond(duration + 1).getLeft());
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).getLeft());
}
// -1 because row.add(thread.getStartTime() - 1, 0)
chart.setxAxisLabelRenderer(new DateTimeRenderer(DateTimeRenderer.HHMMSS, now - 1));
chart.setForcedMinX(now);
model.put("Expected RPS", row);
chart.invalidateCache();
chart.repaint();
}
Aggregations