Learn R Programming

myIO (version 1.2.0)

setColorScheme: Set Color Scheme

Description

Sets color scheme for a chart and the category names (optional)

Usage

setColorScheme(myIO, colorScheme = NULL, setCategories = NULL)

Value

A modified myIO htmlwidget object with updated color scheme.

Arguments

myIO

an htmlwidget object created by the myIO() function

colorScheme

a vector of colors in the order you want them used

setCategories

an optional vector of names that will be mapped to the corresponding color in the colorScheme

Examples

Run this code
# Set a custom color scheme
myIO() |> setColorScheme(colorScheme = list("red", "blue", "green"))

# Set colors with category labels
myIO() |> setColorScheme(
  colorScheme = list("steelblue", "orange"),
  setCategories = c("Group A", "Group B")
)

Run the code above in your browser using DataLab