Problem with time

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
maexchen
Posts: 15
Joined: Tue Nov 21, 2006 10:16 am

Problem with time

Post by maexchen » Tue Nov 21, 2006 10:22 am

Hello! I have a problem with the timeline, I want that the time is shown in seconds, and always starts with 0. This is my code, and the time starts alwas with the systemtime.
Please help me!

Code: Select all

final TimeSeries series = new TimeSeries("Random Data"); 
        
        Second current = new Second(); 
        System.out.println (current); 
        double value = 100.0; 
        for (int i = 0; i < 40; i++) { 
            try { 
                value = value + Math.random() - 0.5; 
                series.add(current, new Double(value)); 
                current = (Second) current.next(); 
            } 
            catch (final SeriesException e) { 
                System.err.println("Error adding to series"); 
            } 
        }

Locked