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

PieChart with rollover has picking issues

    XMLWordPrintable

Details

    Description

      There are issues that when you add a rollover/hover effect to PieChart items then sometimes the wrong slice is picked. If you launch the attached example and move the cursor to approx (150, 200), it will report you are hovering E, although the mouse is over D. This behavior can also be seen in the 'Drilldown Pie chart' example in JavaFX Ensemble when hovering the C area.

      This is caused because pie slices are Region nodes and Region has pickOnBounds set to true by default. This needs to be set to false for Pie slices.

      Proposed fix:

      diff -r cce23876f3c4 javafx-ui-charts/src/javafx/scene/chart/PieChart.java
      --- a/javafx-ui-charts/src/javafx/scene/chart/PieChart.java Tue Jun 19 23:13:03 2012 -0700
      +++ b/javafx-ui-charts/src/javafx/scene/chart/PieChart.java Tue Jun 26 16:47:03 2012 -0700
      @@ -335,6 +335,7 @@
               // check if symbol has already been created
               if (arcRegion == null) {
                   arcRegion = new Region();
      + arcRegion.setPickOnBounds(false);
                   item.setNode(arcRegion);
               }
               // Note: not sure if we want to add or check, ie be more careful and efficient here

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            jasper Jasper Potts (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: