3DBar colors

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Jeffh
Posts: 13
Joined: Thu Oct 09, 2003 9:47 am

3DBar colors

Post by Jeffh » Thu Nov 13, 2003 11:43 am

When i use setSeriesPaint(0, new Color(255,0,0,128) to set the transparency of a color on a BarRenderer3D, it correctly shows the
transparency for the "front" panel of the bar, but the side and top are
still an alpha 1.0. Is this a bug, or are these drawn from a different
value?

Jeff

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 » Fri Nov 14, 2003 10:34 am

It is this code in the BarRenderer3D class that causes the problem:

Code: Select all

if (itemPaint instanceof Color) {
    g2.setPaint(((Color) itemPaint).darker());
}
If you comment it out, the problem goes away. I don't know if losing the transparency is a bug in the darker() method, or a feature.
David Gilbert
JFreeChart Project Leader

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

Jeffh
Posts: 13
Joined: Thu Oct 09, 2003 9:47 am

Post by Jeffh » Fri Nov 14, 2003 10:40 am

Thanks for the reply, that worked great.

Jeff

Locked