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

[StackedAreaChart] Display problem with StackedAreaChart when the axis is not displayed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u40
    • 8u5, 8u20
    • javafx
    • Windows

    Description

      Display problem with StackedAreaChart.
      When the axis of origins is not displayed, display areas is not corect.

      Finally is not work for Stacked area chart on Ensemble8.jar
      http://imageshack.com/a/img820/4117/baxy.png
      http://imageshack.com/a/img837/8034/d38e.png

      package application;
      import javafx.application.Application;
      import javafx.collections.FXCollections;
      import javafx.collections.ObservableList;
      import javafx.scene.Parent;
      import javafx.scene.Scene;
      import javafx.scene.chart.StackedAreaChart;
      import javafx.scene.chart.NumberAxis;
      import javafx.stage.Stage;


      /**
       * A sample that displays data in a stacked area chart.

       */
      public class StackedAreaChartApp extends Application {

      private StackedAreaChart chart;
      private NumberAxis xAxis;
      private NumberAxis yAxis;

      public Parent createContent() {
      xAxis = new NumberAxis("X Values", 1.0d, 9.0d, 2.0d);
      //yAxis = new NumberAxis("Y Values", 0.0d, 30.0d, 2.0d); // this is work well
      yAxis = new NumberAxis("Y Values", 1.0d, 30.0d, 2.0d); // this is work bad

      ObservableList<StackedAreaChart.Series> areaChartData = FXCollections.observableArrayList(
      new StackedAreaChart.Series("Series 1",FXCollections.observableArrayList(
      new StackedAreaChart.Data(0,4),
      new StackedAreaChart.Data(2,5),
      new StackedAreaChart.Data(4,4),
      new StackedAreaChart.Data(6,2),
      new StackedAreaChart.Data(8,6),
      new StackedAreaChart.Data(10,8)

      )),
      new StackedAreaChart.Series("Series 2", FXCollections.observableArrayList(
      new StackedAreaChart.Data(0,8),
      new StackedAreaChart.Data(2,2),
      new StackedAreaChart.Data(4,9),
      new StackedAreaChart.Data(6,7),
      new StackedAreaChart.Data(8,5),
      new StackedAreaChart.Data(10,7)
      )),
      new StackedAreaChart.Series("Series 3", FXCollections.observableArrayList(
      new StackedAreaChart.Data(0,2),
      new StackedAreaChart.Data(2,5),
      new StackedAreaChart.Data(4,8),
      new StackedAreaChart.Data(6,6),
      new StackedAreaChart.Data(8,9),
      new StackedAreaChart.Data(10,7)
      ))
      );
      chart = new StackedAreaChart(xAxis, yAxis, areaChartData);
      return chart;
      }


      @Override public void start(Stage primaryStage) throws Exception {
      primaryStage.setScene(new Scene(createContent()));
      primaryStage.show();
      }

      /**
      * Java main for when running without JavaFX launcher
      */
      public static void main(String[] args) {
      launch(args);
      }

      }

      David Form France

      Ps : Sorry for my english
       

      Attachments

        Issue Links

          Activity

            People

              msladecek Martin Sládeček
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: