gpt4 book ai didi

java - JFreeChart XY 图上的图标

转载 作者:搜寻专家 更新时间:2023-11-01 02:18:43 25 4
gpt4 key购买 nike

我有一个位置的 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);

关于java - JFreeChart XY 图上的图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/528827/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com