I'm tested TimeSeriesChart Demo with Second(sec, min) constructor.
But The display chart is not correct.
Here my test code :
public TimeSeriesChart(final String title) {
super(title);
final TimeSeries series = new TimeSeries("Per Second Data");
final Minute min = new Minute();
series.add(new Second(1, min), 10.0); //point 1
series.add(new Second(20, min), 17.0); //point 2
series.add(new Second(58, min), -14.0); //point 3
series.add(new Second(120, min), 11.0); //point 4
series.add(new Second(150, min), 13.0); //point 5
series.add(new Second(360, min), 5.0); //point 6
final TimeSeriesCollection dataset = new TimeSeriesCollection(series);
chart = ChartFactory.createTimeSeriesChart(
"View Temp Step setting",
"Time",
"Temperature",
dataset,
true,
true,
false
);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
setContentPane(chartPanel);
}
Display result : http://me2.do/GXMVKd7Q
point 6 &5 is position first is display chart. (ie. in case of sec has a over 120 value)
What is the problem?
Thanks advance!
TimeSeriesChart time is missing position
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: TimeSeriesChart time is missing position
The second should be a value in the range 0 to 59. I notice there is a copy and paste error in the JavaDocs for the constructor you are using. I'll correct that for the next release, and maybe even add an argument checker to ensure the second value falls within the correct range.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program