Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# JFreeChart: Time Series Chart

Posted on 2011-09-27
Medium Priority
409 Views
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
Question by:dshrenik
[X]
###### 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
• 5
• 3

Author Comment

ID: 36714502
0

Author Comment

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

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

Author Comment

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

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
0

Author Comment

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

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

LVL 47

Accepted Solution

for_yan earned 2000 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

Question has a verified solution.

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

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 â€¦
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define â€¦
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.
###### Suggested Courses
Course of the Month11 days, 14 hours left to enroll