2018-07-31 22:56:51 +02:00
|
|
|
% Generated by roxygen2: do not edit by hand
|
|
|
|
% Please edit documentation in R/apex-utils.R
|
|
|
|
\name{ax_yaxis}
|
|
|
|
\alias{ax_yaxis}
|
|
|
|
\title{Y-axis options}
|
|
|
|
\usage{
|
2019-11-26 10:17:42 +01:00
|
|
|
ax_yaxis(
|
|
|
|
ax,
|
|
|
|
opposite = NULL,
|
|
|
|
tickAmount = NULL,
|
|
|
|
max = NULL,
|
|
|
|
min = NULL,
|
|
|
|
floating = NULL,
|
|
|
|
labels = NULL,
|
|
|
|
axisBorder = NULL,
|
|
|
|
axisTicks = NULL,
|
|
|
|
title = NULL,
|
|
|
|
tooltip = NULL,
|
|
|
|
crosshairs = NULL,
|
|
|
|
...
|
|
|
|
)
|
2018-07-31 22:56:51 +02:00
|
|
|
}
|
|
|
|
\arguments{
|
|
|
|
\item{ax}{A \code{apexcharts} \code{htmlwidget} object.}
|
|
|
|
|
|
|
|
\item{opposite}{Logical. When enabled, will draw the yaxis on the right side of the chart.}
|
|
|
|
|
|
|
|
\item{tickAmount}{Number of Tick Intervals to show.}
|
|
|
|
|
|
|
|
\item{max}{Lowest number to be set for the y-axis. The graph drawing beyond this number will be clipped off.}
|
|
|
|
|
|
|
|
\item{min}{Highest number to be set for the y-axis. The graph drawing beyond this number will be clipped off.}
|
|
|
|
|
|
|
|
\item{floating}{Logical. Floating takes y-axis is taken out of normal flow and places y-axis on svg element directly,
|
|
|
|
similar to an absolutely positioned element. Set the offsetX and offsetY then to adjust the position manually}
|
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{labels}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{axisBorder}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{axisTicks}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{title}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{tooltip}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
2018-09-03 23:52:53 +02:00
|
|
|
\item{crosshairs}{A list of parameters.}
|
2018-07-31 22:56:51 +02:00
|
|
|
|
|
|
|
\item{...}{Additional parameters.}
|
|
|
|
}
|
|
|
|
\value{
|
|
|
|
A \code{apexcharts} \code{htmlwidget} object.
|
|
|
|
}
|
|
|
|
\description{
|
|
|
|
Y-axis options
|
|
|
|
}
|
2018-09-03 23:52:53 +02:00
|
|
|
\note{
|
|
|
|
See \url{https://apexcharts.com/docs/options/yaxis/}
|
|
|
|
}
|
2019-06-24 15:18:38 +02:00
|
|
|
\examples{
|
|
|
|
data("economics_long", package = "ggplot2")
|
|
|
|
apex(
|
|
|
|
data = economics_long,
|
|
|
|
mapping = aes(x = date, y = value01, group = variable),
|
|
|
|
type = "line"
|
|
|
|
) \%>\%
|
|
|
|
ax_yaxis(
|
|
|
|
decimalsInFloat = 2, title = list(text = "Rescaled to [0,1]")
|
|
|
|
)
|
2019-06-24 22:07:23 +02:00
|
|
|
|
|
|
|
# Format tick labels
|
|
|
|
temperature <- data.frame(
|
|
|
|
month = head(month.name),
|
|
|
|
tp = c(4, -2, 2, 7, 11, 14)
|
|
|
|
)
|
|
|
|
apex(temperature, aes(month, tp), "line") \%>\%
|
|
|
|
ax_yaxis(
|
|
|
|
labels = list(
|
|
|
|
formatter = htmlwidgets::JS("function(value) {return value + '°C';}")
|
|
|
|
)
|
|
|
|
)
|
2019-06-24 15:18:38 +02:00
|
|
|
}
|