#110 jfreechart changed


I've added this method in JFreeChart.java:
public void changePlot(Plot newPlot)

This, because, after to create an object of type
JFreeChart, I don't found any way to change the plot
object from one type (xyPlot) to another (catPlot)


  • maurizio

    maurizio - 2006-02-27
  • David Gilbert

    David Gilbert - 2007-01-17
    • assigned_to: nobody --> mungady
  • David Gilbert

    David Gilbert - 2007-01-17

    Logged In: YES
    Originator: NO

    An old one, I know, but...

    I think this is a good idea, but there's more to it than just changing the plot. First, the chart instance is registered as a listener on the existing plot, so you need to deregister it. Then you need to register the chart as a listener on the new plot, otherwise automatic repaints (on the ChartPanel, for instance) will stop working. And then you need to consider the chart's legend(s), which reference the current plot - you could either remove the legend(s), or somehow swap the plot reference from the old plot to the new plot.


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks