JFreeChart:如何更改XYPlot前景色? [英] JFreeChart: how to change XYPlot foreground color?

查看:173
本文介绍了JFreeChart:如何更改XYPlot前景色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 setBackgroundPaint()更改JFreeChart XYPlot背景颜色,但似乎没有相应的 setForegroundPaint()

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?

推荐答案

例如:

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

这篇关于JFreeChart:如何更改XYPlot前景色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆