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

cannot make Horizontal StackedBarChart

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: fx2.1
    • Fix Version/s: 8
    • Component/s: javafx
    • Environment:

      Java7 u4 / FX2.1

      Description

      Series 2 (and after it) is not displayed correctly on Horizontal StackedBarChart.

      String austria = "Austria";
      String brazil = "Brazil";
      String france = "France";
      String italy = "Italy";
      String usa = "USA";
      NumberAxis xAxis = new NumberAxis();
      CategoryAxis yAxis = new CategoryAxis();
      StackedBarChart<Number,String> bc = new StackedBarChart<>(xAxis,yAxis);
      bc.setTitle("Country Summary");
      xAxis.setLabel("Value");
      xAxis.setTickLabelRotation(90);
      yAxis.setLabel("Country");
      yAxis.setCategories(FXCollections.observableArrayList(austria, brazil, france, italy, usa));
       
      XYChart.Series series1 = new XYChart.Series();
      series1.setName("2003");
      series1.getData().add(new XYChart.Data(25601.34, austria));
      series1.getData().add(new XYChart.Data(20148.82, brazil));
      series1.getData().add(new XYChart.Data(10000, france));
      series1.getData().add(new XYChart.Data(35407.15, italy));
      series1.getData().add(new XYChart.Data(12000, usa));

      XYChart.Series series2 = new XYChart.Series();
      series2.setName("2004");
      series2.getData().add(new XYChart.Data(57401.85, austria));
      series2.getData().add(new XYChart.Data(41941.19, brazil));
      series2.getData().add(new XYChart.Data(45263.37, france));
      series2.getData().add(new XYChart.Data(117320.16, italy));
      series2.getData().add(new XYChart.Data(14845.27, usa));

      bc.getData().addAll(series1, series2);
      primaryStage.setScene(new Scene(bc, 300, 400));
      primaryStage.show();

        Attachments

          Activity

            People

            Assignee:
            psomashe Parvathi Somashekar (Inactive)
            Reporter:
            kitsunesajfx kitsunesaki (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: