我正在为我的绘图添加注释,但我不知道如何更改它的颜色或线宽(描边)。我已经尽我所能阅读了文档,但我没有想法。谁能帮忙?
Shape shape = new Ellipse2D.Double(circleXValue - radius, circleYValue - radius, radius + radius, radius + radius);
XYShapeAnnotation annotation = new XYShapeAnnotation(shape);
// ??
plot.addAnnotation(annotation);
最佳答案
您正在使用这个 constructor :
public XYShapeAnnotation(java.awt.Shape shape)
您可能想使用 these constructors 之一指定附加参数:
public XYShapeAnnotation(
java.awt.Shape shape,
java.awt.Stroke stroke,
java.awt.Paint outlinePaint)
public XYShapeAnnotation(
java.awt.Shape shape,
java.awt.Stroke stroke,
java.awt.Paint outlinePaint,
java.awt.Paint fillPaint)
关于java - 在 JFreeChart 中更改注释的颜色和线宽,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11748533/