I'm setting the foreground alpha on a jFreeChart and I'd like the color to match the legend symbol. It is possible to also set the Foreground Alpha on the legend symbol as well?
Code to set the plot alpha:
XYPlot plot = chart.getXYPlot();
plot.setForegroundAlpha(0.6f);
Both the plot and legend get colors from the plot's DrawingSupplier
. To ensure that plot and legend stay synchronized, this example supplies red, green and blue hues each having 50% alpha.
Paint[] paintArray = {
new Color(0x80ff0000, true),
new Color(0x8000ff00, true),
new Color(0x800000ff, true)
};
plot.setDrawingSupplier(new DefaultDrawingSupplier(
paintArray, …));
Note the subtle difference from having a light gray background in the plot but not the legend.