setDrawingSupplier does not work

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rpitting
Posts: 3
Joined: Mon Oct 22, 2007 2:49 pm

setDrawingSupplier does not work

Post by rpitting » Tue Feb 05, 2008 12:23 am

I am using a line chart where you can select hide and unhide values (and with that colored lines in the chart) by setting the corresponding checkboxes.

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])));
I tried JFreeChart 1.06 and 1.09, both with the same issue.

Does anyone have a solution?

Thanks,


Reiner

Locked