Having tooltip trouble

I'm having some tootip issues. The scenario is I'm returning some data from an EJB (which is working). You're supposed hover over a mark on a scatter chart, and it gives you some information about that mark. I can't get it to work. Maybe I'm being too simple about the way I've coded it? Anyway, here's my code:
("array" comes from the EJB, and each entry in that array is another array)
        XYChart.Series<Number, Number> normalSeries = new XYChart.Series<>();
        XYChart.Series<Number, Number> negativeOutlierSeries = new XYChart.Series<>();
        XYChart.Series<Number, Number> positiveOutlierSeries = new XYChart.Series<>();
        for (int i = 0; i < array.size(); i++) {
            ArrayList arr = (ArrayList) array.get(i);
            // intercept, slope
            XYChart.Data data = new XYChart.Data(arr.get(0), arr.get(1));
            System.out.println("tooltip: " + arr.get(3));
            // tooltip
            Tooltip.install(data.getNode(), new Tooltip(arr.get(3).toString()));
            // check outlier
            if (Integer.parseInt(arr.get(2).toString()) == 0) {
                normalSeries.getData().add(data);
            // if the outlier isn't zero, check slope
            } else if (Float.parseFloat(arr.get(1).toString()) < 0) {
                negativeOutlierSeries.getData().add(data);
            } else {
                positiveOutlierSeries.getData().add(data);
        sc.getData().addAll(normalSeries, negativeOutlierSeries, positiveOutlierSeries);
        sc.setLegendVisible(false);The chart displays okay, but when I hover over one of the marks, it doesn't show me anything. I must be doing something wrong, but what?
Thanks!

The other mechanism in that thread seems to work ok:
import java.util.Random;
import javafx.application.Application;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.ScatterChart;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import static javafx.scene.chart.XYChart.*;
public class ScatterChartTest extends Application {
  @Override
  public void start(Stage primaryStage) throws Exception {
    BorderPane root = new BorderPane();
    NumberAxis xaxis = new NumberAxis();
    NumberAxis yaxis = new NumberAxis();
    ScatterChart<Number, Number> scatterPlot = new ScatterChart<>(xaxis, yaxis);
    Series<Number, Number> series = new Series<>();
    series.setName("Random Data");
    Random rng = new Random();
    for (int i=0; i<10; i++) {
      final double x = rng.nextDouble();
      final double y = rng.nextDouble();
      final Data<Number, Number> datum = new Data<Number, Number>(x, y, String.format("x=%.3f%ny=%.3f",x,y));
      series.getData().add(datum);
      // When node is installed on datum, register a Tooltip on it:
      datum.nodeProperty().addListener(new ChangeListener<Node>() {
        @Override
        public void changed(ObservableValue<? extends Node> observable,
            Node oldValue, Node newValue) {
          if (newValue != null) {
            Tooltip.install(newValue, new Tooltip(datum.getExtraValue().toString()));
            datum.nodeProperty().removeListener(this);
    scatterPlot.getData().add(series);
    root.setCenter(scatterPlot);
    primaryStage.setScene(new Scene(root, 600, 600));
    primaryStage.show();
  public static void main(String[] args) {launch(args);}
}

Similar Messages

  • I'm having big trouble with my new mainboard: Part II

    Hi  
    I haven't got any more replies to my post "I'm having big trouble with my new mainboard" by Krelian 2003.09.13 at 05:25. Please help! I've been struggling with this for a LONG time. And now my computer won't boot at all! Sometimes the LED's in front of the computer lights up for half a second, and nothing more happens. The only sign of life is the green light in the LAN jack. It happened after I took the ide cable for my harddrive in and out of the mainboard. This is insane, how can that suddeny happen :O ?! I was asked by wonkanoby to post max amps for my PSU, I did, and I really need to know if I maybe need a new PSU, since he asked that. Can a new PSU solve all the problems mentioned in my previous posts? Everything was fine except that I couldn't get into Windows, before i tried another harddrive on my computer. How can that complicate things so much? I have tried going barebone, and taking out the cmos battery and setting the jumpers JBAT1, J10 and J11. I have also tried every suggestion I got. Please help! I really need to get this fixed!
    -Krelian

    Some power supplies or designed so that if there is a short or overload they shut them selfs off and some will not turn back on. Some have a relay that will click back on and work, some you have to  cycle the power switch. Those that won't come back on will have to be replaced. I'm not saying that yours is that type as I have no way of telling. But if you have a friend who will loan you a good power supply you might try it. As someone else said just turning off the power will not darn all the power from some motherboards. To test this turn off your power supply than turn on the computer with the start botton. Mine will flash the lights and fans will start to spin than die. So every time you turn off computer to work on it. After turning off PSU hit the start botton to drian any power left in it before working on it. Also do this after unplugging it just to make sure.

  • HT201342 I am having some trouble trying to back up my notes to my iCloud account, i have tried to delete my icloud account and create a new one, but still when i back my phone up on iCloud my notes do not seem to be backed up.How can i back up by notes o

    I am having some trouble trying to back up my notes to my iCloud

    Not photos, just data synced with iCloud shown in Settings>iCloud.  If you don't have sufficient storage to back up to iCloud, back up to your computer instead using iTunes (connect you phone to your computer, open iTunes, click on the name of your phone in iTunes, go to ths Summary tab of your iTunes sync settings and click Back Up Now).  Also transfer your purchases to your iTunes library (connect your phone to your computer, open iTunes and go to File>Devices>Transfer Purchases). If you have photo stream photos older than 30 days tha you wan to save, save these to your camera roll before backing up (tap Select, tap the photos, tap the share icon -- box with upward facing arrow, then tap Save to Camera Roll).
    When setting up your new phone, when given the option choose Restore from iTunes Backup and restore the backup you made earlier.

  • I'm having some trouble transferring audio books to my iPhone.  It usually takes 3 or 4 tries to get all the parts transferred.  I didn't use to have this problem - all parts would transfer in one try.

    I'm having some trouble transferring audio books to my iPhone.  It usually takes 3 or 4 tries to get all the parts transferred.  I didn't use to have this problem - all parts would transfer in one try.

    carolinechx wrote:
    i know the description may be a little bit too confusing
    Mostly because you are not using any capital letters or paragraph returns and your post is difficult to read.

  • Hello everyone! I'm having a trouble... I need to download Adobe Illustrator for windows 8, but i'm not able for doing that. Can you help me Please?

    Hello everyone! I'm having a trouble... I need to download Adobe Illustrator for windows 8, but i'm not able for doing that. Can you help me Please?

    Downloadable installation files available:
    Suites and Programs:  CC 2014 | CC | CS6 | CS5.5 | CS5 | CS4, CS4 Web Standard | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  13 | 12 | 11, 10 | 9, 8, 7 win | 8 mac | 7 mac
    Photoshop Elements:  13 |12 | 11, 10 | 9,8,7 win | 8 mac | 7 mac
    Lightroom:  5.7.1| 5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5.5, 5 | 1
    Contribute:  CS5 | CS4, CS3 | 3,2
    FrameMaker:  12, 11, 10, 9, 8, 7.2
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • HI I'm having real trouble opening my word documents (using Office:Mac 2008)  Have tried repair disk options as I saw this advice on another blog, seemed to work for a while now its stared happening again.  Any help MUCH appreciated

    HI I'm having real trouble opening my word documents (using Office:Mac 2008)  Have tried repair disk options as I saw this advice on another blog, seemed to work for a while now its stared happening again.  Any help MUCH appreciated

    http://answers.microsoft.com/en-us/mac

  • I'm having a trouble getting icloud mail without my personal email. All icloud features syncs unless mail didn't sync I am running mac ox 10.7.2 any ideas?

    I’m having a trouble getting icloud mail without my personal email. All icloud features syncs normally unless mail didn’t sync I am running mac ox 10.7.2 any ideas?

    I discovered that my cord was bad. I used someone else's cord and then it worked - that's how I was able to determine it was the cord, so I replaced it. (In case someone else has a similar problem.)
    BTW, I'm still having a problem syncing my iCal, so I posted that problem in the iCal forum. If you think you can help, please look for my message there.

  • TS3276 I have installed OS X Mavericks on macbook pro, macbook air & iMac but I am having terrible trouble with apple Mail. I need to take all accounts online frequently OR worse I have to quit mail and restart computer. Is anyone else having problems?

    I have installed OS X Mavericks on macbook pro, macbook air & iMac but I am having terrible trouble with apple Mail. I need to take all accounts online frequently OR worse I have to quit mail and restart computer. Is anyone else having problems?

    I just checked to see if the update to OS X Yosemite 10.10.1 solved any of the issues outlined in my previous post, and to my dismay, nothing has changed -- all of the previous problems persist.
    My iMac (8) -- it's renamed itself eight times since the recent troubleshoot with the Apple tech rep -- shows up as a shared device in Finder on my MacBook Pro, but when I click on it, I cannot establish a connection using "Connect As".  So I've attempted to connect using the menu "Go/Connect to Server...", using both (alternately) the iMac's name and IP address, to no avail.  I get a message which reads: "There was a problem connecting to the server 'Peter's iMac (8)'. This server may not exist or it is unavailable at this time.  Check the server name or IP address, check your network connection, and then try again."
    Here's what I know:
    The server -- Peter's iMac (8) does exist;
    The server -- Peter's iMac (8) is available at this time;
    The server name -- Peter's iMac (8) -- is correct, as specified in the system sharing preferences;
    The server IP address is correct, as specified in the system sharing preferences;
    The network connection is active when I attempt to connect.
    I'm convinced the problems stem directly from the OS X Yosemite update.  None of this was ever remotely an issue in the previous OS X's -- any of them.  This is maddening!  What can be done?  Apple?? Anyone???

  • I am having download trouble...

    Exit Code: 6
    Please see specific errors below for troubleshooting. For example, ERROR:
    -------------------------------------- Summary --------------------------------------
    - 0 fatal error(s), 2 error(s)
    ----------- Payload: Microsoft Visual C++ 2012 Redistributable Package (x86) 11.0.61030.0 {873BE68F-480F-49A6-9649-F98CAB056AFC} -----------
    ERROR: Third party payload installer vcredist_x86.exe failed with exit code: -2147024546
    ERROR: Failed to install Microsoft Visual C++ 2012 Redistributable Package (x86). Please try installing it by double clicking on the executable at "C:\Users\Admin\AppData\Local\Temp\{7C4DC876-83A1-49B9-8662-C737F8A5B9AB}\Illustrator_18_ LS20_win64\Adobe Illustrator CC 2014\payloads\Microsoft VC 2012 Redist (x86)\vcredist_x86.exe", or download and install the latest Microsoft Visual C++ 2012 Redistributable Package (x86) from Microsoft website - www.microsoft.com
    i am having download trouble...

    **** roko10044517 did you reinstall the Microsoft Visual C++ Redistrubitable per the error message you posted?
    "download and install the latest Microsoft Visual C++ 2012 Redistributable Package (x86) from Microsoft website - www.microsoft.com"

  • Since the iOS 7 update on my iPhone 4S the pictures I take are all blurred and it's not just mine I know of at least 10 of my friends having same trouble ???

    Since the iOS 7 update on my iPhone 4S the pictures I take are all blurred and it's not just mine I know of at least 10 of my friends having same trouble does anybody know why or is anybody else having the same trouble ????

    See if this helps you with the wifi issue. http://support.apple.com/kb/TS1559

  • I'm running Windows XP and FF 8.0. I'm having more trouble than ever with intermittent streaming and videos not playing all the way through. What is the easiest way to fix this?

    . I'm running Windows XP and FF 8.0. I'm having more trouble than ever with intermittent streaming and videos not playing all the way through. What is the easiest way to fix this?

    That may be a problem with the VLC plugin. VLC has never worked for me properly on the occasions that I've tried it on Windows and Linux, so I have stop using it. There are usually other plugins or media players available that work better.
    What kind of media files are that?
    For WMP files you can install the new Windows Media Player plugin you can also try RealPlayer and QuickTime if it is about media that those programs can handle to see if that works better.
    * https://support.mozilla.com/kb/Using+the+Windows+Media+Player+plugin+with+Firefox
    * http://kb.mozillazine.org/Windows_Media_Player#Missing_plugin
    * http://www.interoperabilitybridges.com/windows-media-player-firefox-plugin-download

  • I'm having a trouble with my iPhone iMessage.

    I'm having a trouble with my iPhone iMessage.
    I cannot send any pictures through iMessage only to my friend who's using iPhone4s.
    iMessage without a picture goes well.
    When I used iPhone5, everything worked fine.
    But after I change my phone from 5 to iPhone5s, it's not working well.
    please help me.
    (sending pictures to friends using iPhone5&5s is working fine. It just not works with that friend(who is using 4s) only.)

    Try this on the iPhone 5s go into settings turn iMessage off wait about 60 secs then turn it back on...under iMessage you will see it say waiting for activation...when it changes it will give a message that says iMessage can be sent blah blah blah...after you see that you will see an option that says send and receive ...click that...it should bring you yo a page that say you can be reached by iMessage at you should see you phone number with a check mark..it will be light grey...don't worry about signing into you Apple ID... You only need to do that if you are connecting you iPhone to another device (Mac, iPad, iPod touch) to receive the same iMessages on both...after that go back to the first message settings page again and at the bottom you will see mms messaging turn that off then back on....after that's done..tap you home key and send a test message
    If it still doesn't work follow this http://support.apple.com/kb/ts2755

  • I am having big troubles by sending emails - not receive them

    I am having big troubles by sending emails! I can receive them, but as soon as I want to send an email myself, then it 1) says that the email is too big, or 2) says that my password is wrong, or 3) says that the server is out of function. Anyone knows how to solve this problem?

    Mail (Mountain Lion): Solve Mail problems

  • I believe I am having power trouble

    I believe I am having power trouble. One day my computer worked and then the next it did not. When I plug the power cord in it is green momentarily and then turns and stays orange. Also, when I turn the computer on the screen stays blank, but the little light next to the button that opens the lid is on. Thoug it is dim and blinks a little.
    Please help thank you!

    Take it in for service.

  • HT5569 I'm having major trouble shooting wifi and when ever I go up stairs I loose connection

    I am having major trouble shooting wifi everytime I go up stairs I loose connection and this never happen until a week ago when I updated to iOS 7.0.4

    Can you rephrase "shooting wifi"? 

Maybe you are looking for