}
}
private void addDataToLineChart(ChartEvent event, Wink lastSimTime, ParCollection params) {
// Line Chart.
XYSeriesCollection dataset = this.lineDataSet.get(event.getChartName());
XYItemRenderer renderer;
XYPlot plot;
if (dataset == null) {
NumberAxis domain = new NumberAxis(event.getxAxisLabel());
NumberAxis range = new NumberAxis(event.getyAxisLabel());
if (event.isDrawSmoothSplinesInLineCharts()) {
renderer = new XYSplineRenderer();
} else {
renderer = new XYLineAndShapeRenderer(event.isDrawLinesInLineCharts(), event.isDrawSymbolsInLineCharts());
}
dataset = new XYSeriesCollection();
plot = new XYPlot(dataset, domain, range, renderer);
domain.setAutoRange(true);
domain.setLowerBound(lastSimTime.getCurrentTime());
domain.setTickLabelsVisible(true);
range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
JFreeChart chart = new JFreeChart(
event.getChartName(),
new Font("SansSerif", Font.BOLD, 24),
plot,
true);
createFrame(event.getChartName(), event.getChartType(), params, chart);
this.lineDataSet.put(event.getChartName(), dataset);
this.chartList.put(event.getChartName(), chart);
} else {
plot = chartList.get(event.getChartName()).getXYPlot();
}
XYSeries series;
int foundSeriesNum = this.containsSeriesLinechart(dataset.getSeries(), event.getSeriesName());
if (foundSeriesNum < 0) {
dataset.addSeries(new XYSeries(event.getSeriesName()));
foundSeriesNum = this.containsSeriesLinechart(dataset.getSeries(), event.getSeriesName());
}
if (event.getLineStroke() != null) {
plot.getRenderer().setSeriesStroke(foundSeriesNum, event.getLineStroke());
}
if (event.getLineColor() != null) {
plot.getRenderer().setSeriesPaint(foundSeriesNum, event.getLineColor());
}
plot.getDomainAxis().setUpperBound(lastSimTime.getCurrentTime());
series = dataset.getSeries(event.getSeriesName());
if (event.getXValue() == ChartEvent.X_VALUE_NOT_SPECIFIED) {
series.add(new XYDataItem(lastSimTime.getCurrentTime(), event.getValue()));
} else {
series.add(new XYDataItem(event.getXValue(), event.getValue()));