I am trying to create a gauge plot as the following image:
The df is:
df <- structure(list(Genero = c("Hombre", "Mujer"), Media = c(46.7,
53.3)), row.names = c(NA, -2L), class = c("etable", "data.frame"
))
And the code that I’ve been trying is:
stops <- list_parse2(df)
highchart() %>%
hc_chart(type = ‘solidgauge’) %>%
hc_pane(
startAngle = -90,
endAngle = 90,
background = list(
outerRadius = ‘100%’,
innerRadius = ‘60%’,
shape = ‘arc’
)
) %>%
hc_yAxis(
stops = stops,
lineWidth = 0,
minorTickWidth = 0,
tickAmount = 2,
min = 0,
max = 100,
labels = list(y = 25)
) %>%
hc_add_series(
data = df$Media,
color = ‘#EB6909’
) %>%
hc_exporting(enabled = TRUE) %>%
hc_plotOptions(series = list(animation = FALSE))