2009-02-09 66 views

回答

6

在xy圖,你會需要跟蹤的最後一個XY點的添加,然後使用類似下面的添加:

double x = 150; 
double y = 300; 
XYPlot plot = chart.getXYPlot(); 
ImageIcon imageIcon = new ImageIcon("/path/to/your/icon.png"); 
XYAnnotation xyannotation = new XYImageAnnotation(x, y, imageIcon.getImage()); 
plot.addAnnotation(xyannotation); 
+0

有沒有一種方法來關閉批註偏移? – ShawnD 2009-02-09 17:49:03