Hover popup on LineChart

I am building a line chart graph and what to create a small modal/popup/tooltip to display the exact data points for the graph point that they are mousing over.
It looks like I would need to do this by attaching an event handler to the XYChart.Data<x,y> object that is added. But I can't find any information on how to attach the event handler that will work.
I originally tried it this way
List<XYChart.Data> data = new ArrayList<XYChart.Data>();
for (int i = 0; i < 12; i++) {
XYChart.Data<String, BigDecimal> dataPoint = new XYChart.Data<>(i + "", BigDecimal.valueOf(new Random().nextDouble() * 10000));
dataPoint.getNode().addEventHandler(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>() {
public void handle(MouseEvent event) {
System.out.println(event.getSource().toString());
data.add(dataPoint);
But that threw error as the getNode() method returned null. I am sure that I am doing this is a somewhat backwards way, but I can't find a better example. The JavaFX site says that a chart example (including hovers was in the sample code) but I can't find it if it's there.
Can someone point out to me what I need to do here?

Hi,
Please refer to the following document.
http://download.oracle.com/javafx/2.0/charts/pie-chart.htm
(Scroll down to Processing Events for a Pie Chart)
It performs almost what you're trying to implement.
Just adapt the sample to the LineChart and replace MOUSE_PRESSED with MOUSE_ENTERED.
Regards,
Alla

Similar Messages

  • Image Hover Popup

    Does anyone know how to create a hover function which shows a larger version of an image thumbnail when the mouse hovers over the thumbnail?
    Thanks
    Oliver

    If you are asking that property of controls which fires mouse event when its hovered its.  MouseOver, MouseOut and RollOver , RollOut Respectively for in n out.
    I prefer to use RollOver and RollOut though MouseOver and MouseOut is also similar.
    Only difference i figured out is that it sometimes causes flcikering problem when moved over edges in MouseOver and MouseOut case.
    Check this link for Difference between two.
    http://polygeek.com/1519_flex_the-difference-between-rollover-and-mouseover
    You can use states to achieve your functionality.
    this example can help
    http://flexscript.wordpress.com/2008/08/14/flex-roll-over-image-with-link-component/
    If this post answers your question mark it as such.
    Cheers,
    PRad.

  • Customize popup window

    Hello,
    I would like to customize popupwindow like this http://download.oracle.com/javafx/1.3/howto/Hover-Popup-Tutorial.html, but don't know how to start in 2.0.
    Here is my code where to apply.
    public void dataPopUp () {
         for (XYChart.Series<Number, Number> series : lc.getData()) {
                for (final XYChart.Data<Number, Number> data : series.getData()) {
                  data.getNode().setOnMouseClicked(new EventHandler<MouseEvent>() {
                    @Override
                    public void handle(MouseEvent event) {
                      //System.out.println("Clicked on " + data);
                      Text popupText = new Text();
                      popupText.setContent("response: "+data.getYValue().toString()+" ms");
                      Popup dataPopup = new Popup();
                      dataPopup.setAutoHide(true);
                      dataPopup.getContent().add(popupText);
                      dataPopup.show(s,
                              event.getScreenX() - dataPopup.getWidth(),
                              event.getScreenY() - dataPopup.getHeight());              
    }I guess I need to apply PopupControl somehow, but not sure. I would appreciate any idea.
    Gabor

    Here is some code I'm using for a popup progress bar.. hope it helps. This does Exception out though if the window is closed while the popup is still open so its not perfect.
    import javafx.beans.property.IntegerProperty;
    import javafx.beans.property.ObjectProperty;
    import javafx.stage.Window;
    import javafx.scene.Node;
    import javafx.scene.control.PopupControl;
    public class ProgressBarPopup extends PopupControl
        ObjectProperty<Node> referenceNodeProperty= new ObjectProperty<Node>();
        IntegerProperty stepsProperty = new IntegerProperty();
        IntegerProperty currentStepProperty = new IntegerProperty();
        public ProgressBarPopup(Node referenceNode)
            referenceNodeProperty.setValue(referenceNode);
            stepsProperty.setValue(0);
            currentStepProperty.setValue(0);
           ProgressBarPopupSkin skin = new  ProgressBarPopupSkin(this);      
           setSkin(skin);       
        public ObjectProperty<Node> referenceNodeProperty()
            return referenceNodeProperty;   
        public IntegerProperty stepsProperty()
            return stepsProperty;
        public IntegerProperty currentStepProperty()
            return currentStepProperty;
        public void show()
            Window win = null;       
            if (referenceNodeProperty.getValue() != null) {
                win = referenceNodeProperty.getValue().getScene().getWindow();
            super.show(win);
        public void setProgress(int currentStep) throws IndexOutOfBoundsException
            if (currentStep < 0 || currentStep > stepsProperty.getValue()) {
                throw new IndexOutOfBoundsException("Illegal progress setting");
            currentStepProperty.setValue(currentStep);
        public void setProgress(int currentStep, int steps) throws IndexOutOfBoundsException
            if (steps < 0 || currentStep < 0 || currentStep > steps) {
                throw new IndexOutOfBoundsException("Illegal progress setting");
            stepsProperty.setValue(steps);
            setProgress(currentStep);       
    }As you can see, I launch this popup using the show() method.
    And the skin....
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.EventHandler;
    import javafx.scene.Node;
    import javafx.scene.control.ProgressBar;
    import javafx.scene.control.Skin;
    import javafx.scene.effect.Light;
    import javafx.scene.effect.Lighting;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.shape.Rectangle;
    import javafx.stage.WindowEvent;
    import vnet.javafx.scene.paint.SystemColors;
    public class ProgressBarPopupSkin<C extends ProgressBarPopup> extends Object implements Skin<C> {
        ProgressBarPopup control;
        AnchorPane rootNode = new AnchorPane();
        ProgressBar progressBar = new ProgressBar();
        Rectangle background = new Rectangle();
        public ProgressBarPopupSkin(ProgressBarPopup control)
            super();
            final ProgressBarPopupSkin self = this;
            this.control = control;
            control.onHidingProperty().addListener(new ChangeListener<EventHandler<WindowEvent>>() {
                @Override
                public void changed(ObservableValue<? extends EventHandler<WindowEvent>> observable, EventHandler<WindowEvent> oldValue, EventHandler<WindowEvent> newValue) {
                    System.out.println("Disosed!");
                    self.dispose();
            background.heightProperty().bindBidirectional(control.prefHeightProperty());
            background.widthProperty().bindBidirectional(control.prefWidthProperty());
            progressBar.setPrefHeight(20);
            background.heightProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue)
                    double height = newValue.doubleValue() > (double) 20.0 ? (double)20.0 : newValue.doubleValue();
                    self.progressBar.setPrefHeight(height);
                    double center = (newValue.doubleValue() / 2.0) - 10;
                    if (center > 0) {
                        self.progressBar.setLayoutY(center);   
                    } else {
                        self.progressBar.setLayoutY(0);
            background.widthProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue)
                    self.progressBar.setPrefWidth(newValue.doubleValue() * (double)0.9);
                    self.progressBar.setLayoutX(newValue.doubleValue() * (double)0.05);
            control.stepsProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    int steps = newValue.intValue();
                    if (steps > 0) {
                        double dsteps = new Double(steps);
                        double dcurrentstep = new Double(self.control.currentStepProperty().getValue());
                        self.progressBar.setProgress(dcurrentstep/dsteps);
                    } else {
                        self.progressBar.setProgress(-1);
            control.currentStepProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
                    int steps = self.control.stepsProperty().getValue();
                    if (steps > 0) {
                        double dsteps = new Double(steps);
                        double dcurrentstep = new Double(newValue.intValue());
                        self.progressBar.setProgress(dcurrentstep/dsteps);
                    } else {
                        self.progressBar.setProgress(-1);
            double borderLightingSurfaceScale = 3.0f;
            Light.Distant borderLight = new Light.Distant();
            borderLight.setAzimuth(-90.0f);       
            borderLight.setElevation(67.5f);
            Lighting borderLighting = new Lighting();
            borderLighting.setLight(borderLight);
            borderLighting.setSurfaceScale(borderLightingSurfaceScale);
            background.setStroke(SystemColors.getWindowBorderColor());               
            background.setFill(SystemColors.getWindowBorderColor());
            background.setArcWidth(30);
            background.setArcHeight(20);
            background.setStrokeWidth(2);
            background.setEffect(borderLighting);       
            rootNode.getChildren().setAll(background,progressBar);
        ProgressBarPopup getControl() {
            return control;
        @Override
        public Node getNode() {               
            return rootNode;
        @Override
        public void dispose() {
            rootNode.getChildren().clear();
            rootNode = null;
            this.control = null;
        @Override
        public C getSkinnable() {
            return (C)control;
    }You can also disregard that disposed message.... it never gets called. It was another vein attempt to eliminate the Exception.

  • Screen Anomalies & Artifacts While Viewing Images (java?)

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/867139]]</blockquote>
    While viewing images specifically, those used in a java based hover popup, I see an outlined box covering a large portion of the screen. The hover works like this - mouse-over icon expands view. Click-on opens larger image in new window. It's when returning from that window, there is now a large outlined box starting from the corner of the icon and covers one-third of the screen. Choose another image and that outline moves to that image.

    Today, after a year of trying to get rid of thei problem, an Aperture "Craetive" at the Apple store found a way to correct it after contemplating it for about 15 seconds.
    Here is the remedy:
    To get rid of it, select image(s), go to Photo in the menu bar, hold down Option key, click on Generate Preview in the drop down menu. Wait for it to finish processing - a few seconds. Done.

  • Pagination issue with Command Link

    Hi
    I have a HtmlDatatable in which I am I am using pagination. Pagination is working fine the issue is one colum has been used with commnadlink.
    Whne I use the pagination(Say when I click next or last) i am not getting the hyper link in that column.
    Any idea?
    Thanks in advance
    Best Regards
    Sathish

    Hi,
    hard to say. Looks as if the browser blocks the command link when the note window launches as modal dialogs would do.  There are two reasons for this IMO
    1. The hover code also executes when you want to click the link, which means that you don#t get to executing your action. Work around is to detect whether the note window is open and if don't try and re-launch the note window
    2. If you use showPopupBehavior to launch the note window, then this actually kills all action listener methods (which then may be a second reason). So my suggestion is to try and launch the hover popup from JavaScript using an af:clientListener
       Sample code: Sameh Nassar: JavaScript With ADF Faces Samples
        the client listener should listen for the mouse over event.
    If none of this help and you have access to customer support, I suggest to create a test case and file a service request. My current guess though is that the reason for the behavior is in in your code (browsers tend to work differently in the way they execute JS events too).
    Frank

  • Issue with command link in chrome/mozilla

    Hi All,
    I have designed a simple jspx page having a command link component.
    This command link component is tied up with two sets of operations associated with it -
    > Displays a note window using hover action.
    > Launched a popup on clicking the link components.
    While performing some test runs on different browsers, I noticed different behavioural pattern -
    > Internet Explorer - Placing the cursor on link displays the note window and the command link remains enabled for the user to click on it and launch the popup.
    > Mozilla/Chrome - Placing the cursor on the link displays the note window, however, on the clicking the link, the popup doesn't launch. The user has to move and place the cursor again on the link to perform the desired event.
    Request your guidance on troubleshooting the problem.
    I am using JDeveloper version 11.1.1.7.
    Best Regards,
    Ankit Gupta

    Hi,
    hard to say. Looks as if the browser blocks the command link when the note window launches as modal dialogs would do.  There are two reasons for this IMO
    1. The hover code also executes when you want to click the link, which means that you don#t get to executing your action. Work around is to detect whether the note window is open and if don't try and re-launch the note window
    2. If you use showPopupBehavior to launch the note window, then this actually kills all action listener methods (which then may be a second reason). So my suggestion is to try and launch the hover popup from JavaScript using an af:clientListener
       Sample code: Sameh Nassar: JavaScript With ADF Faces Samples
        the client listener should listen for the mouse over event.
    If none of this help and you have access to customer support, I suggest to create a test case and file a service request. My current guess though is that the reason for the behavior is in in your code (browsers tend to work differently in the way they execute JS events too).
    Frank

  • Submenu links:how to make

    I used multiple CSS on my page.want to make a hover-popup
    submenu links to
    one of the text navigation link .sth like the
    adobe-community-forum".
    I saw the codes behind the websites of my wish but a bit
    confusing.i want
    the code and how and where to insert it.i wish the submenu
    links be
    stretched horizontally.
    Sure you can help.
    Many Thanks.
    ****

    http://www.projectseven.com/tutorials/navigation/auto_hide/index.htm
    regards
    k
    "heynock" <[email protected]> wrote in
    message
    news:f2jsqq$kth$[email protected]..
    >I used multiple CSS on my page.want to make a hover-popup
    submenu links to
    > one of the text navigation link .sth like the
    adobe-community-forum".
    > I saw the codes behind the websites of my wish but a bit
    confusing.i want
    > the code and how and where to insert it.i wish the
    submenu links be
    > stretched horizontally.
    > Sure you can help.
    > Many Thanks.
    > ****
    >

  • Mouse Hover Over Popups

    The code editor covers over the Name, Value, Type Tooltip while debugging with a popup showing Schema type data. It pops up in other areas too. ie: hovering over the connection tree objects.
    You can see it in my screenshot as a blue box at:
    http://imageshack.us/photo/my-images/828/popupn.png/
    It hangs there for a few seconds and goes away.
    Does anyone know how to not have this popup.
    I looked in Tool|Preferences but nothing turns this off.
    Thanks

    Hi,
    So that means you have tried playing with all of these Tools|Preferences?
    Mouseover Popups. Disable any smart popups that use Hover only without <Alt>, <Shift>, <Ctrl>.
    Debugger|Show Tool Tip in Code Editor While Debugging.  Uncheck this.
    Debugger|Tool Tip.  Here you can deselect Value and Type, but not Name. Regards,
    Gary
    SQL Developer Team

  • Hover over hotspot - image popup? How to?

    Hi, new to HTML and CSS - really no code to post, anything I try doesn't work in the slightest.
    I'm trying to have an image popup directly below a hotspot on mouseover of that hotspot. I can get it to work on text, but not with the hotspot. Either doesn't work at all, or the image that is supposed to pop up is permanently at the bottom of the screen (I suppose where the coords for the hotspot map are).
    Any help appreciated, thanks.

    Have a look here http://forums.adobe.com/message/2248950
    Gramps

  • Metadata popup on mouse hover

    When I hover the mouse over an image and hold the pointer's position (whether in browser view or fullscreen), a metadata summary pops up. It's a black, striped window that follows the mouse pointer as I move it.
    How do I turn this off? It's horribly annoying!
    I must have turned it on with a random, accidental keystroke because I don't remember Aperture ever having this behavior. But I can't for the life of me find how to toggle it off. Help, please.

    The T key toggles it on or off - it can be convienient if you want to see data - you can also customize the view.
    [Aperture metadata|http://photo.rwboyer.com/2008/08/aperture-and-metadata-display>
    RB

  • Popup on mouse hover?

    Hi folks,
         Acrobat Newbie question:
         We're looking at making some of our PDF documents more interactive; specifically we've been asked to have a window with an explanation pop up when a user hovers over a particular bit of text. For example, if the mouse hovers over the words "Daily Average" in the document, a description of how the Daily Average is calculated would pop up. Is this kind of thing do-able in Acrobat? We're using Acrobat Professional version 7.1.0 to create the documents; readers are using the standard Acrobat reader.
         Thanks,
              Binky

    The T key toggles it on or off - it can be convienient if you want to see data - you can also customize the view.
    [Aperture metadata|http://photo.rwboyer.com/2008/08/aperture-and-metadata-display>
    RB

  • How do I get the downloads popup/tab to go back to the old place (on the left side?) Now that I have the latest update of Firefox, it moved it over to the right

    I would like to get the downloads tab to go back to the way it was, before this most recent update. Now that I have the latest update of Firefox, it moved over to the right. The little hand won't budge it. And the download interface is different, now it is under something called 'library', I liked the old way much better - any way to restore it to that?

    Can you clarify what you mean with ''downloads popup/tab''
    Is this the pop-up that you see when finishing a download or do you mean the pop-up you see if you hover a link?
    When a download is in progress then you see a download progress bar on the Navigation Toolbar instead of the Download Manager button and that button is highlighted once the download has finished to make you aware the their are new downloads.
    You can view the new Download Manager in a tab by opening the about:downloads page and consider to open this page in a separate window.

  • How do i remove popups in software simulation - captivate 8

    Hi,
    I have recently moved to captivate 8 - straight from captivate 4. I have recorded a software simulation and am now in the process of editing it. On some screens captivate has captured the popup messages you get when you hover over a button or link, in the past in captivate 4 i would copy the background out of captivate, remove the pop using paint or photoshop and paste the edited background back in to the simulation.
    In captivate 8 i finding i am unable to do this. When i preview the screen capture the pop up message appears, however when i look at the background there is no pop up. It seems to be there as part of the screen capture, if i use the skimmer to run over the timeline the popup appears in the last few seconds, if i trim the slide of the seconds the pop up remains. I have been unable to find any options for removal of the pop ups.
    Does anyone have a solution for this problem?
    Thanks
    Glenn

    Yeah, somehow those tooltips are animated in the background slide.
    My fix: edit that background slide in Photoshop, ensure it shows what you want (i.e. not the tooltip), copy (or save) that flattened background image, back to Captivate, create a new slide after the 'odd' one, paste the background slide (merge with background), copy over any other elements from the 'odd' slide...then delete the odd slide.
    There is an option to capture tool-tips or not, I believe, in the capture setup/preferences...

  • Images in a popup window

    Hi,
    I have some difficulty displaying images in a popup window. The (Tomcat 5.5) server apparently sends them with a content type of utf-8 text, which leads to an exception page shown in the popup window instead of the picture.
    In web.xml I checked the mime-mapping for the images:
         <mime-mapping>
              <extension>jpg</extension>
              <mime-type>image/jpeg</mime-type>
         </mime-mapping>
    etc.
    The html part is this:
    <a href="# onclick="window.open('${image.path', '',
    'status=no,width=${image.width},height=${image.height}');">Show Picture</a>
    How can I get the server to send the images with the proper Content-types? Do I necessarily have to create a separate JSP page for this purpose?
    Thanks,
    Laszlo Borsos

    Thanks for that !
    Sadly (probably due to my HTML knowledge or lack of) I'm not
    getting very far at all. I've added some skeleton classes to
    default.css simply to see if anything changes and it's not :-(. Can
    anyone advise what I might be doing wrong here ? - the final goal
    is to have normal hyperlinks exactly as they are just now but with
    popup links to have a dotted underline instead of a solid
    underline.
    A.link {
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    A.visited {
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    A.hover {
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    A.popup.link {
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    border-bottom: 1px dotted
    A.popup.visited{
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    border-bottom: 1px dotted
    A.popup.hover{
    font-size: 10pt;
    font-family: Arial, sans-serif;
    line-height: Normal;
    border-bottom: 1px dotted
    }

  • How do you set up so that you can view the alternate text on an image when you hover over it like you do in IE?

    Using Mozilla at present the alternate text for an image does not pop up when you hover your mouse over the image. This is what occurs in Internet Explorer. In Mozilla Firefox you have to right click, choose Properties and then you can view the alternate text. Is there a way to set up the mouse hover? Or is there a keyboard shortcut to at least view the Properties information of an image on a webpage quicker?

    The Alt attribute isn't meant to show as a tooltip on hover.
    The Alt attribute is meant to show if the image isn't or can't be displayed.
    The title attribute is meant to show if you hover an image or link.
    *http://kb.mozillazine.org/Image_tooltips_do_not_work
    Some extensions can interfere and disable the tooltip.
    * [[Troubleshooting extensions and themes]]
    * http://www.w3.org/TR/html401/struct/global.html#title title
    * http://www.w3.org/TR/html401/struct/objects.html#alternate-text
    *Popup ALT Attribute: https://addons.mozilla.org/firefox/addon/1933

Maybe you are looking for

  • Error while lock object creation

    Hi When I tried to create a lock object, I get the following error. Error: "Total length of lock argument for table XXXXXXXXX longer than 150" I have 3 tables in which Table1 is the check table for the value tables (Table2 & Table3). During the proce

  • Firefox gives a PayPal error & not open; in Internet Explorer opens it.

    when i go to PayPal an error message reads "Sorry - your last action could not be complete" it goes on to say "If you were making a purchase or sending money, we recommend that you check both your PayPal account and your email for a transaction confi

  • Rebuild a XML content inside a XI message

    Hello all, we struck following point during our testing of "JDBC->RFC interface". We have a JDBC adapter which reads records in certain database/table matching the condition. The SQL statement is e.g. like this: select event, datetime, content from t

  • Can it enlarge/re​duce the size of copies?

    For the HP Officejet Pro 8600 e-All-In-One Printer, can it enlarge/reduce the size of the original when making copies?  Same for the 8600 Plus? This question was solved. View Solution.

  • Material Exclusion/Listing Concept

    Hello SAP folks, I have a request regarding Function module for mapping Material Exclusion/Listing concept. I had looked around the SAP system and found out a FM called "PRODUCT_LIST_EXCLUSION". But this FM is not matching the current set of requirem