1 Reply Latest reply: Apr 5, 2013 7:31 AM by 1001246 RSS

    Displaying 3 LineCharts in a single window

    1001246
      Hi everyone,

      je développe un logiciel qui doit m'afficher trois LineCharts les uns au dessus des autres.
      I'm currently working on a program that is supposed to display 3 different LineCharts.

      Until now, my main window is made of an AnchorPane which allows me to place 3 blocs of info and tools on the right side of if (just like Adobe's programs) and when i'm resizing the window, they stick to the border.

      [http://i.imgur.com/phzNDss.png]

      On the left side, i'm trying to display my charts.

      One chart is (quite) OK:

      [http://i.imgur.com/4jRQynh.png]

      But if I try to display 3 of them by specifying the setTopAnchor and setBottomAnchor properties of each of them, it gets messy:

      [http://i.imgur.com/Gje0Y7C.png]

      Here's a piece of code:
      AnchorPane.setLeftAnchor(lineChart, 1.0);
                  AnchorPane.setRightAnchor(lineChart, 151.0);
                  AnchorPane.setTopAnchor(lineChart, 1.0);
                  AnchorPane.setBottomAnchor(lineChart, 200.0);
                  
                  AnchorPane.setLeftAnchor(lineChart2, 1.0);
                  AnchorPane.setRightAnchor(lineChart2, 151.0);
                  AnchorPane.setTopAnchor(lineChart2, 201.0);
                  AnchorPane.setBottomAnchor(lineChart2, 400.0);
      
                  AnchorPane.setLeftAnchor(lineChart3, 1.0);
                  AnchorPane.setRightAnchor(lineChart3, 151.0);
                  AnchorPane.setTopAnchor(lineChart3, 401.0);
                  AnchorPane.setBottomAnchor(lineChart3, 600.0);
      How do I display 3 different LineCharts in the same window, with different data series?

      Any help is welcome :)

      Thanks in advance.