0

I am using a TimeSeriesChart (jfreechart) to represent data with a chart that shows 24h. Each point of the curve consists of a double value (y axis) and a timestamp including milliseconds (x axis). If make sure that I have at least a value at 00:00:00 and at 23:59:59 - how many points there are inbetween depends on the data.

JFreeChart connects the points which are provided automatically to a curve so I was wondering if it's possible to ask the chart what a curves value is at a certain time, e.g.

assume I have a series with 4 points:

1.1.2012 00:00:00.000 - value = 0
1.1.2012 01:00:00.000 - value = 60
1.1.2012 23:00:00.000 - value = 600

and I let JFreeChart connect these points - is there any way to ask JFreeChart for the value at e.g. 22:30:00 even though I didn't provide a data point for this time?

thanks

1 Answer 1

1

Because the points are connected with straight lines, you can use linear interpolation, as suggested here. For polynomial regression, consider LUDecompositionImpl.

1
  • Revised in 1.0.14, the built-in Regression, cited here.
    – trashgod
    Apr 11, 2012 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.