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.
Asked
Active
Viewed 464 times
1 Answers
3
You might look at JDBCXYDataset
, which can detect a time series based on metadata. As noted in the API, "The first column will be the x-axis and remaining columns y-axis values." Click on the class name to see the corresponding source, for example.
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
}

trashgod
- 203,806
- 29
- 246
- 1,045
-
can I use JDBCXYDataset with hibernate.I am using hibernate framework.Can I use JDBCXYDataset? – user2365917 Jun 06 '13 at 10:20
-
Yes, but you may want to also use it as a guide to writing your own notional `JpaXYDataset`. – trashgod Jun 06 '13 at 10:27
-
what is JPAXYDataset?Is it different from JDBCXYDataset?Which one should i use? – user2365917 Jun 06 '13 at 10:29
-
If you don't want to use `JDBCXYDataset` directly with a JDBC query, `JpaXYDataset` is what you would write to accommodate your JPA query. – trashgod Jun 06 '13 at 10:33
-
if i type JpaXYDataset in google it is not showing me result.From where can I get API for this JpaXYDataset.Please help me – user2365917 Jun 06 '13 at 10:56
-
I don't know of a concrete implementation of such a dataset; more above. – trashgod Jun 06 '13 at 13:06