Two Laptop Bag*
The moose likes Other Open Source Projects and the fly likes JFree chart trending line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "JFree chart trending line" Watch "JFree chart trending line" New topic
Author

JFree chart trending line

venkat xyz
Greenhorn

Joined: Oct 02, 2012
Posts: 2
Hi all,

I have requirement like need to show the scatter plot with trend line and need to export graphs into pdf.
now my challenges are
need to show the trending line , can i use the jqplot plugin to integrate with jfreechart.
other wise i have to migrate to jqplot , wants to confirm whether we can extract the jqplots to pdf
can any one guide me , how to approach

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
I'm not familiar with jqplot, but you can easily save JFreeChart charts as images, and use any number of PDF libraries to create PDFs from those.

As to trend lines, you could calculate the points that make the trend line, and ad those as an additional dataset in JFreeChart. That may be easier than to add another library to the mix.


Ping & DNS - updated with new look and Ping home screen widget
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 960
    
  10

JFreeChart has regression lines built in; see RegressionDemo1 .
venkat xyz
Greenhorn

Joined: Oct 02, 2012
Posts: 2
Thanks both of you for your help

@richard Reression seems to suit my requirement
Burt my plot having DateAxis as Domain axis and NumberAxis as range axis .
is it possible to calculate the Regression against above types.
Richard Tookey
Ranch Hand

Joined: Aug 27, 2012
Posts: 960
    
  10

venkat xyz wrote:
Burt my plot having DateAxis as Domain axis and NumberAxis as range axis .
is it possible to calculate the Regression against above types.


I have not used it with domain as a date but you could look at the JFreeChart source code to find out if it copes. If it does not then it is easy enough to do write your own regression calculator. You can model this on the methods of Regression.java in JFreeChart. In general terms, to use regression using dates one just needs to convert the date to a number. A java.util.Date object contains the number of milliseconds since the epoch which may serve your purpose.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFree chart trending line
 
Similar Threads
Help please with complex JUNIT test cases across classes
Help please with complex JUNIT test cases across classes
Icefaces Pdf generation with itext
modified PDF/image to be sent to servlet
Possible to pass multiple queries in JasperReports?