I am relatively new to JFreeChart...
I am using a DefaultCategoryDataset to populate my graph.
So I created a Comparable for Dates that is:
Code: Select all
private class ComparableFormattedDate implements Comparable<ComparableFormattedDate> {
private Date date;
public ComparableFormattedDate(Date date) {
this.date = date;
}
@Override
public String toString() {
return getFormattedDate(date);
}
public int compareTo(ComparableFormattedDate o) {
int res = date.compareTo(o.date);
System.err.println(String.format("Comparing date %s to %s and got: %d", getFormattedDate(date), getFormattedDate(o.date), res));
return res;
}
}
Internally it must be using the == instead of my compareTo method cause if I put the same comparable Objects, it seems to work.
I believe this is a bug, can somebody comment on this?
Thanks in advance