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
  • 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 - ?

Author Comment

ID: 36714514
I'm keeping that for the last option, because in my chart, things can get a little complicated.
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bigHeights  challenge 13 56
strCopies  challenge 17 74
word0 challenge 4 54
wordmultiple challenge 12 92
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…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
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 …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

747 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

13 Experts available now in Live!

Get 1:1 Help Now