JFreeChart - Problem in creating moving chart
Asked Answered
A

1

1

I am using JFreeChart in my java application.

Problem

I want to plot a XYAreaChart whose domain axis (x-axis) should scroll horizontally automatically when we start plotting the data.

I saw the same thing in TimeSeriesCharts but I don't want any timeSeriesChart. I just want the scrolling x-axis.

Anathema answered 20/3, 2011 at 7:9 Comment(0)
S
2

You'll need to create your own SlidingXYDataset that implements XYDataset in a manner similar to how SlidingCategoryDataset implements CategoryDataset.

Addendum: As noted in a comment, a typical implementation can be found here.

Semicolon answered 21/3, 2011 at 17:39 Comment(3)
I found one patch for it at sourceforge.net/tracker/… but I have one problem in it when I want to set my own range of X-axis. This example works fine with plot.getDomainAxis().setAutoRange(true).. but I want to set my own range for x-axis.Anathema
It's a little dated, but it works. What's wrong with setFirstItemIndex()? IF you want a fixed domain range, see this DynamicTimeSeriesCollection example.Semicolon
Sorry, I did not want to downvote this answer. Is it possible to correct this?Undershrub

© 2022 - 2024 — McMap. All rights reserved.