• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

JFreeChart: Time Series Chart

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
dshrenik
Asked:
dshrenik
  • 5
  • 3
1 Solution
 
dshrenikAuthor Commented:
JFree
0
 
dshrenikAuthor Commented:
I think this can be possible if there is a way to auto zoom onto a portion of the chart.
0
 
for_yanCommented:
You can generate another chart with shorter interval - ?
0
Industry Leaders: 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!

 
dshrenikAuthor Commented:
I'm keeping that for the last option, because in my chart, things can get a little complicated.
0
 
for_yanCommented:
I don't think you can zoom, but it is equivalent to geenrating the chart on a smaller range
0
 
dshrenikAuthor Commented:
After creating the chart, if I fix the domain range, will that automatically display only the required portion?
0
 
dshrenikAuthor Commented:
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
 
for_yanCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now