?
Solved

JFreeChart: Time Series Chart

Posted on 2011-09-26
1
Medium Priority
?
458 Views
Last Modified: 2012-05-12
I want to change the intervals displayed on the X axis of my TimeSeries chart.
Currently, the interval is 2 hours. So, I have the following labels: 02:00PM, 04:00PM, etc.
I want 02:00PM, 03:00PM, etc.

If possible, please provide some sample code. Thanks!
0
Comment
Question by:dshrenik
1 Comment
 
LVL 47

Accepted Solution

by:
for_yan earned 2000 total points
ID: 36624636
Under
  final DateAxis axis = (DateAxis) plot.getDomainAxis();
replace one line with these two lines:
   axis.setDateFormatOverride(new SimpleDateFormat("hh"));
        axis.setTickUnit(new DateTickUnit(DateTickUnitType.HOUR,1));

Open in new window

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month13 days, 8 hours left to enroll

750 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question