EighthASecond sampling period for TimeSeriesChart.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
zinZ
Posts: 19
Joined: Mon Jul 09, 2007 2:18 pm

EighthASecond sampling period for TimeSeriesChart.

Post by zinZ » Wed Aug 01, 2007 11:00 am

Hello,

I am using a TimeSeriesChart. The sampling period of my data is eighth a second. And so I would like my domainAxis to be sampled each eighth a second.
For example, when I use timeAxis.java2DToValue(), I want to get an eighth a second x value and not a millisecond x value.

I thank about some possibilities :
- to define a new RegularTimePeriod called EighthASecond, it looks very complicated
- to use SegmentedTimeLine, but I really don't if it could resolved my problem cause I have never used it
- to do a DomainLockedOnData after the java2DToValue(), this solution is not very proper for me, and it looks very slow. I have to call java2DToValue() very often.


Thank you for any reply.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Aug 01, 2007 5:20 pm

Why don't you just round the millisecond value to the nearest 1/8th of a second?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

zinZ
Posts: 19
Joined: Mon Jul 09, 2007 2:18 pm

Post by zinZ » Thu Aug 02, 2007 8:59 am

Oh, yes sure. I have not thunk to this solution.

I have done that by this way.

Code: Select all

x = Math.round( x / 125 ) * 125;
Thank youy for your reply.

Locked