// Update series with new points
detailChartSeries.setSeriesPoints(detailPoints);
detailChart.addSeries(detailChartSeries);
detailChart.refresh();
// Update plotbands
DateTimeAxis masterDateTimeAxis = (DateTimeAxis) masterChart
.getConfig().getXAxes().iterator().next();
masterDateTimeAxis.removePlotBand("mask-before");
DateTimePlotBand plotBandBefore = new DateTimePlotBand(
"mask-before");
plotBandBefore.setRange(new DateTimeRange(masterChartMinDate,
new Date((long) min)));
plotBandBefore.setColor(new RGBA(0, 0, 0, 0.2f));
masterDateTimeAxis.addPlotBand(plotBandBefore);
masterDateTimeAxis.removePlotBand("mask-after");
DateTimePlotBand plotBandAfter = new DateTimePlotBand(
"mask-after");
plotBandAfter.setRange(new DateTimeRange(new Date((long) max),
masterChartMaxDate));
plotBandAfter.setColor(new RGBA(0, 0, 0, 0.2f));
masterDateTimeAxis.addPlotBand(plotBandAfter);
masterChart.refresh();
}
});
// Add master
addChart(masterChart, false, false, false, false);