BoxAndWhisker bug

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
grzegorz.majer
Posts: 8
Joined: Tue Jul 08, 2003 11:33 am
Location: Poland

BoxAndWhisker bug

Post by grzegorz.majer » Wed Sep 03, 2003 6:13 pm

BoxAndWhisker in BoxAndWhiskerDemo plot works correctly, but values are near 0. The problem is that the plot has incorrect Y scale when I have higher values and when I use

Code: Select all

valueAxis.setAutoRangeIncludesZero(false);
You can check it in BoxAndWhiskerDemo.

Regards,
Grzegorz
Last edited by grzegorz.majer on Wed Sep 03, 2003 7:17 pm, edited 1 time in total.

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 03, 2003 6:39 pm

Are you using 0.9.11 or the latest CVS code? There have been quite a few changes made to the box-and-whisker plots for the next release (0.9.12).
David Gilbert
JFreeChart Project Leader

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

grzegorz.majer
Posts: 8
Joined: Tue Jul 08, 2003 11:33 am
Location: Poland

Post by grzegorz.majer » Wed Sep 03, 2003 7:16 pm

I'm using the latest CVS code.

brownidj
Posts: 34
Joined: Tue Jun 17, 2003 12:07 am
Contact:

Post by brownidj » Sat Sep 06, 2003 7:52 pm

Hi grzegorz.majer

I'm just back from a vacation, so I will look at the problem in the next day or so. Please send me a sample of the values you used.

David B

grzegorz.majer
Posts: 8
Joined: Tue Jul 08, 2003 11:33 am
Location: Poland

Post by grzegorz.majer » Mon Sep 08, 2003 1:10 pm

I've got the latest version from CVS and it works correctly.

Thanks for your help.

Regards,
Grzegorz
Last edited by grzegorz.majer on Sun Jan 18, 2004 2:17 am, edited 1 time in total.

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 » Mon Sep 08, 2003 3:13 pm

Thanks for confirming this.
David Gilbert
JFreeChart Project Leader

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

Guest

Post by Guest » Thu Sep 11, 2003 6:43 pm

In BoxAndWhiskerRenderer.java is:

Code: Select all

   public void drawVerticalItem(Graphics2D g2, 
                                 Rectangle2D dataArea,
                                 CategoryPlot plot, 
                                 CategoryAxis domainAxis, 
                                 ValueAxis rangeAxis,
                                 CategoryDataset dataset, 
                                 int row, 
                                 int column) {

        BoxAndWhiskerCategoryDataset bawDataset = (DefaultBoxAndWhiskerCategoryDataset) dataset;
but should be

Code: Select all

        BoxAndWhiskerCategoryDataset bawDataset = (BoxAndWhiskerCategoryDataset) dataset;
Regards,
Grzegorz

grzegorz.majer
Posts: 8
Joined: Tue Jul 08, 2003 11:33 am
Location: Poland

Post by grzegorz.majer » Thu Sep 11, 2003 8:37 pm

I've found a new problem. When there is only one series a BoxAndWhiskerRenderer draws chart which looks like this:

Image
Last edited by grzegorz.majer on Sun Jan 18, 2004 2:12 am, edited 1 time in total.

brownidj
Posts: 34
Joined: Tue Jun 17, 2003 12:07 am
Contact:

Single series width bug

Post by brownidj » Thu Sep 11, 2003 11:56 pm

Many thanks for your helpful remarks.

Yes, there was originally some overly complex code to allow the width of the box to be limited. The width of the box also determines the with of the other components.

The actual bug was in fact that the setBoxWidth method was not working.

I have fixed it by changing the followning code in BoxAndWhiskerRenderer:

public void initialise(Graphics2D g2,
Rectangle2D dataArea,
CategoryPlot plot,
Integer index,
ChartRenderingInfo info) {

super.initialise(g2, dataArea, plot, index, info);

ValueAxis rangeAxis = getRangeAxis(plot, index);

// calculate the box width
CategoryAxis domainAxis = getDomainAxis(plot, index);

CategoryDataset dataset = getDataset(plot, index);
if (dataset != null && this.getBoxWidth() == 0.0) {

If you cut and paste don't forget to remove the color tags (;

You can then use the setBoxWidth method, eg:

BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
renderer.setBoxWidth(8.0);



David

grzegorz.majer
Posts: 8
Joined: Tue Jul 08, 2003 11:33 am
Location: Poland

Post by grzegorz.majer » Fri Sep 12, 2003 10:42 am

Thanks for your help.

Regards
Grzegorz

huijiel99

Another problem in BoxAndWhisker

Post by huijiel99 » Tue Sep 16, 2003 12:26 am

The Category title at x-axis and the bar do not lineup well. For a single series, while the bar (data series) is to the left of the chart but the title for the bar is in the middle of the x-axis. I wish I could put the chart here, but I couldn't paste it. Is there a fix for this?

Thanks.[/img]

Guest

Post by Guest » Tue Sep 16, 2003 1:23 pm

The Category title at x-axis and the bar do not lineup well. For a single series, while the bar (data series) is to the left of the chart but the title for the bar is in the middle of the x-axis. I wish I could put the chart here, but I couldn't paste it. Is there a fix for this?
Yes. I've noted this, but as yet I don't have a fix. I will work on it over the next few days.

David B

Guest

BoxAndWhisker Display Bug

Post by Guest » Wed Sep 24, 2003 10:16 pm

The Category title at x-axis and the bar do not lineup well. For a single series, while the bar (data series) is to the left of the chart but the title for the bar is in the middle of the x-axis. I wish I could put the chart here, but I couldn't paste it. Is there a fix for this?


Yes. I've noted this, but as yet I don't have a fix. I will work on it over the next few days.

David B
David,

Did you get a chance to take a look at this bug? If you do not time, could you please point out where I should look at if I want to modify the code myself?

Thank you very much!
Huijie

Guest

Post by Guest » Wed Sep 24, 2003 11:55 pm

I suspect the problem is not actually in the code I wrote, so I can't simply point you in the correct direction. I will try to look at it tonight (about 12 hours time) - if I don't succeed, I will post a reply telling where I looked.

Sorry for the delay.

David B

Locked