I'm currently using the R package highcharter
to create a simple Sankey diagram from a data set describing funding for multiple projects. The Sankey is quite simple: it has nodes for Funders, nodes for Projects, and flows weighted by annual spending and coloured by level of completion. All of that works, but I cannot seem to get all my node labels to appear. The smallest nodes consistently do not have labels, and I was wondering if I can force all the labels to appear?
My code looks like this:
hchart(df, "sankey",
hcaes(from = Funder, to = Project, weight = AnnualFund, color = Complete)) %>%
hc_plotOptions(sankey = list(dataLabels = list(enabled = TRUE, style = list(fontSize = "12px"))))
I expected the nodes to all be labelled, but the smallest ones consistently do not receive a label even with the plot made full screen. I've tried bumping the font size up and down as well. I feel like I'm missing something small but I cannot get it to work. Everything else about the plot works, though.
EDIT - My data looks like 121 rows of this:
structure(list(
Funder = c(4, 7, 6, 4, 6, 6),
AnnualFund = c(1913, 365, 1757, 963, 2006, 1876),
Project = c("G", "A", "C", "E", "B", "E"),
Complete = c("Late", "NotStarted", "Completed", "Middle", "Late", "Completed")),
row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"))
Essentially, there are 10 funders, the amounts of annual funding contributed, 7 possible projects, and 5 stages of completion.