Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


highcharter (version 0.8.2)

hc_add_dependency_fa: Helpers functions to get FontAwesome icons code

Description

Helpers functions to get FontAwesome icons code

Usage

hc_add_dependency_fa(hc)

fa_icon(iconname = "circle")

fa_icon_mark(iconname = "circle")

Arguments

hc

A highchart htmlwidget object.

iconname

The icon's name

Examples

Run this code
# NOT RUN {
dcars <- data.frame(x = runif(10), y = runif(10))
dtrck <- data.frame(x = rexp(10), y = rexp(10))

highchart() %>%
  hc_chart(zoomType = "xy") %>%
  hc_tooltip(
    useHTML = TRUE,
    pointFormat = paste0(
      "<span style=\"color:{series.color};\">{series.options.icon}</span>",
      "{series.name}: <b>[{point.x}, {point.y}]</b><br/>"
    )
  ) %>%
  hc_add_series(dcars, "scatter",
    marker = list(symbol = fa_icon_mark("car")),
    icon = fa_icon("car"), name = "car"
  ) %>%
  hc_add_series(dtrck, "scatter",
    marker = list(symbol = fa_icon_mark("plane")),
    icon = fa_icon("plane"), name = "plane"
  ) %>%
  hc_add_dependency_fa()
fa_icon("car")
fa_icon_mark("car")
fa_icon_mark(iconname = c("car", "plane", "car"))
# }

Run the code above in your browser using DataLab