I have a diagram in which x axis shows the time and the y axis shows my data. I want to change the Scale by choosing different metrics for x axis. e.g second, minute and hour scale. the default is second. therefore if I choose the minute the diagram should be smaller and be more curved. Any idea? The UI is not completed however you suppose that the there would be x and y axis. The parameter degree determines that It should be scaled to second(degree=1), minute (degree=60) or hour(degree=3600)
private void drawLines(Graphics g, ArrayList<Point> points,int degree) throws Exception {
if (points == null || points.isEmpty()) {
throw new Exception("No points found!!!");
}
for (int i = 0; i < points.size() - 1; i++) {
Point firstPoint = points.get(i);
Point secondPoint = points.get(i + 1);
g.drawLine((int) firstPoint.getX(), (int) firstPoint.getY(), (int) secondPoint.getX(),
(int) secondPoint.getY());
}
}