title: ggvis multiple lines with tooltips
body: <p>I am trying to create an interactive Version of this plot:
  <a href="https://i.stack.imgur.com/iATLn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iATLn.png" alt="GGplot Graph"></a></p>
  
  <p>So far I have the following code that creates an interactive plot but is not exactly what I am looking for:</p>
  
  <pre><code>#Create Data
  library(ggvis)
  set.seed(123)
  tdat &lt;- data.frame(group = rep(LETTERS[1:2], each = 50),
                 time = rep(seq(from = as.Date("2010-01-01"), length.out = 50, by = "day"), 2),
                 val = c(cumsum(rnorm(50)) + 100,
                         cumsum(rnorm(50)) + 100))
  
  # ggvis Code
  # Function for the tooltip
  getData &lt;- function(dat){
      paste(paste("Time:", as.character(dat$time)),
      paste("Group:", as.character(dat$group)),
      paste("Value:", dat$val),
      sep = "&lt;br /&gt;")
  }
  
  # Visualisation
  tdat %&gt;% ggvis(~time, ~val, stroke = ~group) %&gt;% layer_lines(strokeWidth := 1) %&gt;%
       layer_points(size = 1, fill = ~group) %&gt;% add_tooltip(getData)
  </code></pre>
  
  <p>This results in the following plot:
  <a href="https://i.stack.imgur.com/XwqH7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XwqH7.png" alt="GGvis Plot"></a>
  There are however some issues:</p>
  
  <p>1) I don't want to have points, just lines. Without the layer_points, there are no tooltips...</p>
  
  <p>2) The variable time is a date but shows up as an integer. How can I fix the ugly number?</p>
  
  <p>Thank you very much.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>The field of the tooltip can be formated to date if it is coerced to a char before calling the ggvis function but it introduces other issues. For example, the x-axis does not shown properly.</p>