#940 StatisticalBarRenderer misalignment

closed-fixed
General (896)
6
2011-10-30
2009-06-22
No

When there is a maxBarWidth setting, the bars get misaligned. See this report in the forum:

http://www.jfree.org/phpBB2/viewtopic.php?f=3&t=28313

Discussion

  • Adriaan Peeters

    Adriaan Peeters - 2011-10-28

    Simple reproducible example. It gets worse the smaller the setMaximumBarWidth parameter is.

    public class ChartExample extends JFrame {

    public static void main(String[] args) {
    ChartFrame demo = new ChartFrame("Test", createChart());
    demo.pack();
    demo.setVisible(true);
    }

    private static StatisticalCategoryDataset createDataset() {
    DefaultStatisticalCategoryDataset dataset = new DefaultStatisticalCategoryDataset();
    dataset.add(1.561, 0.5, "foo", "No");
    //dataset.add(0.640, 0.2, "foo", "Yes");
    //dataset.add(0.9, 0.3, "foo", "Other");
    return dataset;
    }

    private static JFreeChart createChart() {
    final StatisticalBarRenderer renderer = new StatisticalBarRenderer();
    renderer.setMaximumBarWidth(0.15);

    CategoryAxis xAxis = new CategoryAxis("");
    NumberAxis yAxis = new NumberAxis("");

    CategoryPlot plot = new CategoryPlot(createDataset(), xAxis, yAxis, renderer);

    final JFreeChart chart = new JFreeChart(plot);
    return chart;
    }

    }

     
  • Martin Höller

    Martin Höller - 2011-10-28
    • assigned_to: mungady --> matinh
    • status: open --> closed-fixed
     
  • Martin Höller

    Martin Höller - 2011-10-28

    A fix is committed for inclusion in 1.0.14.

     
  • David Gilbert

    David Gilbert - 2011-10-30
    • status: closed-fixed --> open
     
  • David Gilbert

    David Gilbert - 2011-10-30

    Re-opening because the fix doesn't work if the dataset has multiple series.

     
  • David Gilbert

    David Gilbert - 2011-10-30

    I found the problem and fixed it for the 1.0.14 release. The same issue affects the IntervalBarRenderer class and this has also been fixed.

     
  • David Gilbert

    David Gilbert - 2011-10-30
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks