Laurence_jj
Laurence_jj

Reputation: 726

How can you add flags to points on a graph

Is it possible to add flags to points in highcharter using R? (such as in the image bellow)

I would imagine that based off the value in my data such as in the bellow set up:

table1 <- fread(
  "value | date       |  note
       1.0             |  2018-01-02  | NA
       1.1             |  2018-01-03  | NA
       1.2             |  2018-01-04  | b
       1.15             |  2018-01-05 | NA
       1.4             |  2018-01-06  | b", 
  sep ="|"
)

table1$date = as.Date(table1$date)

highchart() %>%
  hc_xAxis(type = "datetime", dateTimeLabelFormats = list(day = '%d of %b')) %>%
  hc_add_series(table1, type="line", hcaes(x=date, y=value) )

Where note would indicate the flag to be put on the graph by the point.

enter image description here

Upvotes: 0

Views: 293

Answers (1)

raf18seb
raf18seb

Reputation: 2146

You can find a demo example of flags in R in Highstock on the official Highcharter website: https://jkunst.com/highcharter/articles/stock.html

Upvotes: 1

Related Questions