changeset 5997:8fef5aaf49f8

RT-34626: AreaChart fills the area above the chart when y axis starts with value bigger than 0
author jgiles
date Wed, 18 Dec 2013 12:36:47 +1300
parents 2d7e3f9f76ec
children 6cb6225e0708
files modules/controls/src/main/java/javafx/scene/chart/AreaChart.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/modules/controls/src/main/java/javafx/scene/chart/AreaChart.java	Wed Dec 18 12:07:01 2013 +1300
+++ b/modules/controls/src/main/java/javafx/scene/chart/AreaChart.java	Wed Dec 18 12:36:47 2013 +1300
@@ -468,7 +468,7 @@
                         getYAxis().toRealValue(getYAxis().toNumericValue(item.getCurrentY()) * seriesYAnimMultiplier.getValue()));
                 if (isFirst) {
                     isFirst = false;
-                    fillPath.getElements().add(new MoveTo(x, getYAxis().getZeroPosition()));
+                    fillPath.getElements().add(new MoveTo(x, getYAxis().getHeight()));
                     seriesLine.getElements().add(new MoveTo(x, y));
                 } else {
                     seriesLine.getElements().add(new LineTo(x, y));
@@ -482,9 +482,9 @@
                 }
             }
             if (fillPath.getElements().size() >= 1) {
-                fillPath.getElements().add(new LineTo(lastX, getYAxis().getZeroPosition()));
+                fillPath.getElements().add(new LineTo(lastX, getYAxis().getHeight()));
             } else {
-                fillPath.getElements().add(new MoveTo(lastX, getYAxis().getZeroPosition()));
+                fillPath.getElements().add(new MoveTo(lastX, getYAxis().getHeight()));
             }
             fillPath.getElements().add(new ClosePath());
         }