As the number of colors changes, the DrawingSupplier for the chart must use a new array of colors.
Unfortunately, the method plot.setDrawingSupplier(...) does not work: the old array of colors is still used.
The code looks like this:
Code: Select all
ArrayList<Color> newColors = new ArrayList<Color>();
List fileredRowKeys = filteredData.getRowKeys();
for (int i = 0; i < data.getRowCount(); i++) {
// Create an array with all selected rows and new colors
}
// DOES NOT WORK
plot.setDrawingSupplier(new ZDrawingSupplier(newColors.toArray(new Color[0])));
Does anyone have a solution?
Thanks,
Reiner