JFreeChart: how to change the foreground color of XYPlot?

The background color of the JFreeChart XYPlot changes with setBackgroundPaint(), but there seems to be no matching one setForegroundPaint().

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

How has the foreground color (chart) changed?

+3
source share
1 answer

eg:

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

Source: https://habr.com/ru/post/1772114/


All Articles