Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JFreeChart: how to change XYPlot foreground color?

The JFreeChart XYPlot background color is changed using setBackgroundPaint() but there doesn't seem to be a corresponding setForegroundPaint().

XYPlot plot = (XYPlot) chart.getPlot();
plot.setBackgroundPaint(Color.BLACK);

How is the foreground color (the plot) changed?

like image 460
jacknad Avatar asked Oct 23 '25 17:10

jacknad


1 Answers

eg:

XYItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(0, Color.CYAN);

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!