Learn R Programming

myIO (version 1.2.0)

setAxisFormat: Set Axis Format

Description

Sets axis for x axis, y axis, and/or tool tip

Usage

setAxisFormat(
  myIO,
  xAxis = NULL,
  yAxis = NULL,
  toolTip = NULL,
  xLabel = NULL,
  yLabel = NULL
)

Value

A modified myIO htmlwidget object with updated axis format configuration. with options set for the tooltip formats

Arguments

myIO

an htmlwidget object created by the myIO() function

xAxis

Optional string indicating a d3.js format for the x axis. When NULL, leaves the existing setting unchanged.

yAxis

Optional string indicating a d3.js format for the y axis. When NULL, leaves the existing setting unchanged.

toolTip

Optional string indicating a d3.js format for tooltips. When NULL, leaves the existing setting unchanged.

xLabel

Optional string label for the x axis. When NULL, leaves the existing setting unchanged.

yLabel

Optional string label for the y axis. When NULL, leaves the existing setting unchanged.

Examples

Run this code
# Set axis formats using d3.js format strings
myIO() |> setAxisFormat(xAxis = ".0f", yAxis = ".1f")

# Set axis labels
myIO() |> setAxisFormat(xLabel = "Weight (lbs)", yLabel = "MPG")

# Label-only calls preserve previously configured formats
myIO() |> setAxisFormat(yAxis = ".2f") |> setAxisFormat(yLabel = "Rate")

Run the code above in your browser using DataLab