diff --git a/.Rbuildignore b/.Rbuildignore index a5e60a7..cfb8c52 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ ^\.github$ ^LICENSE\.md$ ^codecov\.yml$ +^pkgdown$ diff --git a/_pkgdown.yml b/_pkgdown.yml index e607ff5..f007690 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,7 +1,15 @@ +url: https://dreamrs.github.io/apexcharter/ template: - package: dreamRs - + bootstrap: 4 + bootswatch: cosmo + bslib: + primary: "#112446" + +navbar: + type: dark + bg: primary + toc: depth: 3 diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..cf0725a --- /dev/null +++ b/docs/404.html @@ -0,0 +1,109 @@ + + +
+ + + + +YEAR: 2020 +COPYRIGHT HOLDER: Victor Perrier ++ +
LICENSE.md
+ Copyright (c) 2020 Victor Perrier
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+vignettes/apexcharter.Rmd
+ apexcharter.Rmd
The objective of this vignette is to show how to quickly build data visualizations with the ApexCharts JavaScript library, as well as to give an overview of the different graphics available.
+Data used are from ggplot2
package.
Simple bar charts can be created with:
+ + +Flipping coordinates can be done by using type = "bar"
:
To create a dodge bar charts, use aesthetic fill
:
For stacked bar charts, specify option stacked
in ax_chart
:
Simple line charts can be created with (works with character
, Date
or POSIXct
):
To represent several lines, use a data.frame
in long format and the group
aesthetic:
+data("economics_long")
+
+apex(data = economics_long, type = "line", mapping = aes(x = date, y = value01, group = variable)) %>%
+ ax_yaxis(decimalsInFloat = 2) # number of decimals to keep
Create area charts with type = "area"
:
Simple bar charts can be created with:
+ + +Color points according to a third variable:
+ + +And change point size using z
aesthetics:
Simple pie charts can be created with:
+
+poll <- data.frame(
+ answer = c("Yes", "No"),
+ n = c(254, 238)
+)
+
+apex(data = poll, type = "pie", mapping = aes(x = answer, y = n))
Simple radial charts can be created with (here we pass values directly in aes
, but you can use a data.frame
) :
Multi radial chart (more than one value):
+
+fruits <- data.frame(
+ name = c('Apples', 'Oranges', 'Bananas', 'Berries'),
+ value = c(44, 55, 67, 83)
+)
+
+apex(data = fruits, type = "radialBar", mapping = aes(x = name, y = value))
Simple radar charts can be created with:
+
+mtcars$model <- rownames(mtcars)
+
+apex(data = head(mtcars), type = "radar", mapping = aes(x = model, y = qsec))
With a grouping variable:
+
+# extremely complicated reshaping
+new_mtcars <- reshape(
+ data = head(mtcars),
+ idvar = "model",
+ varying = list(c("drat", "wt")),
+ times = c("drat", "wt"),
+ direction = "long",
+ v.names = "value",
+ drop = c("mpg", "cyl", "hp", "dist", "qsec", "vs", "am", "gear", "carb")
+)
+
+apex(data = new_mtcars, type = "radar", mapping = aes(x = model, y = value, group = time))
With some custom options for color mapping:
+ + + +Create a heatmap with :
+
+# create some data
+sales <- expand.grid(year = 2010:2020, month = month.name)
+sales$value <- sample(-10:30, nrow(sales), TRUE)
+
+apex(
+ data = sales,
+ type = "heatmap",
+ mapping = aes(x = year, y = month, fill = value)
+) %>%
+ ax_dataLabels(enabled = FALSE) %>%
+ ax_colors("#008FFB")
Create a treemap with:
+ + + +