#366 ChartPanel use buffer white background

General (246)


when you select a color for the background of a JFreeChart,
if your ChartPanel is double buffered and your color is not totally opaque you
have a color darker than the one you have selected.

it's because the image you create for the buffer have a black background.
I think that you should replace that with a white background to have
a good color even with transparency.

It work ok if you don't have a doublebuffered ChartPanel of course.

Thank you for the great work on JFreeChart.




  • David Gilbert

    David Gilbert - 2009-04-10
    • labels: --> General
    • assigned_to: nobody --> mungady
  • David Gilbert

    David Gilbert - 2009-04-10

    Hi Julien,

    What platform do you notice this on? I just looked at it, and I think the right solution is to fill the chartBuffer image with the same color as the ChartPanel returns from getBackground(). But I'm not 100% sure of this. The default background colour is going to be platform / look-and-feel dependent, although I don't think that matters as long as we match it. Any thoughts?

    Dave Gilbert
    JFreeChart Project Leader

  • Julien Blaize

    Julien Blaize - 2009-04-10

    Hi Dave,

    i think your idea to take the panel background is better than mine.
    And if i want a white background i can set the background of the panel to white.

    I use windows 2000 (old one i know).

    Keep up the good work.

  • David Gilbert

    David Gilbert - 2009-05-27
    • status: open --> closed
  • David Gilbert

    David Gilbert - 2009-05-27

    The ChartPanel class has been modified. The change is included in 1.0.13.


Log in to post a comment.