Dynamic Plotting

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hari_tue
Posts: 2
Joined: Tue Mar 08, 2016 11:04 am
antibot: No, of course not.

Dynamic Plotting

Post by hari_tue » Tue Mar 08, 2016 11:09 am

Hi,

I need to plot the values dynamaically with the timestamp.

I am reading a value from a .txt file and have to plot the values every 5 seconds with timestamp as my x-axis and the double value from .txt file as y axis.

The logging happens in the .txt file continuously.I need to pick up the data from the log(.txt file) and plot with time

Can some one help me?

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Dynamic Plotting

Post by John Matthews » Tue Mar 08, 2016 5:19 pm

Use a WatchService to see file modifications, as shown here, and a SwingWorker to update the chart's dataset, as shown here. The listening chart will update itself in response.

hari_tue
Posts: 2
Joined: Tue Mar 08, 2016 11:04 am
antibot: No, of course not.

Re: Dynamic Plotting

Post by hari_tue » Fri Mar 18, 2016 7:17 pm

Hey thanks :P

Locked