You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
pvictor 1b6a57df3a prepare for cran 3 weeks ago
.github updated github actions 3 weeks ago
R Facets y2 (#65) 2 months ago
data removed unhcr_popstats_2017 dataset because of annoying note 1 year ago
data-raw new dataset: climate_paris 3 years ago
examples removed unhcr_popstats_2017 dataset because of annoying note 1 year ago
inst updated apexcharts to 3.36.3 3 months ago
man facets: added grid_width arg 2 months ago
man-roxygen added roxygen template for common documentation (ax) 1 year ago
srcjs added ApexCharts to export to fix brush chart in markdown 1 year ago
tests Facets y2 (#65) 2 months ago
vignettes updated vignettes titles 1 year ago
.Rbuildignore Updated ApexCharts.js to 3.35.0 10 months ago
.gitignore pkgdown via github action 1 year ago
DESCRIPTION prepare for cran 3 weeks ago
LICENSE broken link & license 2 years ago
LICENSE.md broken link & license 2 years ago
NAMESPACE facets: added grid_width arg 2 months ago
NEWS.md prepare for cran 3 weeks ago
README.md prepare for cran 3 weeks ago
_pkgdown.yml updated pkgdown 1 year ago
codecov.yml removed travis and added coverage 2 years ago
cran-comments.md prepare for cran 3 weeks ago
package-lock.json Merge pull request #59 from dreamRs/dependabot/npm_and_yarn/terser-5.14.2 2 months ago
package.json updated apexcharts to 3.36.3 3 months ago
webpack.common.js updated ApexCharts to 3.29.0 1 year ago
webpack.dev.js use packer 1 year ago
webpack.prod.js use packer 1 year ago

README.md

apexcharter

Htmlwidget for apexcharts.js : A modern JavaScript charting library to build interactive charts and visualizations with simple API. See the online documentation for examples.

CRAN status cran checks Codecov test coverage R-CMD-check

Installation

Install from CRAN with:

install.packages("apexcharter")

Or install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("dreamRs/apexcharter")

Quick Charts

Use apex function to quickly create visualizations :

library(apexcharter)
data("mpg", package = "ggplot2")
apex(data = mpg, type = "bar", mapping = aes(manufacturer))

With datetime:

data("economics", package = "ggplot2")
apex(data = economics, type = "line", mapping = aes(x = date, y = uempmed)) %>% 
  ax_stroke(width = 1)

Full API

All methods from ApexCharts are available with function like ax_* compatible with pipe from magrittr :

library(apexcharter)
data(mpg, package = "ggplot2")

apexchart() %>% 
  ax_chart(type = "bar") %>% 
  ax_plotOptions(bar = bar_opts(
    horizontal = FALSE,
    endingShape = "flat",
    columnWidth = "70%",
    dataLabels = list(
      position = "top"
    ))
  ) %>% 
  ax_grid(
    show = TRUE,
    position = "front",
    borderColor = "#FFF"
  ) %>% 
  ax_series(list(
    name = "Count",
    data = tapply(mpg$manufacturer, mpg$manufacturer, length)
  )) %>% 
  ax_colors("#112446") %>% 
  ax_xaxis(categories = unique(mpg$manufacturer)) %>% 
  ax_title(text = "Number of models") %>% 
  ax_subtitle(text = "Data from ggplot2")

Raw API

Pass a list of parameters to the function:

apexchart(ax_opts = list(
  chart = list(
    type = "line"
  ),
  stroke = list(
    curve = "smooth"
  ),
  grid = list(
    borderColor = "#e7e7e7",
    row = list(
      colors = c("#f3f3f3", "transparent"),
      opacity = 0.5
    )
  ),
  dataLabels = list(
    enabled = TRUE
  ),
  markers = list(style = "inverted", size = 6),
  series = list(
    list(
      name = "High",
      data = c(28, 29, 33, 36, 32, 32, 33)
    ),
    list(
      name = "Low",
      data = c(12, 11, 14, 18, 17, 13, 13)
    )
  ),
  title = list(
    text = "Average High & Low Temperature",
    align = "left"
  ),
  xaxis = list(
    categories = month.abb[1:7]
  ),
  yaxis = list(
    title = list(text = "Temperature"),
    labels = list(
      formatter = htmlwidgets::JS("function(value) {return value + '\u00b0C';}")
    )
  )
))

Development

This package use {packer} to manage JavaScript assets, see packer's documentation for more.

Install nodes modules with:

packer::npm_install()

Modify srcjs/widgets/apexcharter.js, then run:

packer::bundle()

Re-install R package and try apexcharter() or apex() functions.