1

Ok so there was confusion on what i was asking. I need help adjusting the algorithm I already have here. First part I need the X axis to be time and Y axis to be data read from file the user specifies the directory. This data file will be written every second so the graph should pause or graph 0 if there is no data and time is still running. The purpose of this program is that a script in linux will write to a file cpu, memory and power consumption and I have to graph that.

frankp
  • 15
  • 1
  • 5

1 Answers1

1

You can add multiple TimeSeries to a TimeSeriesCollection, as shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • I don't see a clear need for a combined plot; perhaps you can amplify. – trashgod Jul 19 '11 at 01:17
  • how do i make that real time? and change the X to be time and Y to be whats read from file? – frankp Jul 19 '11 at 15:26
  • It would depend on the file's format. See also this [answer](http://stackoverflow.com/questions/5048852/using-jfreechart-to-display-recent-changes-in-a-time-series/5048863#5048863), which uses `Second`. – trashgod Jul 19 '11 at 15:30
  • if I wanted to have 3 graphs like that where would i have to put a loop or is it something more simple? The file would be a .txt file that can be read as data is written. – frankp Jul 19 '11 at 15:51
  • Start by solving the problem for one, short sample series, then refine the code; edit your question to include your [sscce](http://sscce.org/). – trashgod Jul 19 '11 at 16:35