Symbol auf einem JFreeChart XY Plot
-
22-08-2019 - |
Frage
Ich habe ein XY-Diagramm von Positionen und will, dass der neueste Punkt ein Symbol zu sein. Ist das möglich in JFreeChart?
Lösung
Auf einem xy-Plot müssten Sie den Überblick über die letzten xy Punkt hinzugefügt zu halten und fügen Sie dann in etwa wie folgt mit:
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);
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow