Solved

JFreeChart: Time Series Chart

Posted on 2011-09-27
8
404 Views
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!
0
Comment
Question by:dshrenik
  • 5
  • 3
8 Comments
 

Author Comment

by:dshrenik
ID: 36714502
JFree
0
 

Author Comment

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

Expert Comment

by:for_yan
ID: 36714510
You can generate another chart with shorter interval - ?
0
 

Author Comment

by:dshrenik
ID: 36714514
I'm keeping that for the last option, because in my chart, things can get a little complicated.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 47

Expert Comment

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

Author Comment

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

Author Comment

by:dshrenik
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:
rangeAxis.setRange()
(I want to pass the 2 Date arguments)
0
 
LVL 47

Accepted Solution

by:
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);
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HashMap Vs TreeMap 12 55
JAVA part two 5 56
GUI builder for Eclipse? 8 27
xampp tool 12 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 …
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now