Forum Discussion

az2451's avatar
az2451
Resolver I
8 years ago
Solved

Rename tooltip names in ggplot2

I'm trying to rename the names which are shown in the tooltip in a qplot   By using aes it worked so far but then i got the problem, that the values are incorrect because i dont know how to read ea...
  • v-viig's avatar
    8 years ago

    You might send an email to [email protected]. There're expirienced R-script developers who is able to assist.

     

    Ignat Vilesov,

    Software Engineer

     

    Microsoft Power BI Custom Visuals

    [email protected]

  • az2451's avatar
    az2451
    8 years ago

    You can access to the tooltip labels in this way:

     

    p = ggplotly(fp);
    
      #tooltips on scatter
      p$x$data[[1]]$text = generateNiceTooltips(dataset[drawPoints,])
      
      #tooltips on lines
      p$x$data[[2]]$text = paste(as.character(conf1*100),"% limits (l)",sep ="")
      p$x$data[[3]]$text = paste(as.character(conf1*100),"% limits (u)",sep ="")
      p$x$data[[4]]$text = paste(as.character(conf2*100),"% limits (l)",sep ="")
      p$x$data[[5]]$text = paste(as.character(conf2*100),"% limits (u)",sep ="")
      p$x$data[[6]]$text = paste("baseline ", as.character(round(p.fem,4)), sep ="")
      
    # save HTML with predefined name 
    internalSaveWidget(p, 'out.html')

     

    See more