diff -r cefe52608b67 javafx-ui-charts/src/javafx/scene/chart/BarChart.java --- a/javafx-ui-charts/src/javafx/scene/chart/BarChart.java Tue Jul 10 20:22:00 2012 -0400 +++ b/javafx-ui-charts/src/javafx/scene/chart/BarChart.java Wed Jul 11 16:50:59 2012 -0700 @@ -256,7 +256,9 @@ item.getNode().getStyleClass().add("negative"); } else if (currentVal < 0 && barVal > 0) { // going from negative to positive // remove style class negative - item.getNode().getStyleClass().add("negative"); + // RT-21164 upside down bars: was adding "negative" styleclass + // instead of removing it; when going from negative to positive + item.getNode().getStyleClass().remove("negative"); } } @@ -314,6 +316,12 @@ if (shouldAnimate()) { animateDataAdd(item, bar); } else { + // RT-21164 check if bar value is negative to add "negative" style class + double barVal = (orientation == Orientation.VERTICAL) ? ((Number)item.getYValue()).doubleValue() : + ((Number)item.getXValue()).doubleValue(); + if (barVal < 0) { + bar.getStyleClass().add("negative"); + } getPlotChildren().add(bar); } }