xg_chart | R Documentation |
Plot an xG chart of a football match
xg_chart(
match_id,
home_team_color,
away_team_color,
competition = "",
bg_color = "#FFF1E5",
plot_bg_color = "#FFF1E5"
)
match_id |
Match ID from understat.com |
home_team_color |
Color used for the home team |
away_team_color |
Color used for the away team |
competition |
Competition name as a subtitle; empty by default. |
bg_color |
Chart background color; defaults to "#FFF1E5" |
plot_bg_color |
Plot background color; defaults to "#FFF1E5" |
Interactive highcharter plot displaying the xG chart of both teams.
xg_chart(26631, "red", "grey", competition = "Premier League")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.