test Image
For each day I want to see the number of calls made and the total duration for all calls.
The chart is exactly what I wanted, there is only one problem that really needs your help.
If the total duration of calls is more that 24 hours, there will be problems to display.
The time series I use is like this:
Code: Select all
TimeSeries s2 = new TimeSeries("Duration", Day.class);
s2.add(new Day(2,2, 2001), 5000*1000);
s2.add(new Day(3,2, 2001), 3230*1000);
s2.add(new Day(4,2, 2001), 4170*1000);
…..
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(s2);
return dataset;
The chart is like this
Code: Select all
JFreeChart chart = ChartFactory.createTimeSeriesChart(
"Phone - duration and number of calls plot",
"Date", "number of calls", dataset,
false, true, false);
XYPlot plot = (XYPlot) chart.getPlot();
Code: Select all
DateAxis dateAxisRange = new DateAxis("Time");
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
plot.setRangeAxis(dateAxisRange );
How can I fix this?
I’ll thank in advance for any help
