Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8124445

REGRESSION: Bar Chart empty space on axis

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 8
    • 7-pool, 8
    • javafx
    • None

      This is a recent regression, maybe related to CategoryAxis changes. See broken and working screenshots. The Broken is drawn using only about half the X axis width.

      Code to make chart

              final Random RANDOM = new Random(29782198273l);
              String[] years = {"2001","2002","2003"};
              String[] series;
              if (simple) {
                  series = new String[]{"A","B","C"};
              } else {
                  series = new String[]{"A","B","C","D","E","F","G","H"};
              }
              CategoryAxis xAxis = new CategoryAxis(FXCollections.<String>observableArrayList(years));
              NumberAxis yAxis = new NumberAxis();
              yAxis.setLabel("Units Sold");
              ObservableList<BarChart.Series> barChartData = FXCollections.observableArrayList();
              final double negative = -500;
              for (int s=0; s<series.length; s++) {
                  ObservableList<BarChart.Data> sd = FXCollections.observableArrayList();
                  for(int y=0; y<years.length; y++) {
                          sd.add(new BarChart.Data(years[y], negative+(2000*RANDOM.nextDouble())));
                  }
                  barChartData.add(new BarChart.Series(series[s],sd));
              }
              Node barChart = new BarChart(xAxis, yAxis, barChartData);

            psomashe Parvathi Somashekar (Inactive)
            jasper Jasper Potts (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: