Nanosecond precision with date4j.

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
castanhojfc
Posts: 2
Joined: Tue Apr 15, 2014 3:53 pm
antibot: No, of course not.

Nanosecond precision with date4j.

Post by castanhojfc » Tue Apr 15, 2014 3:59 pm

Hello,

I want to draw some gantt charts, were the data comes with nanoseconds, i know that jfreechart is dependable on the original Date object of Java, thus, allowing at the maximum millisecond precision. Converting nanoseconds to miliseconds is not the solution because, i really need that precision, since if I convert the data, I will lose important information. I have fond a library(date4j) that deals with this problem, still, i need a TimePeriod object to draw the plot, and that one needs to be fed with Date stuff. Is it possible to change in anyway the behavior of the library, so that i can use it with date4j?

Cheers.

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

Re: Nanosecond precision with date4j.

Post by david.gilbert » Wed Apr 16, 2014 8:10 am

The two places where java.util.Date gets used are in the DateAxis class and in the TimeSeriesCollection class (and related RegularTimePeriod classes). The core axis and dataset methods in fact transfer data using double primitives (consider NumberAxis and XYSeriesCollection, these have no dates at all), so the use of java.util.Date is an implementation detail rather than part of the design. This means that there are no technical barriers to implementing an axis and a dataset that support higher precision dates. That said, there would be quite a lot of code required to replace what is done by DateAxis and TimeSeriesCollection.
David Gilbert
JFreeChart Project Leader

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

castanhojfc
Posts: 2
Joined: Tue Apr 15, 2014 3:53 pm
antibot: No, of course not.

Re: Nanosecond precision with date4j.

Post by castanhojfc » Tue Apr 22, 2014 3:19 pm

Yes. I've been studying some code from the library, and i realized that its a lot of code to replace, thus making it very difficult to make it compatible with date4j.
I think that adding nanosecond precision would be a great idea though. More people would be using jFreeChart :mrgreen:
JfreeChart continues, of course, to be a excelent tool.

Thanks for the information, anyway.

Ashfaqur11
Posts: 2
Joined: Mon Jul 14, 2014 2:05 pm
antibot: No, of course not.

Re: Nanosecond precision with date4j.

Post by Ashfaqur11 » Mon Jul 14, 2014 2:10 pm

Hey everyone,

Has there been any update to include nano seconds range for the Gannt charts?

@castanhojfc: If you have managed to update the codes could you kindly share it.

If it not at all possible to get nanoseconds range with jfreechart, any other recommendations for gannt chart library in java?

Thanks.

mattxb
Posts: 1
Joined: Wed Mar 01, 2017 4:03 pm
antibot: No, of course not.

Re: Nanosecond precision with java.time API

Post by mattxb » Wed Mar 01, 2017 6:21 pm

Hi,

first of all thanks for this wonderful charting API, I really appreciate this fine work.

Like some others autors in this forum before me, I also need to plot time series data with nano second precision for my project.

Since Java 8 the Oracle guys finally introduced a long overdue time API to the native java language.
Check out the java.time package. In our proect we actually make extensive use of the new classes,
that allow for nanosecond precision.

@David: I understand your choice for the java.util.Date types, since they where state of the art for a long time although there existed many different third vendor time APIs like Date4j or JodaTime.

I really want to motivate to migrate the exisiting TimeSeries and DateAxes types to the new state of the art time API.
I think a lot of people would be grateful and profit from it especially because of nanosecond precision and standardized date and time formatting.

Do you see any chance to update or fork TimeSeries and DateAxes based on that new java.time API in the near future?

Cheers,
MattXB

JavaGeorge
Posts: 1
Joined: Mon Mar 06, 2017 7:10 am
antibot: No, of course not.
Location: Stockholm/phuket
Contact:

Re: Nanosecond precision with date4j.

Post by JavaGeorge » Mon Mar 06, 2017 7:15 am

Im also wondering about the chance for an update on dagens casino. It is a great site. Especially for Swedish players. Im sure there is alot in the pipe, as it always is when it comes to casino sites like alla casino på nätet, but it would be greatly appriciated. Will keep my eye out. Cheers!

Locked