Before Update:
After Update:
Code: Select all
/* Global Variables
static IntervalCategoryDataset dataset;
static JFreeChart chart;
static TaskSeriesCollection collection;
*/
static void updateDataset() {
collection.removeAll();
DateFormat format = new SimpleDateFormat("MM dd yyyy", Locale.ENGLISH);
for (int i = 0; i < Demo.people.size(); i++) {
TaskSeries s1 = new TaskSeries(Demo.people.get(i).getName());
s1.add(new Task(Demo.people.get(i).getName(),
new SimpleTimePeriod(java.sql.Date.valueOf(Demo.people.get(i).getStartDate()),
java.sql.Date.valueOf(Demo.people.get(i).getEndDate()))));
collection.add(s1);
}
dataset = collection;
}
When I do collection.getSeriesCount() it returns the proper number of series, in this case 2 but 3 is being displayed and I am not sure why.