I need a area chart that can stylize the chart fill in a different color (red, e.g.) when this be negative.
How to do it in JavaFX?
I need a area chart that can stylize the chart fill in a different color (red, e.g.) when this be negative.
How to do it in JavaFX?
I think the easiest way to achieve this is to create two XYCHartSeries
for your Chart.
One for the negative values and one for the positives. Then you can set the color of the ChartSeries with CSS like this:
positiveChart.setId("positiveValues");
positiveChart.setStyle("#positiveValues {-fx-bar-fill: #4CAF50 }");