Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/325.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java JFreeChart XYLineChart将节点形状自定义为环形_Java_Jfreechart_Shapes - Fatal编程技术网

Java JFreeChart XYLineChart将节点形状自定义为环形

Java JFreeChart XYLineChart将节点形状自定义为环形,java,jfreechart,shapes,Java,Jfreechart,Shapes,我有一个XYLineChart,我想将节点的形状自定义为环形 像这样: 下面是我如何尝试执行此操作的代码: Ellipse2D bigCircle = new Ellipse2D.Double(-4, -4, 8, 8); Ellipse2D smallCircle = new Ellipse2D.Double(-2,-2,4,4); Area ring = new Area(bigCircle); ring.subtract(new Area(smallCircle)); Shape r

我有一个XYLineChart,我想将节点的形状自定义为环形

像这样:

下面是我如何尝试执行此操作的代码:

Ellipse2D bigCircle = new Ellipse2D.Double(-4, -4, 8, 8);
Ellipse2D smallCircle = new Ellipse2D.Double(-2,-2,4,4);

Area ring = new Area(bigCircle);
ring.subtract(new Area(smallCircle));

Shape ringShape = (Shape)ring;

renderer.setSeriesShape(0, ringShape);
但结果与左图类似。它是这样的
renderer.setSeriesShape(0,大圆圈)

我做错了什么


是否存在包含我的形状的工厂?

我的代码很好,但问题出在第行。@samabcde是怎么说的

我做了一个更大的戒指,看看到底是什么


看起来你的形状很好,绿色是因为线条。如果你不介意的话,可以看看戒指的内部是白色而不是白色transparent@samabcde是的,你说得对。我的代码很好,但问题在于行。我换成了更大的戒指,这才是真正的问题:。