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

[PieChart] is not redrawn, when value in data is changed, if chart is not animated.



    • Bug
    • Status: Closed
    • P3
    • Resolution: Fixed
    • 7u6
    • 8
    • javafx
    • 2.2.0b15


      Look at the attached movie.

      I add some data, and get control on it, using slider (slider has double value property, which is binded to the added value). If I move slider, value is changed, it can be viewed in the textField. If I change value of added data, when animated property is set to false, nothing changes, but if animated property is set to true, any change is reflected.

      Run code:

      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.event.Event;
      import javafx.event.EventHandler;
      import javafx.scene.Scene;
      import javafx.scene.chart.PieChart;
      import javafx.scene.control.*;
      import javafx.scene.layout.HBox;
      import javafx.scene.layout.Pane;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;

      public class JavaCharts extends Application {

          public static void main(String[] args) {
          PieChart testedPieChart = new PieChart();
          VBox vb = new VBox();

          public void start(Stage stage) throws Exception {

              ObservableList<PieChart.Data> data = FXCollections.<PieChart.Data>observableArrayList();
              for (int i = 0; i < 10; i++) {
                  data.add(new PieChart.Data("Data item " + i, i * 100));

              testedPieChart.setStyle("-fx-border-color: darkgray;");
              testedPieChart.setPrefSize(300, 600);

              Pane pane = new Pane();



              ToggleButton toggle = new ToggleButton("animated property");
              vb.getChildren().addAll(new Label("Switch animated "), toggle);

              pane.setPrefSize(600, 600);

              Scene scene = new Scene(vb, 700, 700);

          public HBox getAddItemHBox() {
              HBox hb = new HBox();
              Label atLb = new Label("Over item");
              final TextField tfPos = TextFieldBuilder.create().prefWidth(150).build();
              Button bt = ButtonBuilder.create().text("get slider!").build();
              bt.setOnAction(new EventHandler() {

                  public void handle(Event t) {
                      int index = Integer.parseInt(tfPos.getText());

                      Slider slider = new Slider();

              hb.getChildren().addAll(atLb, tfPos, bt);
              return hb;

      Get control over any data item (type "1" and click button "get slider!");
      Move slider's knob, when toggleButton is selected, and when toggle button is not selected. You may see, that slider's knob moving affects, when toggle's selected (animated) is true, and doesn't affect, when toggle's selected (animated) if false.


        1. PieChartApp.java
          4 kB
          Alexander Kuznetcov



            psomashe Parvathi Somashekar (Inactive)
            akirov Alexander Kirov (Inactive)
            1 Vote for this issue
            2 Start watching this issue