PieChart is not rendered when the data are near infinity or zero

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: 8, 9
    • Component/s: javafx

      JDK9b132 + Win. 7

      Please run the following test code:

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Scene;
      import javafx.stage.Stage;
      import javafx.scene.chart.*;
      import javafx.scene.Group;

      public class Test extends Application {

          @Override public void start(Stage stage) {

              Scene scene = new Scene(new Group());
              stage.setWidth(500);
              stage.setHeight(500);

              double A = 0.5 * Double.MAX_VALUE;
              double B = (1 + 1.e-16) * A;

              ObservableList<PieChart.Data> data = FXCollections.observableArrayList(
                  new PieChart.Data("A", A), new PieChart.Data("B", B));

              final PieChart chart = new PieChart(data);
              chart.setTitle("test");

              ((Group) scene.getRoot()).getChildren().add(chart);
              stage.setScene(scene);
              stage.show();
          }

          public static void main(String[] args) { launch(args); }
      }

      => "ok.png"

      Then try to set
          double B = (1 + 1.e-15) * A;
      => "nok.png"

      The reasonable ranges are not seemingly specified in the docs (?).

      The same situation for JDK8 b132, but there is no "A" label in that case.

        1. ok.png
          ok.png
          19 kB
        2. nok.png
          nok.png
          7 kB

            Assignee:
            Unassigned
            Reporter:
            Alexander Stepanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: