I've been attempting to include annotations in my highcharter chart, but for some reason, it's not working and is displaying [object][object] instead.
Below is the data:
structure(list(variable = structure(c(15522, 15553, 15584, 15614,
15645, 15675, 15706, 15737, 15765, 15796), class = "Date"), value = c(417376,
423563, 430290, 455643, 451542, 422419, 429472, 451694, 454900,
456844)), row.names = c(NA, 10L), .Names = c("variable", "value"
), class = "data.frame")
The code I'm using is to add annotation specifically for the last value on the graph, potentially within a rectangle box.
currmonth <- max(pricedata$variable)
pricedata$value <- round(pricedata$value)
highchart(type = "chart") %>%
hc_chart(backgroundColor = "white",zoomType = 'x') %>%
hc_add_series_times_values(pricedata$variable, pricedata$value, name = "Price") %>%
hc_annotations(list(xValue = currmonth, title = list(text = 'Annotated chart!')))
Here is the visual representation of the chart:
https://i.sstatic.net/2ZkAl.png
You'll notice that the annotation appears as [object][object] in the top left corner.
UPDATE: After trying out the solution provided, unfortunately, it did not work.
https://i.sstatic.net/Lma8d.png