#1123 Wrong legend displayed

1.0.x
closed
David Gilbert
legend (1)
5
2014-03-10
2014-02-26
H. von Bargen
No

JFreeChart 1.0.17 displays wrong legend, whereas the legend was correct with version 1.0.10.

In a chart with 6 series [called with plot.setRenderer(a) for the first series and plot.setRenderer(1, b); ... plot.setRenderer(5, f)], the legends displayed are wrong:
Should be: a, b, c, d, e, f
But is: a, b, c, d, c, b

This did not happen with 1.0.10.

I've got a self-contained test-case, but it is quite complicated and closed source, thus I cannot attach it to this bug.

Note: I

Discussion

  • David Gilbert
    David Gilbert
    2014-02-27

    Check that you are not reusing the same renderer for more than one dataset. If you can attach a demo showing the problem, it will help to trace the bug.

     
  • H. von Bargen
    H. von Bargen
    2014-02-27

    Testing with different versions of JFreeChart, I found out that this was bug introduced with 1.0.14.

    I'll try to understand what you mean (I'm not familier with JFreeChart, just maintaining code written by someone else).

    I could send you a test-case by PM, not here. The code is quite complex, so I think it's practically impossible to reduce it to a simple demo.

     
  • H. von Bargen
    H. von Bargen
    2014-02-27

    Thanks, using a separate Renderer for each DataSet did the trick.

     
  • David Gilbert
    David Gilbert
    2014-03-10

    For the upcoming 1.0.18 release, I have updated the Javadocs for the setRenderer() methods to mention that each dataset should have its own renderer. Closing this issue.

     
  • David Gilbert
    David Gilbert
    2014-03-10

    • status: open --> closed
    • assigned_to: David Gilbert
     
  • David Gilbert
    David Gilbert
    2014-03-10

    Closing. Thanks for raising the issue.