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

REGRESSION: Bar Chart empty space on axis

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 7-pool, 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
      None

      Description

      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);

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Due:
                Created:
                Updated:
                Resolved:
                Imported: