I'm trying to build a column chart through highchart in r studio. I've converted the values to % as I want the graph to show %, but I want the data labels to show the value, is there a way of doing this?
My data set has a column with the values for London and the percentages for London, I want the Y axis of the graph to show the % while the data labels show the value.
This is my current code:
hc <- highchart() %>%
hc_title(text= "Gender - London")%>%
hc_colors('#71599b') %>%
hc_yAxis(max = 0.7) %>%
hc_xAxis(categories = Sex$Gender) %>%
hc_add_series(name = "London", type = "column",
data = Sex$LON_PERC, dataLabels = list(enabled=TRUE, format={Sex$London}) )
So, I've put Sex$LON_PERC (% in London) as the data to plot while Sex$London is the data labels.
But this code puts all the values of London in each data label.
Edit:
This is the data I'm trying to plot, LON_PERC on the Y Axis, Gender on the X axis and London as the Data Labels
Gender London LON_PERC
Declined 5 0.000351247
Female 8230 0.578152441
Male 4640 0.325957148
No Data 1360 0.095539164