apexcharter/inst/examples/radial.R

91 lines
1.8 KiB
R
Raw Normal View History

2018-09-07 18:06:41 +02:00
# ------------------------------------------------------------------------
#
# Title : Radial charts
# By : Victor
# Date : 2018-09-07
#
# ------------------------------------------------------------------------
# Packages ----------------------------------------------------------------
library(apexcharter)
# Basic -------------------------------------------------------------------
2019-02-15 22:33:14 +01:00
apexchart() %>%
2018-09-07 18:06:41 +02:00
ax_chart(type = "radialBar") %>%
ax_plotOptions(
2019-02-18 20:29:34 +01:00
radialBar = radialBar_opts(
2018-09-07 18:06:41 +02:00
hollow = list(size = "70%")
)
) %>%
ax_series(70) %>%
ax_labels("Indicator")
# Stroked gauge -----------------------------------------------------------
2019-02-15 22:33:14 +01:00
apexchart() %>%
2018-09-07 18:06:41 +02:00
ax_chart(type = "radialBar") %>%
ax_plotOptions(
2019-02-18 20:29:34 +01:00
radialBar = radialBar_opts(
2018-09-07 18:06:41 +02:00
startAngle = -135,
endAngle = 135,
dataLabels = list(
name = list(
fontSize = "16px",
# color = undefined,
offsetY = 120
),
value = list(
offsetY = 76,
fontSize = "22px",
# color = undefined,
formatter = htmlwidgets::JS("function (val) {return val + '%';}")
)
)
)
) %>%
ax_stroke(dashArray = 4) %>%
ax_series(70) %>%
ax_labels("Indicator")
2019-02-15 22:33:14 +01:00
apexchart() %>%
2019-02-14 18:33:28 +01:00
ax_chart(type = "radialBar") %>%
# ax_plotOptions(
# radialBar = radialBarOpts(
# startAngle = -135,
# endAngle = 135,
# dataLabels = list(
# name = list(
# fontSize = "16px",
# # color = undefined,
# offsetY = 120
# ),
# value = list(
# offsetY = 76,
# fontSize = "22px",
# # color = undefined,
# formatter = htmlwidgets::JS("function (val) {return val + '%';}")
# )
# )
# )
# ) %>%
# ax_stroke(dashArray = 4) %>%
ax_series(70) %>%
ax_labels("Indicator")