set_input_click {apexcharter}R Documentation

Retrieve click information in Shiny

Description

According to type of chart, different values are retrieved:

Usage

set_input_click(
  ax,
  inputId,
  multiple = FALSE,
  effect_type = c("darken", "lighten", "none"),
  effect_value = 0.35,
  session = shiny::getDefaultReactiveDomain()
)

Arguments

ax

An apexchart() htmlwidget object.

inputId

The id that will be used server-side for retrieving click.

multiple

Allow multiple selection: TRUE or FALSE (default).

effect_type

Type of effect for selected element, default is to use lightly darken color.

effect_value

A larger value intensifies the select effect, accept value between 0 and 1.

session

The Shiny session.

Value

An apexchart() htmlwidget object.

Note

If x-axis is of type datetime, value retrieved is of class POSIXct.

Examples


library(apexcharter)

# Not in Shiny but you can still click on bars
data.frame(
  month = month.abb,
  value = sample(1:100, 12)
) %>% 
  apex(aes(month, value)) %>% 
  set_input_click("month_click", multiple = TRUE)


# Interactive examples:
if (interactive()) {

  run_demo_input("click")

}

[Package apexcharter version 0.4.2 Index]