LoslegenKostenlos loslegen

Custom hoverinfo

In this exercise your task is to customize the hover info to help explore the relationship between North American video game sales and European video game sales in 2016.

Once you have created the chart and the custom hover info, try to identify the video games with the greatest discrepancy between the North American and European sales.

Note that plotly has already been loaded for you.

Diese Übung ist Teil des Kurses

Interactive Data Visualization with plotly in R

Kurs anzeigen

Anleitung zur Übung

  • Customize the hover info text to include the name and value for each of the following variables (in the specified order): NA_Sales, EU_Sales, and Name.
  • Separate the name and the value with a colon. For example, the first line should be of the form: NA_Sales: 41.4.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Format the hover info for NA_Sales, EU_Sales, and Name
vgsales2016 %>%
  plot_ly(x = ~NA_Sales, y = ~EU_Sales,
          hoverinfo = ___,
          text = ___(___, ___, ___,
                     ___, ___, ___,
                     ___, ___)
  ) %>%
  add_markers()
Code bearbeiten und ausführen