我如何在 Java 中实现 XYLine jfreechart [英] how can I implement a XYLine jfreechart in java

查看:33
本文介绍了我如何在 Java 中实现 XYLine jfreechart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 jfreechart 的新手.我想根据我的数据库表中的值显示图表表是带有文件 dns_lookup_time,update_time 的 dns_time.我想要 x 轴上的 update_time 和 y 轴上的 dns_lookup_time.曲线应该根据数据库中的值显示.我正在使用 hibernate 和 postgresql.谁能帮我实现这一点.谢谢.

I am new to jfreechart.I want to display a chart based on values from my data base table Table is dns_time with fileds dns_lookup_time,update_time. I want update_time on x-axis and dns_lookup_time on y-axis.And the curve should be displayed according to the values from the database.I am using hibernate and postgresql.Can any one help me how to achieve this.Thank you.

推荐答案

你可以看看 JDBCXYDataset,可以根据元数据检测时间序列.如 API 中所述,第一列将是 x 轴,其余列将是 y 轴值."点击类名查看对应的源码,对于示例.

附录:如果您不想将 JDBCXYDataset 直接与 JDBC 查询一起使用,它可能是有关如何扩展 AbstractXYDataset 以创建基于数据集的有用概述在相应的 JPA 查询上.

Addendum: If you don't want to use JDBCXYDataset directly with a JDBC query, it may be a useful outline of how to extend AbstractXYDataset to create a dataset based on a corresponding JPA query.

class JpaXYDtaset extends AbstractXYDataset {
    // implement required methods using JPA query results
}

这篇关于我如何在 Java 中实现 XYLine jfreechart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆