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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • jfx24
    • Affects Version/s: jfx22
    • Component/s: 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");
      }

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

              Created:
              Updated:
              Resolved: