Aan de slagGa gratis aan de slag

Removing a piece of hover info

For some chart types, you may not want all of the hover info that is displayed by default. Bar charts are a prime example. You can easily read the grouping values from a bar chart, so only displaying the height of the bar seems reasonable.

In this exercise, your task is to remove the platform labels from the hover info for the bar chart displaying the number of games released for each platform in 2016.

Note that plotly and dplyr have already been loaded for you.

Deze oefening maakt deel uit van de cursus

Interactive Data Visualization with plotly in R

Cursus bekijken

Oefeninstructies

  • Create a bar chart displaying how games are distributed across the platforms (Platform) in the vgsales2016 dataset.
  • Use the hoverinfo argument to display only the height of each bar.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create a bar chart of Platform with hoverinfo only for the bar heights
vgsales2016 %>%
	___ %>%
	___(___, ___, ___) %>%
 	___
Code bewerken en uitvoeren