2013-04-16 89 views

回答

4

您可以通過XYItemRenderer.setSeriesShape實現這一目標。請參考DefaultDrawingSupplier .createStandardSeriesShapes()的工作原理。

XYItemRenderer renderer = xyPlot.getRenderer(); 
    renderer.setSeriesPaint(0, Color.blue); 
    double size = 20.0; 
    double delta = size/2.0; 
    Shape shape1 = new Rectangle2D.Double(-delta, -delta, size, size); 
    Shape shape2 = new Ellipse2D.Double(-delta, -delta, size, size); 
    renderer.setSeriesShape(0, shape1); 
    renderer.setSeriesShape(1, shape2); 

參考:JFreeChart: Increase Size of Data Point

+0

參見這個相關[示例](http://stackoverflow.com/a/6669529/230513)。 – trashgod