Adding to a Plot

A free public discussion forum for the JFreeChart class library.

Adding to a Plot

Postby andyt » Fri Oct 27, 2006 6:08 pm

Hi,

Just started using JFreeChart.

How to add a line to a ScatterPlot?

I have tried generating the image of the ScatterPlot and using it as background to a XYLineChart.

Maybe I need to follow what ChartFactory is doing and customise.

Thanks for any pointers,

Andy
andyt
 
Posts: 4
Joined: Fri Oct 27, 2006 5:58 pm

Postby david.gilbert » Mon Oct 30, 2006 2:39 pm

If you have the JFreeChart Developer Guide, take a look at RegressionDemo1.java, which adds a regression line to a set of points.

Otherwise, the approach is to add two datasets to the plot, and also two renderers (one an XYLineAndShapeRenderer that displays only shapes, the other an XYLineAndShapeRenderer that displays only lines).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11292
Joined: Fri Mar 14, 2003 10:29 am

Postby andyt » Tue Oct 31, 2006 12:59 pm

Many thanks for the pointer David... It worked for me :)
andyt
 
Posts: 4
Joined: Fri Oct 27, 2006 5:58 pm


Return to JFreeChart - General

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 15 guests