outline color for bar charts not working with alpha value

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
hank
Posts: 31
Joined: Mon May 12, 2003 10:02 am
Location: Lake of Constance, Germany

outline color for bar charts not working with alpha value

Post by hank » Wed Sep 01, 2004 1:38 pm

Hi,

Setting the colors using an alpha for a Bar Chart works like:

Code: Select all

      XYBarRenderer renderer = new XYBarRenderer();

      final int alpha = 192; // is like 0.75f
      renderer.setSeriesPaint(0, new Color(0, 255, 0, alpha)); // green
      renderer.setSeriesPaint(1, new Color(255, 255, 0, alpha)); // yellow

      plot.setDataset(series, newTs);
      plot.setRenderer(series, renderer);
But setting the outline for this bar using

Code: Select all

      renderer.setSeriesOutlinePaint(0, new Color(0, 255, 0, alpha)); // green
      renderer.setSeriesOutlinePaint(1, new Color(255, 255, 0, alpha)); // yellow
won't work. I tried

Code: Select all

      for (int seriesCount = 0 ; seriesCount < newTs.getSeriesCount(); seriesCount++) {
         renderer.setSeriesOutlinePaint(seriesCount, renderer.getSeriesPaint(seriesCount));
      } // -- for

as well, but without success.

Using Colors without alpha, it's working as expected.

This happens on Release 0.9.20

What I basicly want is the outline to disappear, but using

Code: Select all

      renderer.setOutlinePaint(null);
      renderer.setOutlineStroke(null);
is also not working.

Where am I wrong, or how can I get the result that I want.

Thanks and cheers

Heinrich

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Sep 01, 2004 4:07 pm

The setSeriesOutlinePaint() method works OK for me. What platform/JDK version are you using? This renderer does need a flag to control whether or not the outlines should be drawn though - I'll add that for the next release.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

hank
Posts: 31
Joined: Mon May 12, 2003 10:02 am
Location: Lake of Constance, Germany

Post by hank » Wed Sep 01, 2004 4:43 pm

The flag approach sounds good.
When do you plan to release?

I'm using jdk 1.4.2_05 running on gentoo Linux.

Heinrich

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Sep 01, 2004 5:12 pm

hank wrote:The flag approach sounds good.
When do you plan to release?
I hope within the next week.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked