CandlestickRenderer - volume layout

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ted
Posts: 4
Joined: Mon Mar 29, 2004 2:12 pm

CandlestickRenderer - volume layout

Post by Ted » Tue Aug 10, 2004 11:13 am

I am using the CandlestickRenderer for displaying financial data. So far, everything is fine. However, I didn't like that the volume drawn is always using the full height of the plot, so I copied the renderer into my project and modified draw() to use only a percentage of the available plot height. It would be nice if this could be customizable.

While modifying the renderer, I noticed in the draw() method the following code part. It seems to me that the different positions of the g2.fill() may be a bug, but I don't really understand graphics programming :-( Just wanted to let you know.

Thanks for a great piece of software!
Ted

Code: Select all

        if (yClose.doubleValue() > yOpen.doubleValue()) {
            if (this.upPaint != null) {
                g2.setPaint(this.upPaint);
                g2.fill(body);
            }
        } else {
            if (this.downPaint != null) {
                g2.setPaint(this.downPaint);
            }
            g2.fill(body);
        }

Locked