update ApexCharts to 3.1.0

This commit is contained in:
pvictor 2019-01-19 10:24:42 +01:00
parent 7143c6d378
commit 633d0e3f3b
7 changed files with 34 additions and 11 deletions

View File

@ -1,11 +1,11 @@
Package: apexcharter Package: apexcharter
Version: 0.0.0.9500 Version: 0.0.0.9600
Title: Create Interactive Chart with the JavaScript 'ApexCharts' Library Title: Create Interactive Chart with the JavaScript 'ApexCharts' Library
Description: Provides an 'htmlwidgets' interface to 'apexcharts.js'. Description: Provides an 'htmlwidgets' interface to 'apexcharts.js'.
Authors@R: c( Authors@R: c(
person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")), person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")),
person("Fanny", "Meyer", email = "fanny.meyer@dreamrs.fr", role = c("aut")), person("Fanny", "Meyer", email = "fanny.meyer@dreamrs.fr", role = c("aut")),
person("ApexCharts", role = c("cph"), comment = "apexcharts.js library")) person("Juned", "Chhipa", role = c("cph"), comment = "apexcharts.js library"))
License: MIT + file LICENSE License: MIT + file LICENSE
Encoding: UTF-8 Encoding: UTF-8
LazyData: true LazyData: true

View File

@ -26,23 +26,43 @@ mtcars_long <- mtcars %>%
tibble::rownames_to_column(var = "model") %>% tibble::rownames_to_column(var = "model") %>%
gather(variable, value, -model) gather(variable, value, -model)
mtcars_long$value <- round(mtcars_long$value)
apexchart() %>% test <- apexchart() %>%
ax_chart(type = "heatmap") %>% ax_chart(type = "heatmap") %>%
ax_dataLabels(enabled = FALSE) %>% ax_dataLabels(enabled = FALSE) %>%
ax_series2(lapply( ax_series2(lapply(
X = unique(mtcars_long$model), X = unique(mtcars_long$model),
FUN = function(x) { FUN = function(x) {
list( list(
name = x, name = tolower(gsub(pattern = "\\s", replacement = "", x = x)),
data = parse_df(mtcars_long[mtcars_long$model == x, c("variable", "value")]) data = parse_df(
data = mtcars_long[mtcars_long$model == x, c("variable", "value")],
add_names = c("x", "y")
)
) )
} }
)) %>% )) %>%
ax_xaxis(type = "category", categories = unique(mtcars_long$variable)) ax_xaxis(type = "category", categories = unique(mtcars_long$variable))
apexchart() %>%
ax_chart(type = "heatmap") %>%
ax_dataLabels(enabled = FALSE) %>%
ax_series2(l = list(
list(
name = "A",
data = list(
list(x = "a", y = "4"), list(x = "b", y = "2"), list(x = "c", y = "7")
)
),
list(
name = "B",
data = list(
list(x = "a", y = "5"), list(x = "b", y = "4"), list(x = "c", y = "1")
)
)
))

View File

@ -1,5 +1,5 @@
dependencies: dependencies:
- name: apexcharts - name: apexcharts
version: 2.4.2 version: 3.1.0
src: htmlwidgets/lib/apexcharts-2.4 src: htmlwidgets/lib/apexcharts-3.1
script: apexcharts.min.js script: apexcharts.min.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long