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

LineChart path incorrect when outside lower bound

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      JavaFX ver. 17.0.2, tested on Windows and macOS (pretty sure this occurs in Linux too), OpenJFX + OpenJDK (17.0.2 as well)

      A DESCRIPTION OF THE PROBLEM :
      I have created navigation in LineChart using lower and upper bound properties. I have drawn a step chart and when most left point goes out of chart bound chart is displaying weirdly. It is like point connects to pre-previous point instead of previous one that went out of bound. I can confirm that data property which contains points doesn't modified while that.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Draw a step chat
      e.g. something like this

      ___┌┐__ ___
                     └┘
      2. Increase lower bound of X NumberAxis so that some left-side points go out of bound
      3. You will see something like this on bound instead of straight lines

      a bound
      ^
      |
      |\__
      |

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Displaying connections between points always same way ignoring bounds
      ACTUAL -
      Lines goes weird

      ---------- BEGIN SOURCE ----------
      package ru.nucodelabs.gem.view;

      import javafx.beans.property.DoubleProperty;

      public class VESCurvesNavigator {

          private final double CHANGE_VALUE;
          private final DoubleProperty vesCurvesXLowerBound;
          private final DoubleProperty vesCurvesXUpperBound;
          private final DoubleProperty vesCurvesYLowerBound;
          private final DoubleProperty vesCurvesYUpperBound;

          public VESCurvesNavigator(
                  DoubleProperty vesCurvesXLowerBound,
                  DoubleProperty vesCurvesXUpperBound,
                  DoubleProperty vesCurvesYLowerBound,
                  DoubleProperty vesCurvesYUpperBound,
                  double changeValue) {
              this.vesCurvesXLowerBound = vesCurvesXLowerBound;
              this.vesCurvesXUpperBound = vesCurvesXUpperBound;
              this.vesCurvesYLowerBound = vesCurvesYLowerBound;
              this.vesCurvesYUpperBound = vesCurvesYUpperBound;
              this.CHANGE_VALUE = changeValue;
          }

          public void zoomIn() {
              if (vesCurvesXLowerBound.get() < vesCurvesXUpperBound.get()
                      && vesCurvesXLowerBound.get() < vesCurvesYUpperBound.get()) {
                  vesCurvesXLowerBound.set(vesCurvesXLowerBound.get() + CHANGE_VALUE);
                  vesCurvesXUpperBound.set(vesCurvesXUpperBound.get() - CHANGE_VALUE);

                  vesCurvesYLowerBound.set(vesCurvesYLowerBound.get() + CHANGE_VALUE);
                  vesCurvesYUpperBound.set(vesCurvesYUpperBound.get() - CHANGE_VALUE);
              }
          }

          public void zoomOut() {
              vesCurvesXLowerBound.set(vesCurvesXLowerBound.get() - CHANGE_VALUE);
              vesCurvesXUpperBound.set(vesCurvesXUpperBound.get() + CHANGE_VALUE);

              vesCurvesYLowerBound.set(vesCurvesYLowerBound.get() - CHANGE_VALUE);
              vesCurvesYUpperBound.set(vesCurvesYUpperBound.get() + CHANGE_VALUE);
          }

          public void moveRight() {
              vesCurvesXLowerBound.set(vesCurvesXLowerBound.get() + CHANGE_VALUE);
              vesCurvesXUpperBound.set(vesCurvesXUpperBound.get() + CHANGE_VALUE);
          }

          public void moveLeft() {
              vesCurvesXLowerBound.set(vesCurvesXLowerBound.get() - CHANGE_VALUE);
              vesCurvesXUpperBound.set(vesCurvesXUpperBound.get() - CHANGE_VALUE);
          }

          public void moveUp() {
              vesCurvesYLowerBound.set(vesCurvesYLowerBound.get() + CHANGE_VALUE);
              vesCurvesYUpperBound.set(vesCurvesYUpperBound.get() + CHANGE_VALUE);
          }

          public void moveDown() {
              vesCurvesYLowerBound.set(vesCurvesYLowerBound.get() - CHANGE_VALUE);
              vesCurvesYUpperBound.set(vesCurvesYUpperBound.get() - CHANGE_VALUE);
          }
      }

      ---------- END SOURCE ----------

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abagarwal Abhinay Agarwal
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: