如何在JFreeChart中更改一个磅值/颜色并显示标签?通过这个ChartMouseListener
,我可以让用户选择女巫点,我想要设置特殊风格的点,如更大或改变颜色等。请帮我如何做到这一点。
chartPanel.addChartMouseListener(new ChartMouseListener() {
@Override
public void chartMouseMoved(ChartMouseEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void chartMouseClicked(ChartMouseEvent arg0) {
// TODO Auto-generated method stub
JFreeChart chart = arg0.getChart();
if (chart == null)
return;
XYItemEntity ce = (XYItemEntity) arg0.getEntity();
if (ce == null)
return;
IntervalXYDataset my = (IntervalXYDataset) ce.getDataset();
int sindex = ce.getSeriesIndex();
int iindex = ce.getItem();
//i want make change the selectted point in here. how to do this
System.out.println("x = " + my.getXValue(sindex, iindex));
System.out.println("y = " + my.getYValue(sindex, iindex));
}
});