我有一个XY位置图,希望最新的点是一个图标。这在JFreeChart中可能吗?
在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);