LineChart resize in Voletfractionne

By adding a vertical split pane in a Voletfractionne, this overlap the line chart drawn.

What I would like to have is a line chart that get height resized when I go up and down the divider: I think that a listener would do the job, but of course, I am wrong in my code below.

import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.geometry.Orientation;
import javafx.scene.Scene;
import javafx.scene.chart.Chart;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;

/**
 *
 * @author Alberto Pedroni <[email protected]>
 */
public class LineChartSample extends Application {
    
  @Override  
    public void start(Stage stage) {  
        stage.setTitle("Line Chart Sample");  
        // defining the axes  
        final NumberAxis xAxis = new NumberAxis();  
        final NumberAxis yAxis = new NumberAxis();   
        final LineChart<Number, Number> lineChart = new LineChart<Number, Number>(xAxis, yAxis);   
        // defining a series  
        XYChart.Series<Number, Number> series = new XYChart.Series<>();  
        // populating the series with data  
        series.getData().add(new XYChart.Data<Number, Number>(1, 23));  
        series.getData().add(new XYChart.Data<Number, Number>(2, 14));  
        series.getData().add(new XYChart.Data<Number, Number>(3, 15));  
        series.getData().add(new XYChart.Data<Number, Number>(4, 24));  
        series.getData().add(new XYChart.Data<Number, Number>(5, 34));  
        series.getData().add(new XYChart.Data<Number, Number>(6, 36));  
        series.getData().add(new XYChart.Data<Number, Number>(7, 22));  
        series.getData().add(new XYChart.Data<Number, Number>(8, 45));  
        series.getData().add(new XYChart.Data<Number, Number>(9, 43));  
        series.getData().add(new XYChart.Data<Number, Number>(10, 17));  
        series.getData().add(new XYChart.Data<Number, Number>(11, 29));  
        series.getData().add(new XYChart.Data<Number, Number>(12, 25));  
        
        final Pane root = new Pane(); 
        SplitPane sp = new SplitPane();
        sp.setOrientation(Orientation.VERTICAL);
        sp.setDividerPosition(0, 0.7);
        
        final Pane pane1 = new Pane();
        lineChart.getData().add(series);
        lineChart.setPrefSize(800, 600);
        lineChart.setLegendVisible(false);
        pane1.getChildren().add(lineChart);
        pane1.setPrefSize(800, 600);
   
        Pane pane2 = new Pane();
      
        root.heightProperty().addListener(new ChangeListener<Number>() {
                        @Override
                        public void changed(ObservableValue<? extends Number> observableValue, Number oldValue, Number newValue) {
                            lineChart.setPrefSize(pane1.getPrefWidth(), pane1.getPrefHeight());
                        }
                    });
        
        sp.getItems().addAll(pane1, pane2);
        root.getChildren().add(sp);
        
        Scene scene = new Scene(root, 800, 600);   
        stage.setScene(scene);  
        stage.show();  

    }  
    public static void main(String[] args) {  
        launch(args);  
    }  
} 

In this case, maybe use an AnchorPane for Pane1 and anchor your chart to it.


final AnchorPane pane1 = new AnchorPane();
pane1.setTopAnchor(lineChart, 0.0);
pane1.setBottomAnchor(lineChart, 0.0);

Tags: Java

Similar Questions

  • Extension Voletfractionne correctly

    Hello, I'm having a problem with Voletfractionne (horizontal flow). What I want is to find a way to keep the left pane in the same position when maximizes the main window. I don't want the left pane to push its width. If I go in the AnchorPain constraint in the constructor of the stage and lift the restrictions of the right and left, when I run the application, the left pane maintains its position, but it appears a gap between the two components (the left pane and the right one).

    I need to find a way to develop the right pane at the position where the left pane is.

    The link shows an image that illustrates the problem. https://www.Flickr.com/photos/106652676@N06/14276096434/

    Thanks in advance for any help.

    ResizableWithParent property is probably all you need.

    ' ' Tell you use SceneBuilder (version 2.0), drop one ' (horizontal) Voletfractionne "on the Panel content, then if you select say the left hand AnchorPane, go into the component layout of the Inspector panel and uncheck"Resizable with Parent"box will not change the width of this AnchorPane when resizing the Voletfractionne. See you it in action thank you immediately preview (menubar > preview > Preview in the window).

  • Not resizable Voletfractionne

    I have an interface I have distributed several Voletfractionne but want these Voletfractionne not be resized or modified.

    How can I do?

    I must say that the split pane is built with FXML.

    Thanks in advance

    Example for the manufacture of a split pane that is not resizable.
    I'll leave it up to you to transfer concepts and apply them to your fxml-based user interface.

    import java.util.*;
    import javafx.application.Application;
    import javafx.scene.*;
    import javafx.scene.control.*;
    import javafx.scene.layout.StackPane;
    import javafx.stage.Stage;
    
    public class StaticSplitPaneExample extends Application {
      public static void main(String[] args) { launch(args); }
      @Override public void start(Stage stage) throws Exception {
        SplitPane split = createSplitPane();
    
        stage.setScene(new Scene(new Group(split)));
        stage.getScene().getStylesheets().add(
          getClass().getResource("static-split.css").toExternalForm()
        );
        stage.setResizable(false);
        stage.show();
    
        disableDividers(split);
      }
    
      private SplitPane createSplitPane() {
        SplitPane split = new SplitPane();
        split.getItems().setAll(
          createStackedButton("One"),
          createStackedButton("Two"),
          createStackedButton("Three"),
          createStackedButton("Four")
        );
        split.setDividerPositions(0.3, 0.6, 0.9);
        split.getStyleClass().add("static-split");
        split.setMinSize(500, 200);
    
        return split;
      }
    
      private void disableDividers(SplitPane split) {
        for (Node divider:  split.lookupAll(".split-pane-divider")) {
          divider.setMouseTransparent(true);
        }
      }
    
      private StackPane createStackedButton(String buttonText) {
        final StackPane stack = new StackPane();
        stack.getChildren().add(new Button(buttonText));
        stack.setStyle("-fx-background-color: cornsilk;");
    
        return stack;
      }
    }
    

    Associate the css file to remove the handles of divisors.

    /** static-split.css */
    .static-split .split-pane *.horizontal-grabber { -fx-background-color: transparent; }
    .static-split .split-pane *.vertical-grabber   { -fx-background-color: transparent; }
    
  • JavaFX 8 - Voletfractionne setDividerPosition does not work!

    Hello

    After resizing my window, I want my Voletfractionne dividers are changed (I like to keep the same ratio for the divisors (0.4f for the first 0.6f for the second) it's resizing my window).

    so I use setDividerPosition to set the positions of the dividers.

    Unfortunately, they are not changed that they keep their old values (in this case, the initial values)!

    In fact, I feel that, for setDividerPosition, is not applied.

    Can you help me please!

    Kind regards

    FM

    Thanks, I use this work around, and it's true!

  • JavaFX Voletfractionne divider Position inconsistent behavior

    I have two StackPanes (pane1 & pane2) appears in a Voletfractionne (Voletfractionne). Position of the Voletfractionne-divisor is defined a.3 in Report Builder. The second StackPane (pane2) contains a button that also affects the position of the separator of the Voletfractionne a.3.

    Ceteris paribus, the expected behavior is that the two actions (setting the position of the partition in the constructor and adjusting the position of divider through action) either work or not.

    However, only the last actually works.

    Changing between the construction of the Voletfractionne and the onAction to the button? What makes obstacle to the implementation of the partition in Report Builder?
        StackPane pane1 = new StackPane();
        StackPane pane2 = new StackPane();
    
        final SplitPane splitPane = SplitPaneBuilder.create()
                .items(pane1, pane2)
                .dividerPositions(new double[] {.3})
                .orientation(Orientation.HORIZONTAL)
                .build();
    
        pane2.getChildren().add(ButtonBuilder.create()
                .text("Divider Position")
                .onAction(new EventHandler<ActionEvent>() {
                    @Override
                    public void handle(ActionEvent event) {
                        splitPane.setDividerPositions(.3);
                    }
                })
                .build());
    
        Scene primaryScene = SceneBuilder.create()
                .root(splitPane)
                .build();
    
        primaryStage.setScene(primaryScene);
        primaryStage.setTitle("Name");
        primaryStage.setWidth(500);
        primaryStage.setHeight(500);
        primaryStage.show();
    
        splitPane.setDividerPositions(.3);
    (see also http://stackoverflow.com/questions/15041332/javafx-divider-position-inconsistent-behaviour)

    There was a [url http://javafx-jira.kenai.com/browse/RT-17229] bug filed to do so, if it was closed with a 'cannot reproduce '. The problem seems to be that the stage size is smaller than that of its window. This causes an additional layout pass when the window appears first; the second pass of layout is considered a "resizing of the window" and therefore the position of the separation of the split pane is not respected on this pass.

    I have a couple of workarounds. (Probably the cleanest) is to define the size of the stage, instead of the size of the window:

    Scene primaryScene = SceneBuilder.create()
                .root(splitPane)
                .width(500)
                .height(500)
                .build();
    
        primaryStage.setScene(primaryScene);
        primaryStage.setTitle("Name");
        primaryStage.show();
    

    The other is to encapsulate a call to splitPane.setDividerPositions (...) in a (...) Platform.runLater. What causes the divider positions be reset after having performed the layout pass. This will be like a bit of a hack.

        Scene primaryScene = SceneBuilder.create()
                .root(splitPane)
                .build();
    
        primaryStage.setScene(primaryScene);
        primaryStage.setTitle("Name");
        primaryStage.setWidth(500);
        primaryStage.setHeight(500);
        primaryStage.show();
        Platform.runLater(new Runnable() {
          @Override
          public void run() {
            splitPane.setDividerPositions(.3);
          }
        });
    

    You might want to fill out a bug report, with your original code written as an example comprehensive and executable and RT-17229 reference.

  • partition boot camp disappeared after resizing Macintosh HD

    Hello

    I have a macbook pro with OS X El Capitan 10.11.6.

    I had a windows 8.1 installed on boot camp and ran out of space on windows, so I tried to extend the space by adding a new partition on mac and then merge on windows using the "minitool' but when I rebooted with now that the ALT key was not the boot camp partition...

    I then started the mac and changed the boot disk in boot camp and restarted and it gave me a message "there is no disk bootable..." or something like that.

    It's really important not to lose the windows and more important still do not have to format the new laptop please (because I had a similar problem before Re: Partitioning a Hard Drive Error on MacBook Pro)

    I tried to check for similar discussions but seemed to I'll do it is harder to resolve because I do not understand most of what is said and was afraid to do worse.

    Hello MayMedhat,

    I understand the partition Boot Camp have been adjusted and you are no longer able to access the windows on your MacBook Pro.  Because you cannot access side Windows of your Mac after setting, you must recreate your Boot Camp partition and reinstall Windows on your Mac.

    Set up Windows on your Mac partition

    Change the size of the partition

    It is not possible to change the size of the partition after installing Windows, but you can delete the partition and create a new partition to the correct size. Do not try to resize your Windows partition or a third-party application.

    How to install Windows using Boot Camp

    Please let us know if you need any additional help and thank you for visiting the communities of Apple Support.

    See you soon.

  • XCode 8 - How to fix an Auto resize problem on XCode version 8.0?

    I used XCode version 7.2.1 for my project. But I updated version 8.0 of XCode now. The scrolling display is inconsistent in my project view controllers. Here I used resizing only not an automatic layout. I have mentioned the many forums. But can not able to find a solution for this. Here, I have attached similar links that I had tried.

    Question 8 of Xcode GM seeds Storyboard layout

    Problems after upgrade to Xcode 8

    I've updated the framework of everything in the table of Storyboard each time I start Xcode

    What is the exact solution for resizing problem scrolling display in XCode version 8.0. Help me please if anyone knows who...

    Thanks in advance.

    See my answer on StackOverflow.

    75 39594475 http://StackOverflow.com/questions/39526156/autoresizing-issue-in-Xcode-8/395944 #.

  • Resized partition Boot Camp, now cannot start Windows

    I have a MacBook Pro (with the retina) with a 128 GB SSD which was, until recently, evenly divided 50-50 between Mac and Windows 8.

    However, I need more space on the size of Windows, so I reduced the size of the Mac partition to 40 GB and then, because for some reason I couldn't expand the Boot Camp one, I had to create another partition that I could use to put my stuff in side Windows.

    I did this via Windows.

    I now, weeks later, started in Mac for the first time since, and now I can't get back into Windows. The partition is not present on the desktop, or in the boot disk utility.

    Output of gdisk:

    GPT fdisk (gdisk) version 1.0.1

    WARNING: Open with shared lock devices will not have their

    table partition automatically reloaded!

    Scanning partition table:

    MBR: protection

    BSD: absent

    APM: absent

    TPG: present

    Found valid GPT with protective MBR; using GPT.

    Disk/dev/disk0: 236978176 sectors, GiB 113.0

    Logical sector size: 512 bytes

    Identifier (GUID) of disc: 453C975D-0233-49EB-A8C3-7B7BF7805CFD

    Partition table contains up to 128 entries

    First usable sector is 34, last usable area is 236978142

    The partitions will be aligned with the boundaries of sector 8

    Space free total is 4165 sectors (2.0 MiB)

    Starting number (sector) end (sector), Code name of size

    409639 40 1 200.0 of MiB EF00 EFI system partition

    2 409640 79247487 37.6 giB AF05 customer

    3 79247488 80517023 619.9 MiB AB00 Recovery HD

    4 80517120 119578623 18.6 giB 0700 basic data partition

    5 119580672 236976127 56.0 giB AF00 BOOTCAMP

    Can anyone help please? The partition is obviously still there, but I can't work on how to make it reappear in the startup disk!

    Can you use [help] can not boot Windows after resizing partition (8.1) as reference and rebuild your MBR?

  • Is it possible to resize photos in 10 of iOS on iPad 2 Air?

    Hi all

    By sending an e-mail with a photo taken with the camera MP before 8 in our new iPad, the photo is average at grand view on the recipient's PC. It would be very useful resize the image in Photo Editor before or in the mail before you send it. Is this possible? If you open another application to change my wife will not use it.

    Thank you

    ~ Ed

    Open the camera app then locate the photo then tap the change (three horizontal blue bars) at the bottom of the screen, then tap on the icon of resizing on the left. Resize the photo and then tap the share icon.

  • How to resize the screen display to use only half of the screen

    in order to write the information to a website in a MS word document, I want to put the site to display browser so the document MS word on the screen at the same time (each 1/2 of the screen (left and right view). How can I do this? I am technically challenged so tell me in the jargon of the primary school

    I can't test this on Windows 10, but...

    On Windows 7, if you hold down the keyboard Windows key, then press the right arrow key, the currently active window will change its form. By example, if the window is maximized it will change occupying half right side of the screen. Hold the Windows key and pressing the arrow key right to scroll to the right, left and restored/resizable. To maximize, use the up arrow key.

    I hope you can use this keyboard shortcut hidden to set each application to the half of the screen easily without having to manually extendable/retractable and move windows. And it's a cool thing that you can share with other people.

  • Close, minimize and resize buttons are inactive on the main window

    My email client is the beta version of 41. I just upgraded the sys op to version 10 of Windows version 7.

    The close, minimize and resize buttons are inactive on the Thunderbird main window when running on Windows version 10. These buttons are active on other windows such as the address book and new message. Ctrl W keys work on the main as Alt and then exit.

    Is there a reason that the buttons are inactive on the main window?

    https://support.Mozilla.org/questions/1082823

  • Cannot send resize window

    Thunderbird comes automatically updated yesterday and now I can't resize the send window. Its width is locked in place. Regardless of whether a new message or a reply. Originally, there were also a few oddities with no dressing properly in the text, so I dragged a response window to be wider, it is now locked in place.

    Thoughts?

    Found! I have an extension called 'Foxclocks' installed which indicates what time it is in other time zones. I had several time zones listed that are listed horizontally at the bottom of the send window. The length of these time zones inscription kept setting the width min. of the send window. Remove some of the zones fixed.

  • Partition boot camp missing after resizing of disk utility

    Is anyway to fix this?

    I did things I shouldn't probably try. I tried to fix this by myself and messed up

    My windows partition disappeared after I have resize the drive using OS X I'm afraid header NTFS is more intact

    And now I'm analyzing my disk0 with testdisk but it not showing desired writing...

    So many incompatibilities.

    Please guide me, I gave up, I just need access to my windows partition to take all my data so I can copy on my external hard drive.

    Thank you

    Can you post the output of

    diskutil list

    Cs diskutil list

    sudo TPG - vv - r see the/dev/disk0

    rdisk0s3 cannot be the right partition to search for the NTFS header. The partition you more, and I'll be fine. Boot from a disk of OS X, if possible.

  • Can't resize external backup Time Machine in the hard disk partition

    I have a Seagate Expansion to drive 3 that I use for storing files as well and Time Machine. Initially when I set up the drive, I allocated 350GB for the partition that I use with Time Machine.

    I use a 256GB MacBook Pro and Time Machine is now advising me constantly backup capsule is short of space. I have 2 questions:

    1. Disk utility does not allow me to resize the partition of Time Machine (I can only reduce the size using resize controls). Also, I can't delete the partition, because the minutes signed is grayed out (see screenshot) - However, I am able to erase this partition. What can I do to resize (and expand) this partition, or delete it and create a larger partition for use with Time Machine?
    2. What is the best size to send to the Time Machine partition in order to keep my Mac saved 256 GB?

    Thanks in advance!

    A drive that is mounted or shared may present as "Busy" that could prevent resizing.

    Try to disassemble the disc (with the assembly/disassembly button in disk utility) and see if it works better. Then mount it again before leaving the disk utility, or do a reboot to mount again.

  • Firefox cannot resize the files of gmail download dialog

    When you use Gmail and I click on the attachment link to see the file download dialog box, it is always displayed full screen and I cannot resize. the small < < thing in the lower right corner does nothing and there is no resizing does not control in the upper right where X is. execution of Gmail using Chrome does not exhibit this problem. I recently did a Firefox "refresh" and it has not changed this behavior. It is a new problem that must be linked to a recent change somewhere that I saw this problem over the years of a prior use of Firefox and Gmail. He just did the same thing when you click Browse on this Mozilla support page - is not a specific problem of Gmail.

    Can you open the system menu via Alt + space and use Restore or resize?

Maybe you are looking for

  • you find solution Center?

    My Hp c6280 all-in-one cannot parse after that I got a new computer. the error message is that I is the center of the solution, but I can't seem to find one... were pleace helpe my computer is Windows 7, 64-bit

  • How can I determine my current USB ports on Windowx XP (1.1 or 2.0) size?

    I want to buy a flash drive, and I would like to know what size my USB ports.

  • Cannot be displayed on Windows XP splash screen when starting computer

    When I boot my laptop with Windows XP... I don't see the startup screen that allows me to press F8 or other keys to enter in the BIOS before Windows loads up. Any suggestions on how to correct... This was happening before. I updated Windows XP... no

  • Venue 11 pro and WRT400N problem

    I'm having a problem with this Linksys router. The v11p connects to the router with 5 bars, but the internet barely works. Most of the time when I try to access something that the connected to the internet, it can not connect (that is to say, sites W

  • Twitter application

    Hello friends, I create an application for OS_v5.0 and integrate twitter by jtwitter api. I'm doing some improvements for my needs but its taking too much time to enroll in chip. Please help me.