layer chart -------modify

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
James.Cheng
Posts: 42
Joined: Fri Dec 02, 2005 9:43 pm
Location: China

layer chart -------modify

Post by James.Cheng » Thu Dec 08, 2005 6:36 pm

center
Image

not center

Image

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 Dec 09, 2005 10:17 am

To be honest, I don't see the value of the LayeredBarRenderer at all (relative to a "plain" bar chart), but comments from others are welcome.
David Gilbert
JFreeChart Project Leader

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

muentzer
Posts: 5
Joined: Tue Sep 14, 2004 3:42 pm

Post by muentzer » Fri Dec 09, 2005 12:21 pm

It might be mere eye candy, but I like the look of the not centered LayeredBarRenderer.

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 Dec 09, 2005 12:48 pm

I agree that the modified version looks better, for sure.
David Gilbert
JFreeChart Project Leader

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

James.Cheng
Posts: 42
Joined: Fri Dec 02, 2005 9:43 pm
Location: China

haha

Post by James.Cheng » Fri Dec 09, 2005 2:54 pm

david.gilbert wrote:To be honest, I don't see the value of the LayeredBarRenderer at all (relative to a "plain" bar chart), but comments from others are welcome.
this really layerchart

but I modify your LayeredBarRenderer.java,add a flag center control is or not center.

Code: Select all

public LayeredBarRenderer(boolean center) {
        super();
        this.center=center;
        this.seriesBarWidthList = new ObjectList();
    }
and modify your funtion drawVerticalItem

Code: Select all

        if(center)
        {
          bar = new Rectangle2D.Double(
              (rectX + ( (seriesCount - 1 - row) * shift)), rectY,
              (rectWidth - (seriesCount - 1 - row) * shift * 2), rectHeight);
        }else
        {
          bar = new Rectangle2D.Double(
              (rectX - ( (seriesCount - 1 - row) * shift)), rectY,
              (rectWidth - (seriesCount - 1 - row) * shift), rectHeight);
        }
can you trust?

Now I can Modify Jfreechart code to satisfy my use, can you Trust?
and I understand your code and structure. haha

James.Cheng
Posts: 42
Joined: Fri Dec 02, 2005 9:43 pm
Location: China

Post by James.Cheng » Fri Dec 09, 2005 3:06 pm

Now I add OverlapBarRenderer.java refect this modify

Locked