Description Usage Arguments References See Also Examples
When an echart object is generated, you can modify it by setting axis using
%>%
.
You can use work functions setXAxis
, setYAxis
, setX1Axis
,
setY1Axis
.
This function modified a few default options for the axis component in
ECharts:
scale = TRUE
(was FALSE
by default in ECharts);
axisLine$onZero = FALSE
(was TRUE
in ECharts).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | setAxis(chart, series = NULL, grid = NULL, which = c("x", "y", "x1", "y1",
"y2"), type = c("value", "category", "time", "log"), offset = 0,
show = TRUE, position = c("bottom", "top", "left", "right"),
inverse = FALSE, name = "", nameLocation = c("end", "middle", "start"),
onZero = FALSE, nameTextStyle = emptyList(), nameGap = 15,
nameRotate = NULL, boundaryGap = c(0, 0), min = NULL, max = NULL,
scale = TRUE, splitNumber = NULL, interval = NULL, logBase = 10,
silent = FALSE, triggerEvent = FALSE, axisLine = list(show = TRUE,
onZero = onZero), axisTick = list(show = FALSE), axisLabel = list(show =
TRUE), splitLine = list(show = TRUE), splitArea = list(show = FALSE),
data = list(), zlevel = 0, z = 0)
setYAxis(chart, ...)
setY1Axis(chart, ...)
setXAxis(chart, ...)
setX1Axis(chart, ...)
setY2Axis(chart, ...)
|
chart |
|
series |
Which series to be put on this axis. Could be:
|
which |
Which axis to be modified. Could be one of the following:
|
type |
Type of the axis. Could be |
position |
Position of this axis. Could be |
boundaryGap |
A two-element numeric vector, defining the policy of the space
at the two ends of the axis (percents). Deafult |
min |
The mininum value of the axis. Default NULL (automatic). If a numeric
value is set, |
max |
The maxinum value of the axis. Default NULL (automatic). If a numeric
value is set, |
scale |
Logical, for axis of 'value', 'time', 'log' type, to define whether zoom the scale to the range between _min and _max. Default TRUE. |
splitNumber |
Numeric, how many sections to devide the axis. Default NULL,
automatically deviding based on algorithms of |
axisLine |
A list. Default: |
axisTick |
A list. Default: |
axisLabel |
A list controlling the axis labels. Default
|
splitLine |
A list controlling the split lines. Default |
splitArea |
A list controlling the split areas. Default |
data |
A character vector/list for axis of type 'category', to define the text
labels shown in this axis. Default NULL. You can even pass in a complicated list with
|
mode |
http://echarts.baidu.com/echarts2/doc/option.html#tooltip-line1~xAxis-i
http://echarts.baidu.com/echarts2/doc/option.html#tooltip-line1~yAxis-i
setXAxis
, setYAxis
, setX1Axis
,
setY1Axis
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
g = echart(iris, Sepal.Width, Petal.Width, series=Species)
# Change the style
g %>% setTheme('gray') %>% setXAxis(splitLine=list(show=FALSE)) %>%
setYAxis(axisLine=list(lineStyle=list(width=0)))
# Dual-yAxis, series 1,2 on primary y-axis, series 3 on secondary y-axis
g %>% setYAxis(1:2, name="setosa/versicolor") %>%
setY1Axis("virginica", name="virginica")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.