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

Style class "negative" is not always added for new BarChart data with negative value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • jfx24
    • jfx22
    • javafx
    • None
    • b05

      Adding a data item with a negative value to a `Series` that is already part of a `BarChart` does not add the "negative" style class to the bar.

      I'd expect this to be added according to the CSS spec at https://openjfx.io/javadoc/22/javafx.graphics/javafx/scene/doc-files/cssref.html
      in section "BarChart".

      Specifically, this test fails when added to BarChartTest.java:

      @Test
      public void testNegativeStyleIsAddedToNewData() {
      startApp();
      Series<String, Number> series = bc.getData().getFirst();
      series.getData().addFirst(new XYChart.Data<>("1", -1));
      pulse();
      Node bar = series.getData().getFirst().getNode();
      checkStyleClass(bar, "negative");
      }

            mmack Markus Mack
            mmack Markus Mack
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: