且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在JFreeChart上使用createCombinedChart()创建多个ScatterPlot图表?

更新时间:2023-10-08 15:24:52

最简单的方法是在实例化相关的StandardXYItemRenderer时指定StandardXYItemRenderer.SHAPES.此示例的以下更改产生以下结果:

The simplest way is to specify StandardXYItemRenderer.SHAPES when instantiating the relevant StandardXYItemRenderer. The following changes to this example produce the result below:

private static void init() {
    XYItemRenderer renderer = new StandardXYItemRenderer(SHAPES);
    …
}

请注意,StandardXYItemRenderer是出于历史原因而保留的,通常,应改为使用XYLineAndShapeRenderer类." 此处.

Note that StandardXYItemRenderer "has been retained for historical reasons and, in general, you should use the XYLineAndShapeRenderer class instead." Comparable constructor parameters and mutators are cited here.

使用任一渲染器,您都可以使用自定义的DrawingSupplier更改系列形状和颜色,如

With either renderer, you can alter the series shapes and colors using a custom DrawingSupplier, as shown here.