Solved

JFreeChart: Time Series Chart

Posted on 2011-09-26
1
447 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 500 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
tomcat administrtor 12 68
ejb wildfly example 2 70
jboss 7.1 start up error 1 60
How to log java errors in tomcat 8 23
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This video teaches viewers about errors in exception handling.

685 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