Hi,
I defined the following tick unit :
xAxis.setTickUnit( new DateTickUnit( DateTickUnit.DAY, 3, new SimpleDateFormat( "dd-MMM-yy" ) ) );
The minimum date value is : 01-Dic-2002
The maximum date value is : 31-Dic-2002
The following tick marks labels are displayed 03-dic-02, 06-dic-02, 09-dic-12, 15-dic-02, 18-dic-02, 21-dic-02, 24-dic-02, 27-dic-02, 30-dic-02, but minimum and maximum date tick labels are not displayed!. Is there a way to force them to be displayed ?
Regards
Morpheus
min & max dates not displayed in HorizontalDateAxis
Re: min & max dates not displayed in HorizontalDateAxis
No, there isn't. To see what is going on in the code, look into the previousStandardDate(...) and nextStandardDate(...) methods in the DateAxis class. It's possible that there may be ways to improve how these methods behave...suggestions are welcome.
Regards,
DG
Regards,
DG
Re: min & max dates not displayed in HorizontalDateAxis
Why calculateLowestVisibleTickValue doesn't return getMinimumDate() and calculateHighestVisibleTickValue doesn't return getMaximumDate() ?
If I'm not wrong autoRange and autoTickSelection dosen't change the fact that we always start from min date and finish at max date, am I wrong?
public Date calculateLowestVisibleTickValue(DateTickUnit unit) {
return nextStandardDate(getMinimumDate(), unit);
}
public Date calculateHighestVisibleTickValue(DateTickUnit unit) {
return previousStandardDate(getMaximumDate(), unit);
}
Regards
Morpheus
If I'm not wrong autoRange and autoTickSelection dosen't change the fact that we always start from min date and finish at max date, am I wrong?
public Date calculateLowestVisibleTickValue(DateTickUnit unit) {
return nextStandardDate(getMinimumDate(), unit);
}
public Date calculateHighestVisibleTickValue(DateTickUnit unit) {
return previousStandardDate(getMaximumDate(), unit);
}
Regards
Morpheus
Re: min & max dates not displayed in HorizontalDateAxis
Why calculateLowestVisibleTickValue doesn't return getMinimumDate() and calculateHighestVisibleTickValue doesn't return getMaximumDate() ?
If I'm not wrong autoRange and autoTickSelection dosen't change the fact that we always start from min date and finish at max date, am I wrong?
public Date calculateLowestVisibleTickValue(DateTickUnit unit) {
return nextStandardDate(getMinimumDate(), unit);
}
public Date calculateHighestVisibleTickValue(DateTickUnit unit) {
return previousStandardDate(getMaximumDate(), unit);
}
Regards
Morpheus
If I'm not wrong autoRange and autoTickSelection dosen't change the fact that we always start from min date and finish at max date, am I wrong?
public Date calculateLowestVisibleTickValue(DateTickUnit unit) {
return nextStandardDate(getMinimumDate(), unit);
}
public Date calculateHighestVisibleTickValue(DateTickUnit unit) {
return previousStandardDate(getMaximumDate(), unit);
}
Regards
Morpheus
Re: min & max dates not displayed in HorizontalDateAxis
You have to keep in mind that the code has to handle very general cases. What if the minimum "date" is 2003-04-26 15:45.34 and you request tick units at 10 minute intervals? Then the first tick label should show 15:50, followed by 16:00, but by your suggestion it would show 15:45.34, followed by 15:55.34.
Regards,
DG
Regards,
DG
Re: min & max dates not displayed in HorizontalDateAxis
Ok, I understand what u mean. Rounding Hour, Minutes, Seconds, milliseconds is understandable but I don't understand why Year, Month, Day are rounded, especially if dates are retreived from Database. In this case Min and Max Date should be displayed in the HorizontalDateAxis.
Maybe adding methods that allow adding TickMark manually would be a solution.
Regards
Morpheus
Maybe adding methods that allow adding TickMark manually would be a solution.
Regards
Morpheus