I tried to show two axis on Gantt Chart. One is date, and the other is date elapse. However, I couldn't get correct date elapse. I only got one negative point. I debugged RelativeDateFormat code, and found that the currentMillis in the format method of RelativeDateFormat was always 0:
Code: Select all
public StringBuffer format(Date date, StringBuffer toAppendTo,
FieldPosition fieldPosition) {
long currentMillis = date.getTime();
long elapsed = currentMillis - this.baseMillis;
Code: Select all
DateAxis dateAxis2 = new DateAxis();
dateAxis2.setVisible(true);
ganttPlot.setRangeAxis(2, dateAxis2);
ganttPlot.setRangeAxisLocation(2, AxisLocation.TOP_OR_LEFT);
Minute minute = new Minute(0, 9, 1, 10, 2001);
DateAxis dateAxis1 = new DateAxis();
dateAxis1.setVisible(true);
//dateAxis1.setFixedAutoRange(1);
//dateAxis1.setTickUnit(new DateTickUnit(DateTickUnit.DAY, 7));
RelativeDateFormat rdf = new RelativeDateFormat(minute.getFirstMillisecond());
//relativedateformat.setSecondFormatter(new DecimalFormat("00"));
dateAxis1.setDateFormatOverride(rdf);
ganttPlot.setRangeAxis(1, dateAxis1);
ganttPlot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);