JFreeChart: Time Series Chart

Posted on 2011-09-27
Last Modified: 2012-05-12
For a TImeSeriesChart, is it possible to generate a chart and then extract only a part of the chart.

For example, the first chart in the attached image is the original chart. The second chart is the extracted portion from the original between t=12:00PM and t = 4:00AM.

If possible, please provide some sample code. Thanks!
Question by:dshrenik
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3

Author Comment

ID: 36714502

Author Comment

ID: 36714508
I think this can be possible if there is a way to auto zoom onto a portion of the chart.
LVL 47

Expert Comment

ID: 36714510
You can generate another chart with shorter interval - ?
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.


Author Comment

ID: 36714514
I'm keeping that for the last option, because in my chart, things can get a little complicated.
LVL 47

Expert Comment

ID: 36714520
I don't think you can zoom, but it is equivalent to geenrating the chart on a smaller range

Author Comment

ID: 36714524
After creating the chart, if I fix the domain range, will that automatically display only the required portion?

Author Comment

ID: 36714534
Can you tell me how I can set the range for the domain axis (which is a DateAxis)?

final DateAxis domainAxis = (DateAxis) plot.getDomainAxis();

not sure how I must pass arguments to:
(I want to pass the 2 Date arguments)
LVL 47

Accepted Solution

for_yan earned 500 total points
ID: 36714585
Somthing like that should work:

 SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");

        java.util.Date dd0 = sdf.parse("00:00", new ParsePosition(0));

              java.util.Date dd01 = sdf.parse("04:00", new ParsePosition(0));

     domainAxis.setRange(dd0, dd01);

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JavaFX TableView not displaying correctly 3 161
sql import cannot be resolved jsp 3 117
eclipse console opening separately 2 49
JAVA API design with micro service cloud in mind 1 111
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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 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 theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

739 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