DateAxis Help

A discussion forum for JFreeChart (a 2D chart library for the Java platform).

DateAxis Help

Postby CoreDumped » Wed Aug 31, 2016 10:54 am

Hello / Bonjour,

First of all, sorry for my bad english.

I current have a TimeSeries Chart created by "createTimeSeriesChart".
I'm representing a week of data, every 5 minutes, for a total of 2016 points ( 12(points/hour) * 24(hours/day) * 7(total days) )

My problem is with DomainCrossHair (or with the auto generated DateAxis):

When i click in the plot area, the date value is ok (day/month/year are ok) but not hours, it's like '00:16:23:100', '23:57:01:522' but these hours don't exist on my series !

Code for adding value is :
Code: Select all
myTimeSeries.add (new Minute(...), myValue)

Code for getting click value :

In ChartProgress method :

Code: Select all
JFreeChart localJFree=this.chartPanel.getChart();
XYPlot localXYPlot = (XYPlot)localJFree.getPlot();
double d1 = localXYPlot.getDomainCrosshairValue();
java.util.Date date=new java.util.Date (d1);
Calendar c = Calendar.getInstance();

[edit] Domain range size = 10478, so it's 1440 minutes * 7 days instead of 2016 points

What i could do ?
Posts: 8
Joined: Wed Aug 31, 2016 10:30 am

Return to JFreeChart

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests