Drawing Line chart in Java [closed]

走远了吗. 提交于 2019-11-27 08:40:19

问题


I want to draw a graph on each point of which there will be a button. When I will click the button, it will do something. Here's a link; I want my graph to look like this. Can anybody suggest me how to do it?


回答1:


Using JFreeChart, add a ChartMouseListener to your ChartPanel, as outlined here. In your implementation of chartMouseClicked() invoke Desktop#browse(), as illustrated here. In outline,

chartPanel.addChartMouseListener(new ChartMouseListener() {

    public void chartMouseClicked(ChartMouseEvent e) {
        // construct a URI based the result from e.getEntity()
        desktop.browse(uri);
    }

    public void chartMouseMoved(ChartMouseEvent e) {}

});


来源:https://stackoverflow.com/questions/29192514/drawing-line-chart-in-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!