Skip to contents

Theme for Charts

Usage

v_theme(
  vc,
  .colorPalette = NULL,
  .backgroundColor = NULL,
  .borderColor = NULL,
  .shadowColor = NULL,
  .hoverBackgroundColor = NULL,
  .sliderRailColor = NULL,
  .sliderHandleColor = NULL,
  .sliderTrackColor = NULL,
  .popupBackgroundColor = NULL,
  .primaryFontColor = NULL,
  .secondaryFontColor = NULL,
  .tertiaryFontColor = NULL,
  .axisLabelFontColor = NULL,
  .disableFontColor = NULL,
  .axisMarkerFontColor = NULL,
  .axisGridColor = NULL,
  .axisDomainColor = NULL,
  .dataZoomHandleStrokeColor = NULL,
  .dataZoomChartColor = NULL,
  .playerControllerColor = NULL,
  .scrollBarSliderColor = NULL,
  .axisMarkerBackgroundColor = NULL,
  .markLabelBackgroundColor = NULL,
  .markLineStrokeColor = NULL,
  .dangerColor = NULL,
  .warningColor = NULL,
  .successColor = NULL,
  .infoColor = NULL,
  .discreteLegendPagerTextColor = NULL,
  .discreteLegendPagerHandlerColor = NULL,
  .discreteLegendPagerHandlerDisableColor = NULL,
  ...
)

Arguments

vc

An htmlwidget created with vchart().

.colorPalette

Vector of colors to use as default.

.backgroundColor

background Color

.borderColor

border Color

.shadowColor

shadow Color

.hoverBackgroundColor

hoverBackground Color

.sliderRailColor

slider Rail Color

.sliderHandleColor

slider Handle Color

.sliderTrackColor

slider Track Color

.popupBackgroundColor

popup Background Color

.primaryFontColor

primary Font Color

.secondaryFontColor

secondary Font Color

.tertiaryFontColor

tertiary Font Color

.axisLabelFontColor

axisLabel Font Color

.disableFontColor

disable Font Color

.axisMarkerFontColor

axis Marker Font Color

.axisGridColor

axis Grid Color

.axisDomainColor

axis Domain Color

.dataZoomHandleStrokeColor

data Zoom Handle Stroke Color

.dataZoomChartColor

data Zoom Chart Color

.playerControllerColor

player Controller Color

.scrollBarSliderColor

scroll Bar Slider Color

.axisMarkerBackgroundColor

axis Marker Background Color

.markLabelBackgroundColor

mark Label Background Color

.markLineStrokeColor

mark Line Stroke Color

.dangerColor

danger Color

.warningColor

warning Color

.successColor

success Color

.infoColor

info Color

.discreteLegendPagerTextColor

discrete Legend Pager Text Color

.discreteLegendPagerHandlerColor

discrete Legend Pager Handler Color

.discreteLegendPagerHandlerDisableColor

discrete Legend Pager Handler Disable Color

...

Other parameters.

Value

A vchart() htmlwidget object.

Examples


library(vchartr)

chart <- subset(
  electricity_mix,
  country %in% c("Germany", "Brazil", "South Korea")
) %>%
  vchart() %>%
  v_bar(aes(country, generation, fill = source))

# Default appearance
chart
# Change background color chart %>% v_theme(.backgroundColor = "#2F2E2F")
# Change default color palette chart %>% v_theme( .colorPalette = palette.colors(n = 8, palette = "Okabe-Ito")[-1] )
# Axis grid color chart %>% v_theme(.axisGridColor = "red")
# same as chart %>% v_theme( component = list( axis = list( grid = list( style = list( # lineWidth = 3, # but more options available stroke = "red" ) ) ) ) )
# see https://www.unpkg.com/@visactor/vchart-theme@1.11.6/public/light.json # for all possibilities