I am making price volume chart, and it was working fine, but now my data set is changed and time range is now 09:00 hrs to 16:00 hrs(previously it was 10:00 t0 16:00 hrs).
Now i can't see initial points in my chart means data from 9 to 10, once i get data for 10:00 hrs onwards i can see.
I don't know where i am doing wrong, may be because of my SegmentedTimeline() implementation.
Here is code i am using to make X-Axis(Date time)
Code: Select all
DateAxis dateaxis = new DateAxis("Time");
setTimeFormat(report, dataset[0], dateaxis);
Code: Select all
private static int MILLISECS_PER_DAY = 86400000;
private static void setTimeFormat(Report report, Dataset dataset, DateAxis dateaxis) {
TimeSeriesCollection tscoll = (TimeSeriesCollection) dataset;
double domainRange = tscoll.getDomainUpperBound(false) - tscoll.getDomainLowerBound(false);
int domainDays = (int) (domainRange / MILLISECS_PER_DAY);
if (domainDays < 10) { // One day chart.
dateaxis.setTimeline(tl);
if (domainDays < 3)
dateaxis.setDateFormatOverride(new SimpleDateFormat("HH:mm"));
else {
dateaxis.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 1));
dateaxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE);
dateaxis.setDateFormatOverride(new SimpleDateFormat("MMM-dd"));
}
} else {
dateaxis.setTimeline(default_tl);
}
dateaxis.setLowerMargin(0D);
dateaxis.setUpperMargin(0D);
}
private static SegmentedTimeline initnewFifteenMinuteTimeline() {
SegmentedTimeline tl = new SegmentedTimeline(SegmentedTimeline.FIFTEEN_MINUTE_SEGMENT_SIZE, 24, 72);
tl.setBaseTimeline(SegmentedTimeline.newMondayThroughFridayTimeline());
tl.setStartTime(SegmentedTimeline.firstMondayAfter1900() + 40 * tl.getSegmentSize());
final Calendar cal2 = Calendar.getInstance();
cal2.set(Calendar.HOUR_OF_DAY, 16);
cal2.set(Calendar.MINUTE, 30);
cal2.set(Calendar.SECOND, 0);
cal2.set(Calendar.MILLISECOND, 0);
final Calendar cal = (Calendar) cal2.clone();
cal.add(Calendar.YEAR, -1);
tl.addBaseTimelineExclusions(cal.getTime().getTime(), cal2.getTime().getTime());
return tl;
}
instead of this.