Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customized tooltip and e_mark_point() (v0.4.4) #488

Closed
awcm0n opened this issue Nov 25, 2022 · 2 comments
Closed

Customized tooltip and e_mark_point() (v0.4.4) #488

awcm0n opened this issue Nov 25, 2022 · 2 comments

Comments

@awcm0n
Copy link

awcm0n commented Nov 25, 2022

When I customize a tooltip for a series, the tooltip for a marked point is undefined.

Screenshot 2022-11-24 at 3 56 19 PM

Is there a way to hide the tooltip or define it seperately for the marked point? Example:

max <- list(
  name = "Max",
  type = "max"
)

USArrests |>
  e_charts(Assault) |>
  e_scatter(Murder) |>
  e_tooltip(formatter = htmlwidgets::JS("
          function(params){
            return('Assault: ' + params.value[0] + 
          '<br />Murder: ' + params.value[1])
          }
        ") ) |>
  e_mark_point(data = max)
@rdatasculptor
Copy link
Contributor

rdatasculptor commented Nov 26, 2022

@awcm0n I have no clear explanation about the why, but this seems to solve your issue:

max <- list(
  name = "Max",
  type = "max"
)

USArrests |>
  e_charts(Assault) |>
  e_scatter(Murder) |>
  e_tooltip(formatter = htmlwidgets::JS("
          function(params){
            return('Assault: ' + params.value[0] + 
          '<br />Murder: ' + params.value[1])
          }
        ") ) |>
  e_mark_point(data = max, tooltip = list(formatter = ""))

@awcm0n
Copy link
Author

awcm0n commented Nov 27, 2022

@rdatasculptor
Thanks for the solution.

@awcm0n awcm0n closed this as completed Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants