Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bb_gaugechart

Helper for creating a gauge


Description

Helper for creating a gauge

Usage

bb_gaugechart(
  bb,
  value,
  name = "Value",
  steps = c(30, 60, 90, 100),
  steps_color = c("#FF0000", "#F97600", "#F6C600", "#60B044"),
  ...
)

Arguments

bb

A billboard htmlwidget object.

value

A numeric value.

name

Name for the value, appear in tooltip.

steps

Upper bound for changing colors

steps_color

Colors corresponding to steps

...

Arguments for slot gauge.

Value

A billboard htmlwidget object.

Note

This function can be used with billboarderProxy in shiny application.

Examples

billboarder() %>% 
  bb_gaugechart(value = 50)

# With some options
billboarder() %>% 
  bb_gaugechart(
    value = 160,
    steps_color = rev(c("#FF0000", "#F97600", "#F6C600", "#60B044"))
  ) %>% 
  bb_gauge(
    label = list(format = suffix("km/h")),
    min = 10, max = 200, width = 20
  )

billboarder

Create Interactive Chart with the JavaScript 'Billboard' Library

v0.3.1
MIT + file LICENSE
Authors
Victor Perrier [aut, cre], Fanny Meyer [aut], NAVER Corp [cph] (billboard.js library), Mike Bostock [cph] (d3.format library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.