title: Tooltip on Line Chart showing Date
body: <p>I want to add Tooltip when I move cursor over a chart line. I found this example:</p>
  
  <pre><code>import java.util.concurrent.ConcurrentLinkedQueue;
  import java.util.concurrent.ExecutorService;
  import java.util.concurrent.Executors;
  import java.util.concurrent.ThreadFactory;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  import javafx.animation.AnimationTimer;
  import javafx.application.Application;
  import javafx.scene.Scene;
  import javafx.scene.chart.AreaChart;
  import javafx.scene.chart.LineChart;
  import javafx.scene.chart.NumberAxis;
  import javafx.scene.chart.XYChart;
  import javafx.stage.Stage;
  
  
  public class AnimatedLineChart extends Application {
  
      private static final int MAX_DATA_POINTS = 50;
      private int xSeriesData = 0;
      private XYChart.Series series1;
      private XYChart.Series series2;
      private XYChart.Series series3;
      private ExecutorService executor;
      private AddToQueue addToQueue;
      private ConcurrentLinkedQueue&lt;Number&gt; dataQ1 = new ConcurrentLinkedQueue&lt;Number&gt;();
      private ConcurrentLinkedQueue&lt;Number&gt; dataQ2 = new ConcurrentLinkedQueue&lt;Number&gt;();
      private ConcurrentLinkedQueue&lt;Number&gt; dataQ3 = new ConcurrentLinkedQueue&lt;Number&gt;();
  
      private NumberAxis xAxis;
  
      private void init(Stage primaryStage) {
          xAxis = new NumberAxis(0,MAX_DATA_POINTS,MAX_DATA_POINTS/10);
          xAxis.setForceZeroInRange(false);
          xAxis.setAutoRanging(false);
  
  
          xAxis.setTickLabelsVisible(false);
          xAxis.setTickMarkVisible(false);
          xAxis.setMinorTickVisible(false);
  
          NumberAxis yAxis = new NumberAxis();
          yAxis.setAutoRanging(true);
  
          //-- Chart
          final LineChart&lt;Number, Number&gt; sc = new LineChart&lt;Number, Number&gt;(xAxis, yAxis) {
              // Override to remove symbols on each data point
              @Override protected void dataItemAdded(Series&lt;Number, Number&gt; series, int itemIndex, Data&lt;Number, Number&gt; item) {}
          };
          sc.setAnimated(false);
          sc.setId("liveLineeChart");
          sc.setTitle("Animated Line Chart");
  
          //-- Chart Series
          series1 = new XYChart.Series&lt;Number, Number&gt;();
          series2 = new XYChart.Series&lt;Number, Number&gt;();
          series3 = new XYChart.Series&lt;Number, Number&gt;();
          sc.getData().addAll(series1, series2, series3);
  
          primaryStage.setScene(new Scene(sc));
      }
  
  
  
  
  
      @Override public void start(Stage stage) {
          stage.setTitle("Animated Line Chart Sample");
          init(stage);
          stage.show();
  
  
          executor = Executors.newCachedThreadPool(new ThreadFactory() {
              @Override public Thread newThread(Runnable r) {
                  Thread thread = new Thread(r);
                  thread.setDaemon(true);
                  return thread;
              }
          });
          addToQueue = new AddToQueue();
          executor.execute(addToQueue);
          //-- Prepare Timeline
          prepareTimeline();
  
  
      }
  
      private class AddToQueue implements Runnable {
          public void run() {
              try {
                  // add a item of random data to queue
                  dataQ1.add(Math.random());
                  dataQ2.add(Math.random());
                  dataQ3.add(Math.random());
  
                  Thread.sleep(500);
                  executor.execute(this);
              } catch (InterruptedException ex) {
                  ex.printStackTrace();
              }
          }
      }
  
    //-- Timeline gets called in the JavaFX Main thread
      private void prepareTimeline() {
          // Every frame to take any data from queue and add to chart
          new AnimationTimer() {
              @Override public void handle(long now) {
                  addDataToSeries();
              }
          }.start();
      }
  
      private void addDataToSeries() {
          for (int i = 0; i &lt; 20; i++) { //-- add 20 numbers to the plot+
              if (dataQ1.isEmpty()) break;
              series1.getData().add(new AreaChart.Data(xSeriesData++, dataQ1.remove()));
              series2.getData().add(new AreaChart.Data(xSeriesData++, dataQ2.remove()));
              series3.getData().add(new AreaChart.Data(xSeriesData++, dataQ3.remove()));
          }
          // remove points to keep us at no more than MAX_DATA_POINTS
          if (series1.getData().size() &gt; MAX_DATA_POINTS) {
              series1.getData().remove(0, series1.getData().size() - MAX_DATA_POINTS);
          }
          if (series2.getData().size() &gt; MAX_DATA_POINTS) {
              series2.getData().remove(0, series2.getData().size() - MAX_DATA_POINTS);
          }
          if (series3.getData().size() &gt; MAX_DATA_POINTS) {
              series3.getData().remove(0, series3.getData().size() - MAX_DATA_POINTS);
          }
          // update 
          xAxis.setLowerBound(xSeriesData-MAX_DATA_POINTS);
          xAxis.setUpperBound(xSeriesData-1);
      }
  
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>For example I would like to display something like this:</p>
  
  <p><img src="https://i.stack.imgur.com/4w4qG.png" alt="enter image description here"></p>
  
  <p>Is this possible with JavaFX 8? On mouse hover it is showing <code>Date</code>.</p>
  
  <p>Is there any similar example that I can use for my case?</p>