Menu

#884 Month.previous() using default TimeZone

1.0.x
closed-fixed
General (896)
5
2008-09-01
2008-08-27
Crane Wang
No

When creating a DateAxis using the different timezone daylight saving time setting with JVM default(for example, the pc is "Europe/Berlin" with dst, and in program is "GMT+1"), then the chart will draw one more unwanted axis tick label at the begining of the domain axis.

I found the problems in method Month.previous().
The functions is called in DateAxis.previousStandardDate(Date, DateTickUnit) [line 964 and 969].
It using current timezone to create a new Month, but this Month object using default timezone to return a previous Month.

Please run the Test to see the result.
And I modified the Month.java, added a timezone variable and modified some constructors, also methods previous() and next()

Discussion

  • Crane Wang

    Crane Wang - 2008-08-27

    the example and the modified Month.java

     
  • David Gilbert

    David Gilbert - 2008-09-01
    • assigned_to: nobody --> mungady
    • status: open --> closed-fixed
     
  • David Gilbert

    David Gilbert - 2008-09-01

    Logged In: YES
    user_id=112975
    Originator: NO

    Thanks for the report. Your solution works, but I want to avoid weighing down the RegularTimePeriod subclasses with additional fields, and previous modifications (e.g. the addition of the peg(Calendar) method) have been made with that in mind. So I'm going to fix the problem within the DateAxis class by "pegging" the Month returned by month.previous() using the TimeZone defined for the axis. The fix makes your test program work, and will be included in the 1.0.11 release.

    Regards,

    Dave Gilbert
    JFreeChart Project Leader

     

Log in to post a comment.