我尝试了JFreeChart - horizontal stacked bar chart with date axis中的代码
private CategoryDataset createDataset() {
.....
// if data event time is in the range of the chart then show it
// THIS DOES NOT WORK PROPERLY!!!!
if (eventTime >= chartStartDate.getTime() && eventTime < chartEndDate.getTime()) {
// create series and categories
if (es.getStatus() == STANDBY_SERIES_INDEX) {
dataset.addValue(new Double(es.getTime()), STANDBY_SERIES, es.getName());
} else if (es.getStatus() == HEATING_SERIES_INDEX) {
dataset.addValue(new Double(es.getTime()), HEATING_SERIES, es.getName());
} else if (es.getStatus() == HOLDING_SERIES_INDEX) {
dataset.addValue(new Double(es.getTime()), HOLDING_SERIES, es.getName());
} else if (es.getStatus() == COOLING_SERIES_INDEX) {
dataset.addValue(new Double(es.getTime()), COOLING_SERIES, es.getName());
} else if (es.getStatus() == LOWERING_SERIES_INDEX) {
dataset.addValue(new Double(es.getTime()), LOWERING_SERIES, es.getName());
} else {
dataset.addValue(chartRange.getUpperBound() - chartRange.getLowerBound(), STANDBY_SERIES, es.getName());
}
} else {
continue;
}
}
}
}
} else {
plot.setNoDataMessage("NO DATA AVAILABLE");
}
return dataset;
}
请帮助我如何获取