Compare commits
354 Commits
Author | SHA1 | Date |
---|---|---|
pvictor | 5f8389ff34 | |
pvictor | 85708897b0 | |
pvictor | 9200d918ad | |
pvictor | 58723475cb | |
pvictor | b313b45989 | |
pvictor | 7e4189366e | |
pvictor | 3a3a10369f | |
pvictor | d0fac7c1ee | |
pvictor | 1ac176f30c | |
pvictor | 624ab8b901 | |
pvictor | 57733add33 | |
pvictor | c1560fc9c5 | |
dependabot[bot] | e68f20930c | |
pvictor | 6cff8a9f67 | |
pvictor | 1d94f9d4a6 | |
pvictor | eb228597d8 | |
pvictor | bbda86de93 | |
pvictor | 467be227fc | |
pvictor | 11d244e992 | |
pvictor | 5587cdbef4 | |
pvictor | be187e37f1 | |
Victor Perrier | 34aee9bc96 | |
Victor Perrier | 44ead44178 | |
Victor Perrier | 9baa753c3f | |
pvictor | 24c552ea68 | |
pvictor | b7ed86e556 | |
pvictor | 7705b91e88 | |
pvictor | 70204162f4 | |
dependabot[bot] | 11c6938935 | |
pvictor | f83cb879a8 | |
pvictor | de477fec66 | |
pvictor | 896998074e | |
pvictor | b69b7b7b4d | |
pvictor | 1b6a57df3a | |
pvictor | 34d73e81ee | |
pvictor | 7d32381a65 | |
pvictor | 2174c8b238 | |
Victor Perrier | 1fe6e97eee | |
pvictor | cacfcde3ce | |
pvictor | 4ef564e605 | |
Victor Perrier | 23dbb5e869 | |
pvictor | 4cbf760e29 | |
pvictor | 1e3ad8fcc8 | |
pvictor | 162b7874d6 | |
pvictor | ef470d1889 | |
pvictor | 69a343fca0 | |
pvictor | e848debf0a | |
pvictor | f50e0064c2 | |
pvictor | d0d234baee | |
pvictor | a9914aa702 | |
dependabot[bot] | f45efa78fd | |
pvictor | bc22af7e0c | |
pvictor | 7a959cb461 | |
pvictor | ea4abf2779 | |
Victor Perrier | aa6d74a38d | |
dependabot[bot] | eb2a82746e | |
pvictor | 50fac13d51 | |
pvictor | 3f1bb5048e | |
pvictor | 036244b981 | |
pvictor | f7de6805db | |
pvictor | 64ca1925c1 | |
pvictor | 50926f0570 | |
pvictor | 67a97cdf5f | |
pvictor | 314baa5cd9 | |
pvictor | dddd472c1f | |
pvictor | 4f4142211b | |
pvictor | f4215fdf37 | |
pvictor | 301051c297 | |
pvictor | 45f29fca2e | |
pvictor | c717358068 | |
pvictor | 0f7ec49342 | |
pvictor | fe45564f6a | |
pvictor | 647f4ab9c8 | |
pvictor | ace2508e89 | |
pvictor | a0d0616009 | |
pvictor | 47381fcfda | |
pvictor | d14e36d22b | |
pvictor | 14484602f7 | |
pvictor | 017b84f35c | |
pvictor | 05494785ae | |
Victor Perrier | c0672ba655 | |
pvictor | 8bda434fa0 | |
pvictor | 01c1c8ed2d | |
pvictor | 090f3d2d37 | |
pvictor | 7b9df92ee7 | |
pvictor | f670771a22 | |
pvictor | 027c5bc16f | |
pvictor | 4178c633de | |
pvictor | 705f9f971a | |
pvictor | 3c861bec58 | |
pvictor | 251df70b2b | |
pvictor | cefba791f7 | |
pvictor | dfd9bb07af | |
pvictor | ea494e899d | |
pvictor | a05d2db20d | |
pvictor | 56ce243b0f | |
pvictor | 2c18c1b329 | |
pvictor | 8fa55a9f53 | |
pvictor | 28931d2887 | |
pvictor | 36a537a79b | |
pvictor | 1e42e587af | |
pvictor | e3efecf7f8 | |
pvictor | e2af5eee09 | |
pvictor | 4352d95f97 | |
pvictor | 14b2a2cc74 | |
pvictor | bfc50ca080 | |
pvictor | 1d54804e04 | |
pvictor | 9efca10228 | |
pvictor | 3e85bd477a | |
pvictor | 63db3566fb | |
pvictor | 552675f0a2 | |
pvictor | 318690ff06 | |
pvictor | e76a129702 | |
pvictor | 83d6926fe6 | |
pvictor | 67680c48f3 | |
pvictor | f91a6c69c6 | |
pvictor | 2d9b9ff631 | |
pvictor | 1e74d6857e | |
pvictor | 5ac0087461 | |
pvictor | cf81488f56 | |
pvictor | 1aac748555 | |
pvictor | 3d55188a00 | |
pvictor | 5dc9271701 | |
Victor Perrier | 4b82ddb922 | |
pvictor | 55e19f60c4 | |
pvictor | 5679b7cdba | |
pvictor | 175271d01a | |
pvictor | 730d6651a0 | |
pvictor | bdf6e19597 | |
pvictor | 3c252c9f20 | |
pvictor | 90aac1901b | |
pvictor | 901e67494d | |
pvictor | 88f926b788 | |
pvictor | b17ad7b046 | |
pvictor | 69104bb6a9 | |
pvictor | 12c02b5336 | |
pvictor | 9a1c257977 | |
pvictor | dea01b7e8d | |
Victor Perrier | 5e3be7068a | |
pvictor | 9a56de4d4e | |
pvictor | 898ff0f729 | |
pvictor | c7fcaab4bd | |
Victor Perrier | 35472372cd | |
pvictor | 7131c8fd00 | |
pvictor | 0bd9dda5a7 | |
pvictor | 47ef3d1b3e | |
pvictor | 88956c582b | |
pvictor | 19d25ee1fd | |
pvictor | c27a0feba5 | |
pvictor | 7091f5da01 | |
pvictor | eb01583f51 | |
pvictor | 639450cb7d | |
pvictor | 585cbd0bfd | |
pvictor | 971388c4f1 | |
pvictor | 1bca00e544 | |
pvictor | ff7b5ba7d9 | |
pvictor | 70eb611091 | |
pvictor | de3d9c1a9f | |
pvictor | 0cadab8b51 | |
pvictor | 716e96b16c | |
pvictor | 4470756c38 | |
pvictor | 67f09cd048 | |
pvictor | ffefe8d394 | |
pvictor | 2a261e1a91 | |
pvictor | 727c9ed3fe | |
pvictor | 5560ae0b31 | |
pvictor | 805e441499 | |
pvictor | 9fb6a7b341 | |
pvictor | 02560a95a0 | |
pvictor | 315001e883 | |
pvictor | 11a5037276 | |
pvictor | be7b3d4061 | |
pvictor | c7d037eea8 | |
pvictor | c06574ba3b | |
pvictor | 6b23a4a9ab | |
pvictor | dbeb316074 | |
pvictor | 7e64d25710 | |
pvictor | cd38b5c5e5 | |
pvictor | abad2b837c | |
pvictor | 74512ce454 | |
pvictor | af5670a0b0 | |
pvictor | 53e7addd8b | |
pvictor | eecfb61154 | |
pvictor | 3bd31007f5 | |
pvictor | 7a20be6e20 | |
pvictor | faa07879ef | |
pvictor | 9481c21d43 | |
pvictor | 5aff3524a2 | |
pvictor | b487e92b70 | |
pvictor | 5be96dcd77 | |
pvictor | d44581dc2a | |
pvictor | 53cc0cdb32 | |
pvictor | 145c48f3b7 | |
pvictor | bd179f978b | |
pvictor | 8ce6afc5f5 | |
pvictor | 296797c353 | |
pvictor | 273936b151 | |
pvictor | 31f824b5d5 | |
pvictor | 9d5158c024 | |
pvictor | 7712ab2e64 | |
pvictor | e6ae2ac8c8 | |
pvictor | d25bf7f7d7 | |
pvictor | 47d8a9c15a | |
pvictor | ebbaf381d1 | |
pvictor | ce1ea38e73 | |
pvictor | 9e1e61561b | |
pvictor | 7da1efd19c | |
pvictor | 9aea6b8e9e | |
pvictor | 738e281777 | |
pvictor | b9bc804e28 | |
pvictor | 8c471242f0 | |
pvictor | 6ebd778537 | |
pvictor | 6e91a515de | |
pvictor | 48d4aa0362 | |
pvictor | 5693403b68 | |
pvictor | c8ff4986b5 | |
pvictor | 311dc0f18d | |
pvictor | ddf9bb3294 | |
pvictor | 9c9a277aee | |
pvictor | 7dc81c6db6 | |
pvictor | 5704d62220 | |
pvictor | 0fdba4cd9b | |
pvictor | 2b1fc484b7 | |
pvictor | 78d09c3316 | |
pvictor | 27673fb980 | |
pvictor | 02cf03fd6a | |
pvictor | ea901187ac | |
pvictor | 5728a361da | |
pvictor | 1a6063e9fb | |
pvictor | 79f04f26da | |
pvictor | 8d751a485e | |
pvictor | 92b2217f56 | |
pvictor | 721cce9cff | |
pvictor | dc10f5e2b1 | |
pvictor | a96755e1c0 | |
pvictor | f7a8df7277 | |
pvictor | d3126ab26b | |
pvictor | 5a793fe45c | |
pvictor | 528489fc15 | |
pvictor | 43167f690a | |
pvictor | edfa24b75a | |
pvictor | 5a32d96690 | |
pvictor | e74270431d | |
pvictor | 18dea3f325 | |
pvictor | b03f42df8c | |
pvictor | cc0a11de24 | |
pvictor | 01231de378 | |
pvictor | c012ad8832 | |
pvictor | 373d80ceff | |
Victor Perrier | c3530c74c6 | |
pvictor | 11335839fd | |
pvictor | 8238c0709e | |
pvictor | 7312588c47 | |
pvictor | 31ada1a177 | |
pvictor | b4622aecdb | |
pvictor | 73daff130f | |
pvictor | 6fb06170d5 | |
pvictor | b35423b21c | |
pvictor | 88b63408c9 | |
pvictor | 8f56dca2b9 | |
pvictor | ea12c0b1f6 | |
pvictor | fee9c2c9ae | |
pvictor | 8a3bf8d6e8 | |
pvictor | a0ec017373 | |
pvictor | 38dde279f9 | |
pvictor | 02c267db56 | |
pvictor | 4823f7a630 | |
pvictor | 98b09d2f93 | |
pvictor | 641d763286 | |
pvictor | 58d7bcc55c | |
pvictor | 1d5478b1a2 | |
pvictor | c8c23aa43b | |
pvictor | e3d9c9ffc9 | |
Victor Perrier | ec890de767 | |
pvictor | dd1090989d | |
pvictor | edea361d26 | |
pvictor | 368af5fa48 | |
pvictor | 1a18a095b2 | |
pvictor | 29ae8cd6a5 | |
pvictor | 7d3d6eec23 | |
pvictor | 5fd663162d | |
pvictor | a00b3abf98 | |
pvictor | 4be8cac5df | |
pvictor | 10fe4eee19 | |
pvictor | 279ca36946 | |
pvictor | 8d5cfa631e | |
pvictor | b97073f540 | |
pvictor | c85ffb6daa | |
pvictor | b0f4b1d588 | |
pvictor | 7450f3eb52 | |
pvictor | 90e1d3e2f9 | |
pvictor | c8461f7a85 | |
pvictor | d44e251f31 | |
pvictor | 2be3c5b4b3 | |
Victor Perrier | e6e60e4032 | |
Victor Perrier | d2d8a540cc | |
pvictor | ef63ec04e0 | |
pvictor | 7097b8bf2a | |
pvictor | fa4a8c4462 | |
pvictor | 015b901602 | |
pvictor | 34eeddfa06 | |
pvictor | 5875f14cbe | |
pvictor | 8f293c74e2 | |
pvictor | 38b648ed6d | |
pvictor | e0b6e28913 | |
pvictor | 2513bc5fdf | |
pvictor | 4f2e8af93e | |
pvictor | 267793ff5a | |
pvictor | 00fe467dcc | |
pvictor | cfd5a9e712 | |
pvictor | 53a8cfa957 | |
pvictor | 326f455def | |
pvictor | f7e551db05 | |
pvictor | 500619df5a | |
pvictor | 0259eb2bb4 | |
Victor Perrier | 4376fc0173 | |
Federico Marini | 8f95e87288 | |
pvictor | 9c352df6cb | |
pvictor | ecdd725c7a | |
pvictor | 360181aa0b | |
pvictor | 3ed4f46957 | |
pvictor | b03db0e367 | |
pvictor | dd39d9dd99 | |
pvictor | 65b565ad67 | |
pvictor | 6f2cb369ef | |
pvictor | f9e4c6e5ce | |
pvictor | 63c0ba4da6 | |
pvictor | e634a04525 | |
pvictor | 4ed7cda95c | |
pvictor | 2043f88562 | |
pvictor | 7454bf54f3 | |
pvictor | 714d381e61 | |
pvictor | 1c41b14a2f | |
pvictor | ece66ae816 | |
pvictor | 944e63e256 | |
pvictor | b2e1a78b7b | |
pvictor | d2db67824c | |
pvictor | 0ed86bc454 | |
pvictor | 2cf9929612 | |
pvictor | 263222aeb8 | |
pvictor | d6f04024bc | |
pvictor | 6a1999e70d | |
pvictor | 854dff7996 | |
pvictor | c2be7b2c14 | |
pvictor | 8e3742eff3 | |
pvictor | bdda107e19 | |
pvictor | ff2302cd48 | |
pvictor | a4e65a36c8 | |
pvictor | 3979d0c44c | |
pvictor | 21edc8d1e5 | |
pvictor | 0139be0f6f | |
pvictor | 2ae135cf49 | |
pvictor | e77dcad79b | |
pvictor | 871731a482 |
|
@ -3,6 +3,22 @@
|
|||
^apexcharter\.Rproj$
|
||||
^\.Rproj\.user$
|
||||
^dev$
|
||||
^img$
|
||||
^revdep
|
||||
^_pkgdown\.yml$
|
||||
^docs$
|
||||
^cran-comments\.md$
|
||||
^CRAN-RELEASE$
|
||||
^examples$
|
||||
^man-roxygen$
|
||||
^\.github$
|
||||
^LICENSE\.md$
|
||||
^codecov\.yml$
|
||||
^pkgdown$
|
||||
^srcjs$
|
||||
^node_modules$
|
||||
^package\.json$
|
||||
^package-lock\.json$
|
||||
^webpack\.dev\.js$
|
||||
^webpack\.prod\.js$
|
||||
^webpack\.common\.js$
|
||||
^CRAN-SUBMISSION$
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
*.html
|
|
@ -0,0 +1,49 @@
|
|||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
|
||||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
name: R-CMD-check
|
||||
|
||||
jobs:
|
||||
R-CMD-check:
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
|
||||
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {os: macos-latest, r: 'release'}
|
||||
- {os: windows-latest, r: 'release'}
|
||||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
|
||||
- {os: ubuntu-latest, r: 'release'}
|
||||
- {os: ubuntu-latest, r: 'oldrel-1'}
|
||||
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
R_KEEP_PKG_SOURCE: yes
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@v2
|
||||
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
r-version: ${{ matrix.config.r }}
|
||||
http-user-agent: ${{ matrix.config.http-user-agent }}
|
||||
use-public-rspm: true
|
||||
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
with:
|
||||
extra-packages: any::rcmdcheck
|
||||
needs: check
|
||||
|
||||
- uses: r-lib/actions/check-r-package@v2
|
||||
with:
|
||||
upload-snapshots: true
|
|
@ -0,0 +1,47 @@
|
|||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
|
||||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
release:
|
||||
types: [published]
|
||||
workflow_dispatch:
|
||||
|
||||
name: pkgdown
|
||||
|
||||
jobs:
|
||||
pkgdown:
|
||||
runs-on: ubuntu-latest
|
||||
# Only restrict concurrency for non-PR jobs
|
||||
concurrency:
|
||||
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: r-lib/actions/setup-pandoc@v2
|
||||
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
use-public-rspm: true
|
||||
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
with:
|
||||
extra-packages: any::pkgdown, local::., any::dplyr, any::highcharter, any::gapminder
|
||||
needs: website
|
||||
pak-version: devel
|
||||
|
||||
- name: Build site
|
||||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Deploy to GitHub pages 🚀
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: JamesIves/github-pages-deploy-action@v4.4.1
|
||||
with:
|
||||
clean: false
|
||||
branch: gh-pages
|
||||
folder: docs
|
|
@ -0,0 +1,50 @@
|
|||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
|
||||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
|
||||
on:
|
||||
push:
|
||||
branches: [main, master]
|
||||
pull_request:
|
||||
branches: [main, master]
|
||||
|
||||
name: test-coverage
|
||||
|
||||
jobs:
|
||||
test-coverage:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: r-lib/actions/setup-r@v2
|
||||
with:
|
||||
use-public-rspm: true
|
||||
|
||||
- uses: r-lib/actions/setup-r-dependencies@v2
|
||||
with:
|
||||
extra-packages: any::covr
|
||||
needs: coverage
|
||||
|
||||
- name: Test coverage
|
||||
run: |
|
||||
covr::codecov(
|
||||
quiet = FALSE,
|
||||
clean = FALSE,
|
||||
install_path = file.path(Sys.getenv("RUNNER_TEMP"), "package")
|
||||
)
|
||||
shell: Rscript {0}
|
||||
|
||||
- name: Show testthat output
|
||||
if: always()
|
||||
run: |
|
||||
## --------------------------------------------------------------------
|
||||
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
|
||||
shell: bash
|
||||
|
||||
- name: Upload test results
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: coverage-test-failures
|
||||
path: ${{ runner.temp }}/package
|
|
@ -4,3 +4,6 @@ inst/doc
|
|||
.RData
|
||||
*.Rproj
|
||||
data-raw/*.csv
|
||||
node_modules
|
||||
docs
|
||||
data-raw/inputs/
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r
|
||||
|
||||
language: R
|
||||
sudo: false
|
||||
cache: packages
|
27
DESCRIPTION
27
DESCRIPTION
|
@ -1,28 +1,35 @@
|
|||
Package: apexcharter
|
||||
Version: 0.0.4
|
||||
Version: 0.4.3.9000
|
||||
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'.
|
||||
'Apexcharts' is a modern JavaScript charting library to build interactive charts and visualizations with simple API.
|
||||
'Apexcharts' examples and documentation are available here: <https://apexcharts.com/>.
|
||||
Authors@R: c(
|
||||
person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")),
|
||||
person("Fanny", "Meyer", email = "fanny.meyer@dreamrs.fr", role = c("aut")),
|
||||
person("Juned", "Chhipa", role = c("cph"), comment = "apexcharts.js library"))
|
||||
person("Fanny", "Meyer", role = "aut"),
|
||||
person("Juned", "Chhipa", role = "cph", comment = "apexcharts.js library"),
|
||||
person("Mike", "Bostock", role = "cph", comment = "d3.format library"))
|
||||
License: MIT + file LICENSE
|
||||
Encoding: UTF-8
|
||||
LazyData: true
|
||||
ByteCompile: true
|
||||
Depends: R (>= 2.10)
|
||||
Imports:
|
||||
htmlwidgets,
|
||||
htmltools,
|
||||
htmlwidgets (>= 1.5.3),
|
||||
magrittr,
|
||||
rlang,
|
||||
ggplot2,
|
||||
scales
|
||||
jsonlite,
|
||||
shiny (>= 1.1.0)
|
||||
Suggests:
|
||||
testthat,
|
||||
dplyr,
|
||||
knitr,
|
||||
rmarkdown
|
||||
RoxygenNote: 6.1.1
|
||||
URL: https://github.com/dreamRs/apexcharter
|
||||
scales,
|
||||
rmarkdown,
|
||||
covr
|
||||
RoxygenNote: 7.3.1
|
||||
Roxygen: list(markdown = TRUE)
|
||||
URL: https://github.com/dreamRs/apexcharter, https://dreamrs.github.io/apexcharter/
|
||||
BugReports: https://github.com/dreamRs/apexcharter/issues
|
||||
VignetteBuilder: knitr
|
||||
|
|
34
LICENSE
34
LICENSE
|
@ -1,32 +1,2 @@
|
|||
R PACKAGE
|
||||
=========
|
||||
|
||||
YEAR: 2018
|
||||
COPYRIGHT HOLDER: dreamRs
|
||||
|
||||
|
||||
ApexCharts.js
|
||||
=============
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ApexCharts
|
||||
|
||||
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.
|
||||
|
||||
YEAR: 2020
|
||||
COPYRIGHT HOLDER: Victor Perrier
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
# MIT License
|
||||
|
||||
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.
|
77
NAMESPACE
77
NAMESPACE
|
@ -1,23 +1,44 @@
|
|||
# Generated by roxygen2: do not edit by hand
|
||||
|
||||
S3method(print,apex_facet)
|
||||
S3method(print,apex_grid)
|
||||
export("%>%")
|
||||
export(JS)
|
||||
export(add_event)
|
||||
export(add_event_marker)
|
||||
export(add_hline)
|
||||
export(add_line)
|
||||
export(add_point)
|
||||
export(add_shade)
|
||||
export(add_shade_weekend)
|
||||
export(add_smooth_line)
|
||||
export(add_vline)
|
||||
export(aes)
|
||||
export(apex)
|
||||
export(apex_grid)
|
||||
export(apexchart)
|
||||
export(apexchartOutput)
|
||||
export(apexchartProxy)
|
||||
export(apexfacetOutput)
|
||||
export(apexgridOutput)
|
||||
export(ax_annotations)
|
||||
export(ax_chart)
|
||||
export(ax_colors)
|
||||
export(ax_colors_manual)
|
||||
export(ax_dataLabels)
|
||||
export(ax_facet_grid)
|
||||
export(ax_facet_wrap)
|
||||
export(ax_fill)
|
||||
export(ax_forecast_data_points)
|
||||
export(ax_grid)
|
||||
export(ax_labels)
|
||||
export(ax_labels2)
|
||||
export(ax_labs)
|
||||
export(ax_legend)
|
||||
export(ax_markers)
|
||||
export(ax_nodata)
|
||||
export(ax_plotOptions)
|
||||
export(ax_proxy_options)
|
||||
export(ax_proxy_series)
|
||||
export(ax_responsive)
|
||||
export(ax_series)
|
||||
|
@ -30,20 +51,76 @@ export(ax_title)
|
|||
export(ax_tooltip)
|
||||
export(ax_xaxis)
|
||||
export(ax_yaxis)
|
||||
export(ax_yaxis2)
|
||||
export(bar_opts)
|
||||
export(boxplot_opts)
|
||||
export(bubble_opts)
|
||||
export(config_update)
|
||||
export(events_opts)
|
||||
export(format_date)
|
||||
export(format_num)
|
||||
export(heatmap_opts)
|
||||
export(label)
|
||||
export(label_value)
|
||||
export(parse_df)
|
||||
export(pie_opts)
|
||||
export(radialBar_opts)
|
||||
export(renderApexchart)
|
||||
export(renderApexfacet)
|
||||
export(renderApexgrid)
|
||||
export(renderSparkBox)
|
||||
export(run_demo_input)
|
||||
export(run_demo_sparkbox)
|
||||
export(run_demo_sync)
|
||||
export(set_input_click)
|
||||
export(set_input_export)
|
||||
export(set_input_selection)
|
||||
export(set_input_zoom)
|
||||
export(set_tooltip_fixed)
|
||||
export(sparkBoxOutput)
|
||||
export(spark_box)
|
||||
export(vars)
|
||||
importFrom(ggplot2,aes)
|
||||
importFrom(ggplot2,label_value)
|
||||
importFrom(ggplot2,vars)
|
||||
importFrom(graphics,boxplot)
|
||||
importFrom(htmltools,css)
|
||||
importFrom(htmltools,renderTags)
|
||||
importFrom(htmltools,resolveDependencies)
|
||||
importFrom(htmltools,tagList)
|
||||
importFrom(htmltools,tags)
|
||||
importFrom(htmltools,validateCssUnit)
|
||||
importFrom(htmlwidgets,JS)
|
||||
importFrom(htmlwidgets,JSEvals)
|
||||
importFrom(htmlwidgets,createWidget)
|
||||
importFrom(htmlwidgets,getDependency)
|
||||
importFrom(htmlwidgets,shinyRenderWidget)
|
||||
importFrom(htmlwidgets,shinyWidgetOutput)
|
||||
importFrom(htmlwidgets,sizingPolicy)
|
||||
importFrom(jsonlite,fromJSON)
|
||||
importFrom(magrittr,"%>%")
|
||||
importFrom(rlang,"!!")
|
||||
importFrom(rlang,"%||%")
|
||||
importFrom(rlang,as_label)
|
||||
importFrom(rlang,eval_tidy)
|
||||
importFrom(rlang,is_function)
|
||||
importFrom(rlang,is_list)
|
||||
importFrom(rlang,is_named)
|
||||
importFrom(rlang,is_null)
|
||||
importFrom(rlang,quo)
|
||||
importFrom(rlang,quos)
|
||||
importFrom(rlang,sym)
|
||||
importFrom(rlang,syms)
|
||||
importFrom(shiny,createRenderFunction)
|
||||
importFrom(shiny,createWebDependency)
|
||||
importFrom(shiny,exprToFunction)
|
||||
importFrom(shiny,getDefaultReactiveDomain)
|
||||
importFrom(shiny,registerInputHandler)
|
||||
importFrom(shiny,shinyAppFile)
|
||||
importFrom(shiny,uiOutput)
|
||||
importFrom(stats,complete.cases)
|
||||
importFrom(stats,lm)
|
||||
importFrom(stats,loess)
|
||||
importFrom(stats,predict)
|
||||
importFrom(stats,setNames)
|
||||
importFrom(utils,modifyList)
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
apexcharter 0.4.3
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.49.1 (see https://github.com/apexcharts/apexcharts.js/releases).
|
||||
* New chart type : slope charts.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.2
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.46.0 (see https://github.com/apexcharts/apexcharts.js/releases).
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.1
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.41.0 (new charts type: dumbbell chart and funnel chart).
|
||||
* `apex()` : added support for boxplot.
|
||||
* New function `ax_forecast_data_points()` to mark points as forecasted values.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.4.0
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.36.3.
|
||||
* New chart type : range area charts.
|
||||
* Facets: correctly manage secondary y axis.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.3.1
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.33.1
|
||||
* Minimal {htmlwidgets} version required >= 1.5.3
|
||||
|
||||
|
||||
|
||||
apexcharter 0.3.0
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.29.0
|
||||
* Internal: use [{packer}](https://github.com/JohnCoene/packer) to manage JavaScript assets.
|
||||
* `d3.format` JavaScript functions are now available in browser under `format()` and `formatLocale()`.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.2.0
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.26.2
|
||||
* New functions `ax_facet_wrap()` and `ax_facet_grid()` to create faceting charts.
|
||||
* New function `apex_grid()` to combine several charts in a grid.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.8
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.22.2
|
||||
|
||||
## Bugfixes
|
||||
|
||||
* Fixed bad JavaScript namespace
|
||||
* Fixed bug in groups with scatter chart
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.7
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.22.0
|
||||
* New chart type: treemap, see vignette for example.
|
||||
* New function `ax_colors_manual()` to set color mapping manually.
|
||||
* `apex()` now accept `polarArea` as type of chart.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.6
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.20.1
|
||||
* New functions `add_line()` and `add_smooth_line()` to add simple or trend line on charts (scatter & bars).
|
||||
* New Shiny input: export, to retrieve chart's base64 dataURI.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.5
|
||||
==================
|
||||
|
||||
* Updated ApexCharts.js to 3.18.1
|
||||
* Support for candlestick charts in `apex()`.
|
||||
* `apex()` has a new argument `synchronize` to easily synchronize charts together.
|
||||
* `apex()` has new charts type: area-spline, area-step and step.
|
||||
|
||||
|
||||
## New functions
|
||||
|
||||
* `spark_box` to create boxes with sparkline, see corresponding vignette for more details.
|
||||
* `add_shade()`, `add_shade_weekend()`, `add_event()` to add annotations on time-series charts.
|
||||
* `add_hline()`, `add_vline()`, `add_point()` to add annotations on charts.
|
||||
* `set_tooltip_fixed()` to fix tooltip in specific position.
|
||||
|
||||
## Bugfixes
|
||||
|
||||
* Xaxis datetime now display properly with columns and bars.
|
||||
* Dark mode wasn't activated properly in `ax_theme()`.
|
||||
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.4
|
||||
==================
|
||||
|
||||
* Upgraded ApexCharts.js to 3.17.1
|
||||
* Fixed a bug in grouped bar charts with different levels in groups.
|
||||
* New vignette to explain how to sync charts.
|
||||
* New vignette to show shiny usage.
|
||||
* Added functions `set_input_click()`, `set_input_zoom()` and `set_input_selection()` to add interaction in Shiny applications.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.3
|
||||
==================
|
||||
|
||||
* Upgraded ApexCharts.js to 3.10.1
|
||||
* New function `format_num()` to format labels on y-axis or tooltip for example.
|
||||
* Added localization configs file, see `?ax_chart` for examples.
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.2
|
||||
==================
|
||||
|
||||
* Upgraded ApexCharts.js to 3.8.2
|
||||
* Set parent container height to 0 by default (fix [#2](https://github.com/dreamRs/apexcharter/issues/2)).
|
||||
|
||||
|
||||
|
||||
apexcharter 0.1.1
|
||||
==================
|
||||
|
||||
* First CRAN release: create interactive chart with the JavaScript 'ApexCharts' library. Types of graphics available : bars, columns, splines, lines, scatter, pie, donuts, heatmap, gauge.
|
||||
|
|
@ -0,0 +1,436 @@
|
|||
|
||||
add_annotation <- function(ax, type_annotation = c("xaxis", "yaxis", "points"),
|
||||
as_date = FALSE, position = "back", ...) {
|
||||
type_annotation <- match.arg(type_annotation)
|
||||
config <- dropNullsOrEmpty(list(...))
|
||||
if (!is.null(config$label) && is.character(config$label)) {
|
||||
config$label <- list(text = config$label)
|
||||
}
|
||||
if (!is.null(config$marker) && is.numeric(config$marker)) {
|
||||
config$marker <- list(size = config$marker)
|
||||
}
|
||||
if (identical(type_annotation, "yaxis")) {
|
||||
len <- length(config$y)
|
||||
} else {
|
||||
len <- length(config$x)
|
||||
}
|
||||
config <- rapply(
|
||||
object = config,
|
||||
f = rep_len,
|
||||
length.out = len,
|
||||
how = "replace"
|
||||
)
|
||||
extract <- function(el, index) {
|
||||
`[`(el, index)
|
||||
}
|
||||
annotations <- lapply(
|
||||
X = seq_len(len),
|
||||
FUN = function(i) {
|
||||
this <- rapply(
|
||||
object = config,
|
||||
f = extract,
|
||||
index = i,
|
||||
how = "list"
|
||||
)
|
||||
if (isTRUE(as_date)) {
|
||||
if (!is.null(this$x))
|
||||
this$x <- format_date(this$x)
|
||||
if (!is.null(this$x2))
|
||||
this$x2 <- format_date(this$x2)
|
||||
}
|
||||
this
|
||||
}
|
||||
)
|
||||
if (identical(type_annotation, "xaxis")) {
|
||||
if (!is.null(ax$x$ax_opts$annotations$xaxis)) {
|
||||
annotations <- c(annotations, ax$x$ax_opts$annotations$xaxis)
|
||||
ax$x$ax_opts$annotations$xaxis <- NULL
|
||||
}
|
||||
ax <- ax_annotations(
|
||||
ax = ax,
|
||||
position = position,
|
||||
xaxis = annotations
|
||||
)
|
||||
} else if (identical(type_annotation, "yaxis")) {
|
||||
if (!is.null(ax$x$ax_opts$annotations$yaxis)) {
|
||||
annotations <- c(annotations, ax$x$ax_opts$annotations$yaxis)
|
||||
ax$x$ax_opts$annotations$yaxis <- NULL
|
||||
}
|
||||
ax <- ax_annotations(
|
||||
ax = ax,
|
||||
position = position,
|
||||
yaxis = annotations
|
||||
)
|
||||
} else if (identical(type_annotation, "points")) {
|
||||
if (!is.null(ax$x$ax_opts$annotations$points)) {
|
||||
annotations <- c(annotations, ax$x$ax_opts$annotations$points)
|
||||
ax$x$ax_opts$annotations$points <- NULL
|
||||
}
|
||||
ax <- ax_annotations(
|
||||
ax = ax,
|
||||
position = position,
|
||||
points = annotations
|
||||
)
|
||||
}
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' Label for annotations
|
||||
#'
|
||||
#' @param text Text for the annotation label.
|
||||
#' @param borderColor Border color for the label.
|
||||
#' @param borderWidth Border width for the label.
|
||||
#' @param textAnchor The alignment of text relative to label's drawing position.
|
||||
#' @param position Available options: left or right.
|
||||
#' @param offsetX Sets the left offset for annotation label.
|
||||
#' @param offsetY Sets the top offset for annotation label.
|
||||
#' @param background Background Color for the annotation label.
|
||||
#' @param color ForeColor for the annotation label.
|
||||
#' @param fontSize FontSize for the annotation label.
|
||||
#' @param fontWeight Font-weight for the annotation label.
|
||||
#' @param fontFamily Font-family for the annotation label.
|
||||
#' @param cssClass A custom Css Class to give to the annotation label elements.
|
||||
#' @param padding Padding for the label: top, right, bottom, left.
|
||||
#'
|
||||
#' @return A \code{list} that can be used in \code{\link{add_shade}}, \code{\link{add_point}},
|
||||
#' \code{\link{add_event}}, \code{\link{add_event_marker}}.
|
||||
#' @export
|
||||
#'
|
||||
label <- function(text = NULL,
|
||||
borderColor = NULL,
|
||||
borderWidth = NULL,
|
||||
textAnchor = NULL,
|
||||
position = NULL,
|
||||
offsetX = NULL,
|
||||
offsetY = NULL,
|
||||
background = NULL,
|
||||
color = NULL,
|
||||
fontSize = NULL,
|
||||
fontWeight = NULL,
|
||||
fontFamily = NULL,
|
||||
cssClass = NULL,
|
||||
padding = c(2, 5, 2, 5)) {
|
||||
dropNulls(list(
|
||||
borderColor = borderColor,
|
||||
borderWidth = borderWidth,
|
||||
text = text,
|
||||
textAnchor = textAnchor,
|
||||
position = position,
|
||||
offsetX = offsetX,
|
||||
offsetY = offsetY,
|
||||
style = dropNulls(list(
|
||||
background = background,
|
||||
color = color,
|
||||
fontSize = fontSize,
|
||||
fontWeight = fontWeight,
|
||||
fontFamily = fontFamily,
|
||||
padding = list(
|
||||
top = padding[1],
|
||||
right = padding[2],
|
||||
bottom = padding[3],
|
||||
left = padding[4]
|
||||
)
|
||||
))
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
#' Marker for annotations
|
||||
#'
|
||||
#' @param size Size of the marker.
|
||||
#' @param fillColor Fill Color of the marker point.
|
||||
#' @param strokeColor Stroke Color of the marker point.
|
||||
#' @param strokeWidth Stroke Size of the marker point.
|
||||
#' @param shape Shape of the marker: \code{"circle"} or \code{"square"}.
|
||||
#' @param radius Radius of the marker (applies to square shape).
|
||||
#' @param OffsetX Sets the left offset of the marker.
|
||||
#' @param OffsetY Sets the top offset of the marker.
|
||||
#' @param cssClass Additional CSS classes to append to the marker.
|
||||
#'
|
||||
#' @return A \code{list} that can be used in \code{\link{add_point}}.
|
||||
#' @noRd
|
||||
#'
|
||||
marker <- function(size = NULL,
|
||||
fillColor = NULL,
|
||||
strokeColor = NULL,
|
||||
strokeWidth = NULL,
|
||||
shape = NULL,
|
||||
radius = NULL,
|
||||
OffsetX = NULL,
|
||||
OffsetY = NULL,
|
||||
cssClass = NULL) {
|
||||
dropNulls(list(
|
||||
size = size,
|
||||
fillColor = fillColor,
|
||||
strokeColor = strokeColor,
|
||||
strokeWidth = strokeWidth,
|
||||
shape = shape,
|
||||
radius = radius,
|
||||
OffsetX = OffsetX,
|
||||
OffsetY = OffsetY,
|
||||
cssClass = cssClass
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
#' @title Add a shaded area to a chart
|
||||
#'
|
||||
#' @description \code{add_shade()} allow to add a shaded area on specified range,
|
||||
#' \code{add_shade_weekend()} add a shadow on every week-end.
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param from Vector of position to start shadow.
|
||||
#' @param to Vector of position to end shadow.
|
||||
#' @param color Color of the shadow.
|
||||
#' @param opacity Opacity of the shadow.
|
||||
#' @param label Add a label to the shade, use a \code{character}
|
||||
#' or see \code{\link{label}} for more controls.
|
||||
#' @param ... Additional arguments, see
|
||||
#' \url{https://apexcharts.com/docs/options/annotations/} for possible options.
|
||||
#'
|
||||
#' @note \code{add_shade_weekend} only works if variable
|
||||
#' used for x-axis is of class \code{Date} or \code{POSIXt}.
|
||||
#'
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @name add-shade
|
||||
#'
|
||||
#' @example examples/add_shade.R
|
||||
add_shade <- function(ax, from, to, color = "#848484", opacity = 0.2, label = NULL, ...) {
|
||||
if (length(from) != length(to)) {
|
||||
stop("In add_shade: from and to must be of same length!", call. = FALSE)
|
||||
}
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "xaxis",
|
||||
as_date = TRUE,
|
||||
x = from,
|
||||
x2 = to,
|
||||
fillColor = color,
|
||||
opacity = opacity,
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @export
|
||||
#' @rdname add-shade
|
||||
add_shade_weekend <- function(ax, color = "#848484", opacity = 0.2, label = NULL, ...) {
|
||||
if (is.null(ax$x$xaxis)) {
|
||||
stop("add_shade_weekend can only be used with apex().", call. = FALSE)
|
||||
}
|
||||
if (inherits(ax$x$xaxis$min, c("Date", "POSIXt"))) {
|
||||
from <- as.Date(format(ax$x$xaxis$min, format = "%Y-%m-%d"))
|
||||
to <- as.Date(format(ax$x$xaxis$max, format = "%Y-%m-%d"))
|
||||
dates <- seq(from = from - 2, to = to + 2, by = "day")
|
||||
if (inherits(ax$x$xaxis$min, "Date")) {
|
||||
sat <- dates[format(dates, format = "%u") == 5]
|
||||
time <- "12:00:00"
|
||||
} else {
|
||||
sat <- dates[format(dates, format = "%u") == 6]
|
||||
time <- "00:00:00"
|
||||
}
|
||||
sun <- sat + 2
|
||||
ax <- add_shade(
|
||||
ax = ax,
|
||||
from = paste(format(sat, format = "%Y-%m-%d"), time),
|
||||
to = paste(format(sun, format = "%Y-%m-%d"), time),
|
||||
color = color,
|
||||
opacity = opacity,
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' @title Add an event to a chart
|
||||
#'
|
||||
#' @description Add a vertical line to mark a special event on a chart.
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param when Vector of position to place the event.
|
||||
#' @param color Color of the line.
|
||||
#' @param dash Creates dashes in borders of SVG path.
|
||||
#' A higher number creates more space between dashes in the border.
|
||||
#' Use \code{0} for plain line.
|
||||
#' @param label Add a label to the shade, use a \code{character}
|
||||
#' or see \code{\link{label}} for more controls.
|
||||
#' @param ... Additional arguments, see
|
||||
#' \url{https://apexcharts.com/docs/options/annotations/} for possible options.
|
||||
#'
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @seealso \code{\link{add_event_marker}} to add a point.
|
||||
#'
|
||||
#' @example examples/add_event.R
|
||||
add_event <- function(ax, when, color = "#E41A1C", dash = 4, label = NULL, ...) {
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "xaxis",
|
||||
as_date = TRUE,
|
||||
x = when,
|
||||
borderColor = color,
|
||||
strokeDashArray = dash,
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
#' @title Add an event marker to a chart
|
||||
#'
|
||||
#' @description Add a point with a label based on a datetime.
|
||||
#'
|
||||
#' @param when Vector of position to place the event.
|
||||
#' @inheritParams add_point
|
||||
#'
|
||||
#' @return An [apexchart()] `htmlwidget` object.
|
||||
#' @export
|
||||
#'
|
||||
#' @seealso \code{\link{add_event}} to add a vertical line.
|
||||
#'
|
||||
#' @example examples/add_event_marker.R
|
||||
add_event_marker <- function(ax, when, y,
|
||||
size = 5,
|
||||
color = "#000",
|
||||
fill = "#FFF",
|
||||
width = 2,
|
||||
shape = "circle",
|
||||
radius = 2,
|
||||
label = NULL, ...) {
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "points",
|
||||
position = "front",
|
||||
as_date = TRUE,
|
||||
x = when, y = y,
|
||||
marker = marker(
|
||||
size = size,
|
||||
fillColor = fill,
|
||||
strokeColor = color,
|
||||
strokeWidth = width,
|
||||
shape = shape,
|
||||
radius = radius
|
||||
),
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' Add horizontal or vertical line
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param value Vector of position for the line(s).
|
||||
#' @param color Color(s) of the line(s).
|
||||
#' @param dash Creates dashes in borders of SVG path.
|
||||
#' A higher number creates more space between dashes in the border.
|
||||
#' Use \code{0} for plain line.
|
||||
#' @param label Add a label to the shade, use a \code{character}
|
||||
#' or see \code{\link{label}} for more controls.
|
||||
#' @param ... Additional arguments, see
|
||||
#' \url{https://apexcharts.com/docs/options/annotations/} for possible options.
|
||||
#'
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @name add-vh-lines
|
||||
#'
|
||||
#' @example examples/add-lines.R
|
||||
add_hline <- function(ax, value, color = "#000", dash = 0, label = NULL, ...) {
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "yaxis",
|
||||
position = "front",
|
||||
as_date = FALSE,
|
||||
y = value,
|
||||
borderColor = color,
|
||||
strokeDashArray = dash,
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
#' @export
|
||||
#' @rdname add-vh-lines
|
||||
add_vline <- function(ax, value, color = "#000", dash = 0, label = NULL, ...) {
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "xaxis",
|
||||
position = "front",
|
||||
as_date = FALSE,
|
||||
x = value,
|
||||
borderColor = color,
|
||||
strokeDashArray = dash,
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' Add an annotation point
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param x Coordinate(s) on the x-axis.
|
||||
#' @param y Coordinate(s) on the y-axis.
|
||||
#' @param size Size of the marker.
|
||||
#' @param color Stroke Color of the marker point.
|
||||
#' @param fill Fill Color of the marker point.
|
||||
#' @param width Stroke Size of the marker point.
|
||||
#' @param shape Shape of the marker: \code{"circle"} or \code{"square"}.
|
||||
#' @param radius Radius of the marker (applies to square shape).
|
||||
#' @param label Add a label to the shade, use a \code{character}
|
||||
#' or see \code{\link{label}} for more controls.
|
||||
#' @param ... Additional arguments, see
|
||||
#' \url{https://apexcharts.com/docs/options/annotations/} for possible options.
|
||||
#'
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @seealso \code{\link{add_event_marker}} to add a point when x-axis is a datetime.
|
||||
#'
|
||||
#' @example examples/add_point.R
|
||||
add_point <- function(ax, x, y,
|
||||
size = 5,
|
||||
color = "#000",
|
||||
fill = "#FFF",
|
||||
width = 2,
|
||||
shape = "circle",
|
||||
radius = 2,
|
||||
label = NULL, ...) {
|
||||
add_annotation(
|
||||
ax = ax,
|
||||
type_annotation = "points",
|
||||
position = "front",
|
||||
as_date = inherits(x, c("Date", "POSIXct")),
|
||||
x = x, y = y,
|
||||
marker = marker(
|
||||
size = size,
|
||||
fillColor = fill,
|
||||
strokeColor = color,
|
||||
strokeWidth = width,
|
||||
shape = shape,
|
||||
radius = radius
|
||||
),
|
||||
label = label,
|
||||
...
|
||||
)
|
||||
}
|
236
R/apex-options.R
236
R/apex-options.R
|
@ -15,7 +15,7 @@
|
|||
#' @param legendClick Fires when user clicks on legend.
|
||||
#' @param selection Fires when user selects rect using the selection tool.
|
||||
#' @param dataPointSelection Fires when user clicks on a datapoint (bar/column/marker/bubble/donut-slice).
|
||||
#' @param dataPointMouseEnter Fires when user’s mouse enter on a datapoint (bar/column/marker/bubble/donut-slice).
|
||||
#' @param dataPointMouseEnter Fires when user's mouse enter on a datapoint (bar/column/marker/bubble/donut-slice).
|
||||
#' @param dataPointMouseLeave MouseLeave event for a datapoint (bar/column/marker/bubble/donut-slice).
|
||||
#' @param beforeZoom This function, if defined, runs just before zooming in/out of the chart allowing you to set a custom range for zooming in/out.
|
||||
#' @param zoomed Fires when user zooms in/out the chart using either the selection zooming tool or zoom in/out buttons.
|
||||
|
@ -23,11 +23,61 @@
|
|||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note All arguments should be JavaScript function defined with \code{htmlwidgets::JS}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in \code{\link{ax_chart}}.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/chart/events/}.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' if (interactive()) {
|
||||
#' library(shiny)
|
||||
#'
|
||||
#' ui <- fluidPage(
|
||||
#' fluidRow(
|
||||
#' column(
|
||||
#' width = 8, offset = 2,
|
||||
#' tags$h2("Apexchart in Shiny"),
|
||||
#' apexchartOutput("chart"),
|
||||
#' verbatimTextOutput(outputId = "res_click")
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#'
|
||||
#' server <- function(input, output, session) {
|
||||
#'
|
||||
#' output$chart <- renderApexchart({
|
||||
#' apexchart() %>%
|
||||
#' ax_chart(
|
||||
#' type = "bar",
|
||||
#' events = events_opts(
|
||||
#' dataPointSelection = JS(
|
||||
#' "function(event, chartContext, config) {
|
||||
#' Shiny.setInputValue('click', config.selectedDataPoints)
|
||||
#' }"
|
||||
#' )
|
||||
#' )
|
||||
#' ) %>%
|
||||
#' ax_series(
|
||||
#' list(
|
||||
#' name = "Example",
|
||||
#' data = sample(1:100, 5)
|
||||
#' )
|
||||
#' ) %>%
|
||||
#' ax_xaxis(
|
||||
#' categories = LETTERS[1:5]
|
||||
#' )
|
||||
#' })
|
||||
#'
|
||||
#' output$res_click <- renderPrint({
|
||||
#' input$click
|
||||
#' })
|
||||
#' }
|
||||
#'
|
||||
#' shinyApp(ui, server)
|
||||
#' }
|
||||
events_opts <- function(click = NULL,
|
||||
beforeMount = NULL,
|
||||
mounted = NULL,
|
||||
|
@ -63,12 +113,12 @@ events_opts <- function(click = NULL,
|
|||
|
||||
|
||||
|
||||
#' Bar options
|
||||
#' @title Bar options
|
||||
#'
|
||||
#' Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param horizontal Logical. This option will turn a column chart into a horiontal bar chart.
|
||||
#' @param endingShape Available Options: \code{"flat"}, \code{"rounded"} or \code{"arrow"}.
|
||||
#' @param horizontal Logical. This option will turn a column chart into a horizontal bar chart.
|
||||
#' @param endingShape Available Options: \code{"flat"} or \code{"rounded"}.
|
||||
#' @param columnWidth In column charts, columnWidth is the percentage of the available width in the grid-rect.
|
||||
#' @param barHeight In horizontal bar charts, barHeight is the percentage of the available height in the grid-rect.
|
||||
#' @param distributed Logical. Turn this option to make the bars discrete. Each value indicates one bar per series.
|
||||
|
@ -77,9 +127,24 @@ events_opts <- function(click = NULL,
|
|||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/bar/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' data("mpg", package = "ggplot2")
|
||||
#'
|
||||
#' apex(mpg, aes(manufacturer)) %>%
|
||||
#' ax_plotOptions(
|
||||
#' bar = bar_opts(
|
||||
#' endingShape = "rounded",
|
||||
#' columnWidth = 100,
|
||||
#' distributed = TRUE
|
||||
#' )
|
||||
#' )
|
||||
#'
|
||||
bar_opts <- function(horizontal = NULL,
|
||||
endingShape = NULL,
|
||||
columnWidth = NULL,
|
||||
|
@ -103,9 +168,9 @@ bar_opts <- function(horizontal = NULL,
|
|||
}
|
||||
|
||||
|
||||
#' Heatmap options
|
||||
#' @title Heatmap options
|
||||
#'
|
||||
#' Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param radius Numeric. Radius of the rectangle inside heatmap.
|
||||
#' @param enableShades Logical. Enable different shades of color depending on the value
|
||||
|
@ -114,9 +179,36 @@ bar_opts <- function(horizontal = NULL,
|
|||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/heatmap/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' df <- expand.grid(
|
||||
#' month = month.name,
|
||||
#' person = c("Obi-Wan", "Luke", "Anakin", "Leia")
|
||||
#' )
|
||||
#' df$value <- sample(0:1, nrow(df), TRUE)
|
||||
#'
|
||||
#' apex(
|
||||
#' data = df,
|
||||
#' mapping = aes(x = month, y = person, fill = value),
|
||||
#' type = "heatmap"
|
||||
#' ) %>%
|
||||
#' ax_plotOptions(
|
||||
#' heatmap = heatmap_opts(
|
||||
#' enableShades = FALSE,
|
||||
#' colorScale = list(
|
||||
#' ranges = list(
|
||||
#' list(from = 0, to = 0.5, color = "#FF0000"),
|
||||
#' list(from = 0.5, to = 1, color = "#088A08")
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#'
|
||||
heatmap_opts <- function(radius = NULL,
|
||||
enableShades = NULL,
|
||||
shadeIntensity = NULL,
|
||||
|
@ -134,9 +226,9 @@ heatmap_opts <- function(radius = NULL,
|
|||
}
|
||||
|
||||
|
||||
#' Radial bar options
|
||||
#' @title Radial bar options
|
||||
#'
|
||||
#' Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param size Numeric. Manual size of the radialBars instead of calculating automatically from default height / width.
|
||||
#' @param inverseOrder Logical. Whether to make the first value of series innermost or outermost.
|
||||
|
@ -150,9 +242,36 @@ heatmap_opts <- function(radius = NULL,
|
|||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/radialbar/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @examples
|
||||
#' apexchart() %>%
|
||||
#' ax_chart(type = "radialBar") %>%
|
||||
#' ax_plotOptions(
|
||||
#' radialBar = radialBar_opts(
|
||||
#' 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")
|
||||
radialBar_opts <- function(size = NULL,
|
||||
inverseOrder = NULL,
|
||||
startAngle = NULL,
|
||||
|
@ -180,12 +299,12 @@ radialBar_opts <- function(size = NULL,
|
|||
}
|
||||
|
||||
|
||||
#' Pie options
|
||||
#' @title Pie options
|
||||
#'
|
||||
#' Use these options in \code{\link{ax_plotOptions}}.
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param size Numeric. Custom size of the pie which will override the default size calculations.
|
||||
#' @param donut List with two fields \code{donutSize} (Donut / ring size in percentage relative to the total pie area.)
|
||||
#' @param donut List with two fields \code{size} (Donut / ring size in percentage relative to the total pie area.)
|
||||
#' and \code{background} (The background color of the pie).
|
||||
#' @param customScale Numeric. Transform the scale of whole pie/donut overriding the default calculations.
|
||||
#' @param offsetX Numeric. Sets the left offset of the whole pie area.
|
||||
|
@ -194,9 +313,20 @@ radialBar_opts <- function(size = NULL,
|
|||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/pie/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @examples
|
||||
#' data("mpg", package = "ggplot2")
|
||||
#'
|
||||
#' apex(mpg, aes(cyl), type = "donut") %>%
|
||||
#' ax_plotOptions(
|
||||
#' pie = pie_opts(
|
||||
#' donut = list(size = "90%", background = "#BABABA")
|
||||
#' )
|
||||
#' )
|
||||
pie_opts <- function(size = NULL,
|
||||
donut = NULL,
|
||||
customScale = NULL,
|
||||
|
@ -217,3 +347,75 @@ pie_opts <- function(size = NULL,
|
|||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @title Bubble options
|
||||
#'
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param minBubbleRadius Minimum radius size of a bubble.
|
||||
#' If a bubble value is too small to be displayed, this size will be used.
|
||||
#' @param maxBubbleRadius Maximum radius size of a bubble.
|
||||
#' If a bubble value is too large to cover the chart, this size will be used.
|
||||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/bubble/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' apex(
|
||||
#' data = mtcars,
|
||||
#' type = "scatter",
|
||||
#' mapping = aes(x = wt, y = mpg, z = qsec)
|
||||
#' ) %>%
|
||||
#' ax_plotOptions(
|
||||
#' bubble = bubble_opts(
|
||||
#' minBubbleRadius = 1,
|
||||
#' maxBubbleRadius = 20
|
||||
#' )
|
||||
#' )
|
||||
bubble_opts <- function(minBubbleRadius, maxBubbleRadius, ...) {
|
||||
dropNulls(
|
||||
list(
|
||||
minBubbleRadius = minBubbleRadius,
|
||||
maxBubbleRadius = maxBubbleRadius,
|
||||
...
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#' @title Boxplot options
|
||||
#'
|
||||
#' @description Use these options in [ax_plotOptions()].
|
||||
#'
|
||||
#' @param color.upper Color for the upper quartile (Q3 to median) of the box plot.
|
||||
#' @param color.lower Color for the lower quartile (median to Q1) of the box plot.
|
||||
#' @param ... Additional parameters.
|
||||
#'
|
||||
#' @note See \url{https://apexcharts.com/docs/options/plotoptions/boxplot/}.
|
||||
#'
|
||||
#' @return A \code{list} of options that can be used in [ax_plotOptions()].
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' data("mpg", package = "ggplot2")
|
||||
#' apex(mpg, aes(class, hwy), "boxplot") %>%
|
||||
#' ax_plotOptions(
|
||||
#' boxPlot = boxplot_opts(color.upper = "#848484", color.lower = "#848484" )
|
||||
#' )
|
||||
boxplot_opts <- function(color.upper, color.lower, ...) {
|
||||
dropNulls(
|
||||
list(
|
||||
colors = dropNulls(list(
|
||||
upper = color.upper,
|
||||
lower = color.lower
|
||||
)),
|
||||
...
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
766
R/apex-utils.R
766
R/apex-utils.R
File diff suppressed because it is too large
Load Diff
409
R/apex.R
409
R/apex.R
|
@ -1,27 +1,79 @@
|
|||
|
||||
#' Quick Apex Chart
|
||||
#' @title Quick ApexCharts
|
||||
#'
|
||||
#' @param data Default dataset to use for chart. If not already a \code{data.frame}, it will be coerced to with \code{as.data.frame}.
|
||||
#' @description Initialize a chart with three main parameters :
|
||||
#' data, mapping and type of chart.
|
||||
#'
|
||||
#' @param data Default dataset to use for chart. If not already
|
||||
#' a `data.frame`, it will be coerced to with `as.data.frame`.
|
||||
#' @param mapping Default list of aesthetic mappings to use for chart
|
||||
#' @param type Specify the chart type. Available Options: \code{"column"}, \code{"bar"}, \code{"line"},
|
||||
#' \code{"area"}, \code{"spline"}, \code{"pie"}, \code{"donut"}, \code{"radialBar"}, \code{"radar"}, \code{"scatter"}, \code{"heatmap"}.
|
||||
#' @param type Specify the chart type. Available options:
|
||||
#' `"column"`, `"bar"`,
|
||||
#' `"line"`, `"step"`, `"spline"`,
|
||||
#' `"area"`, `"area-step"`, `"area-spline"`,
|
||||
#' `"pie"`, `"donut"`,
|
||||
#' `"radialBar"`, `"radar"`, `"scatter"`,
|
||||
#' `"heatmap"`, `"treemap"`,
|
||||
#' `"timeline"`, `"dumbbell"` and `"slope"`.
|
||||
#' @param ... Other arguments passed on to methods. Not currently used.
|
||||
#' @param auto_update In Shiny application, update existing chart rather than generating new one.
|
||||
#' @param width A numeric input in pixels.
|
||||
#' @param height A numeric input in pixels.
|
||||
#' @param elementId Use an explicit element ID for the widget.
|
||||
#' @param synchronize Give a common id to charts to synchronize them (tooltip and zoom).
|
||||
#' @param serie_name Name for the serie displayed in tooltip,
|
||||
#' only used for single serie.
|
||||
#' @inheritParams apexchart
|
||||
#'
|
||||
#' @return An [apexchart()] `htmlwidget` object.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#'
|
||||
#' @importFrom rlang eval_tidy as_label
|
||||
#' @importFrom utils modifyList
|
||||
#' @importFrom stats complete.cases
|
||||
#'
|
||||
apex <- function(data, mapping, type = "column", ..., auto_update = TRUE, width = NULL, height = NULL, elementId = NULL) {
|
||||
type <- match.arg(type, c("column", "bar", "line", "area", "spline", "area-spline",
|
||||
"pie", "donut", "radialBar", "radar", "scatter", "heatmap"))
|
||||
#' @example examples/apex.R
|
||||
apex <- function(data, mapping,
|
||||
type = "column",
|
||||
...,
|
||||
auto_update = TRUE,
|
||||
synchronize = NULL,
|
||||
serie_name = NULL,
|
||||
width = NULL,
|
||||
height = NULL,
|
||||
elementId = NULL) {
|
||||
type <- match.arg(
|
||||
arg = type,
|
||||
choices = c(
|
||||
"column", "bar",
|
||||
"rangeBar", "dumbbell",
|
||||
"line", "spline", "step", "slope",
|
||||
"area", "area-spline", "area-step",
|
||||
"rangeArea",
|
||||
"pie", "donut",
|
||||
"radialBar",
|
||||
"radar",
|
||||
"polarArea",
|
||||
"scatter", "bubble",
|
||||
"heatmap",
|
||||
"treemap",
|
||||
"timeline",
|
||||
"candlestick",
|
||||
"boxplot"
|
||||
)
|
||||
)
|
||||
data <- as.data.frame(data)
|
||||
if (identical(type, "heatmap")) {
|
||||
mapping <- rename_aes_heatmap(mapping)
|
||||
} else {
|
||||
mapping <- rename_aes(mapping)
|
||||
}
|
||||
if (identical(type, "scatter") & is_sized(mapping)) {
|
||||
type <- "bubble"
|
||||
}
|
||||
mapdata <- lapply(mapping, rlang::eval_tidy, data = data)
|
||||
if (type %in% c("pie", "donut", "radialBar")) {
|
||||
type_no_compute <- c("candlestick", "boxplot", "timeline", "heatmap", "rangeArea", "rangeBar", "dumbbell", "slope")
|
||||
if (is.null(mapdata$y) & !type %in% type_no_compute) {
|
||||
mapdata <- compute_count(mapdata)
|
||||
}
|
||||
if (type %in% c("pie", "donut", "radialBar", "polarArea")) {
|
||||
opts <- list(
|
||||
chart = list(type = correct_type(type)),
|
||||
series = list1(mapdata$y),
|
||||
|
@ -29,45 +81,152 @@ apex <- function(data, mapping, type = "column", ..., auto_update = TRUE, width
|
|||
)
|
||||
} else {
|
||||
opts <- list(
|
||||
chart = list(type = correct_type(type)),
|
||||
series = make_series(mapdata, mapping, type)
|
||||
chart = dropNulls(list(
|
||||
type = correct_type(type),
|
||||
group = synchronize
|
||||
)),
|
||||
series = make_series(mapdata, mapping, type, serie_name)
|
||||
)
|
||||
}
|
||||
if (!is.null(synchronize)) {
|
||||
opts$yaxis$labels$minWidth <- 15
|
||||
}
|
||||
opts <- modifyList(opts, choose_config(type, mapdata))
|
||||
apexchart(
|
||||
ax_opts = opts, width = width, height = height,
|
||||
elementId = elementId, auto_update = auto_update
|
||||
if (isTRUE(getOption("apex.axis.light", default = TRUE))) {
|
||||
opts$yaxis$labels$style$colors <- "#848484"
|
||||
opts$xaxis$labels$style$colors <- "#848484"
|
||||
}
|
||||
ax <- apexchart(
|
||||
ax_opts = opts,
|
||||
width = width,
|
||||
height = height,
|
||||
elementId = elementId,
|
||||
auto_update = auto_update
|
||||
)
|
||||
if (inherits(mapdata$x, c("character", "Date", "POSIXt", "numeric", "integer")) & length(mapdata$x) > 0) {
|
||||
ax$x$xaxis <- list(
|
||||
min = min(mapdata$x, na.rm = TRUE),
|
||||
max = max(mapdata$x, na.rm = TRUE)
|
||||
)
|
||||
}
|
||||
ax$x$data <- data
|
||||
ax$x$mapping <- mapping
|
||||
ax$x$type <- type
|
||||
ax$x$serie_name <- serie_name
|
||||
class(ax) <- c(class(ax), "apex")
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
# Construct series
|
||||
make_series <- function(mapdata, mapping, type) {
|
||||
mapdata <- as.data.frame(mapdata)
|
||||
series_names <- "Series"
|
||||
if (!is.null(mapping$y))
|
||||
series_names <- rlang::as_label(mapping$y)
|
||||
series <- list(list(
|
||||
name = series_names,
|
||||
data = parse_df(mapdata, add_names = names(mapping))
|
||||
))
|
||||
if (is_grouped(names(mapping))) {
|
||||
mapdata <- rename_aes(mapdata)
|
||||
series <- lapply(
|
||||
X = unique(mapdata$group),
|
||||
FUN = function(x) {
|
||||
list(
|
||||
name = x,
|
||||
data = parse_df(mapdata[mapdata$group %in% x, ], add_names = names(mapping))
|
||||
)
|
||||
#' @importFrom rlang %||%
|
||||
make_series <- function(mapdata, mapping, type = NULL, serie_name = NULL, force_datetime_names = FALSE) {
|
||||
if (identical(type, "boxplot")) {
|
||||
series <- parse_boxplot_data(mapdata, serie_name = serie_name)
|
||||
} else if (identical(type, "candlestick")) {
|
||||
if (!all(c("x", "open", "high", "low", "close") %in% names(mapping)))
|
||||
stop("For candlestick charts 'x', 'open', 'high', 'low', and 'close' aesthetics must be provided.", call. = FALSE)
|
||||
if (!is.null(mapdata$group))
|
||||
warning("'group' aesthetic in candlestick chart is not supported", call. = FALSE)
|
||||
mapdata$group <- NULL
|
||||
series <- parse_candlestick_data(mapdata)
|
||||
} else if (isTRUE(type %in% c("rangeBar", "timeline"))) {
|
||||
if (!all(c("x", "start", "end") %in% names(mapping)))
|
||||
stop("For timeline charts 'x', 'start', and 'end' aesthetics must be provided.", call. = FALSE)
|
||||
if (is.null(mapdata$group))
|
||||
mapdata$group <- serie_name %||% rlang::as_label(mapping$x)
|
||||
series <- parse_timeline_data(mapdata)
|
||||
} else if (isTRUE(type %in% c("dumbbell"))) {
|
||||
if (!all(c("y", "x", "xend") %in% names(mapping)))
|
||||
stop("For dumbbell charts 'x', 'xend', and 'y' aesthetics must be provided.", call. = FALSE)
|
||||
if (is.null(mapdata$group))
|
||||
mapdata$group <- serie_name %||% rlang::as_label(mapping$x)
|
||||
series <- parse_dumbbell_data(mapdata)
|
||||
} else {
|
||||
mapdata <- as.data.frame(mapdata, stringsAsFactors = FALSE)
|
||||
if (all(rlang::has_name(mapdata, c("ymin", "ymax")))) {
|
||||
mapdata$y <- lapply(
|
||||
X = seq_len(nrow(mapdata)),
|
||||
FUN = function(i) {
|
||||
list(mapdata$ymin[i], mapdata$ymax[i])
|
||||
}
|
||||
)
|
||||
mapdata$ymin <- mapdata$ymax <- NULL
|
||||
}
|
||||
if (isTRUE(type %in% c("scatter", "bubble"))) {
|
||||
complete <- complete.cases(mapdata[c("x", "y")])
|
||||
n_missing <- sum(!complete)
|
||||
if (n_missing > 0) {
|
||||
mapdata <- mapdata[complete, ]
|
||||
warning(sprintf("apex: Removed %s rows containing missing values", n_missing), call. = FALSE)
|
||||
}
|
||||
)
|
||||
}
|
||||
if (is.character(mapdata$x))
|
||||
mapdata$x[is.na(mapdata$x)] <- "NA"
|
||||
x_order <- unique(mapdata$x)
|
||||
if (is_x_datetime(mapdata) & !identical(type, "rangeArea")) {
|
||||
add_names <- force_datetime_names
|
||||
x_order <- sort(x_order)
|
||||
} else {
|
||||
add_names <- names(mapdata)
|
||||
}
|
||||
if (is.null(serie_name) & !is.null(mapping$y))
|
||||
serie_name <- rlang::as_label(mapping$y)
|
||||
series <- list(dropNulls(list(
|
||||
name = as.character(serie_name),
|
||||
type = multi_type(type),
|
||||
data = parse_df(mapdata, add_names = add_names)
|
||||
)))
|
||||
if (is_grouped(mapping)) {
|
||||
mapdata <- rename_aes(mapdata)
|
||||
len_grp <- tapply(as.character(mapdata$group), as.character(mapdata$group), length)
|
||||
if (length(unique(len_grp)) > 1 & !isTRUE(type %in% c("scatter", "bubble"))) {
|
||||
warning("apex: all groups must have same length! You can use `tidyr::complete` for this.")
|
||||
}
|
||||
series <- lapply(
|
||||
X = unique(mapdata$group),
|
||||
FUN = function(x) {
|
||||
data <- mapdata[mapdata$group %in% x, ]
|
||||
data <- data[, setdiff(names(data), "group"), drop = FALSE]
|
||||
data <- data[order(match(x = data[["x"]], table = x_order, nomatch = 0L)), , drop = FALSE]
|
||||
dropNulls(list(
|
||||
name = as.character(x),
|
||||
type = multi_type(type),
|
||||
data = parse_df(
|
||||
data = data,
|
||||
add_names = add_names
|
||||
)
|
||||
))
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
series
|
||||
}
|
||||
|
||||
is_grouped <- function(x) {
|
||||
any(c("colour", "fill", "group") %in% x)
|
||||
any(c("colour", "fill", "group") %in% names(x))
|
||||
}
|
||||
|
||||
is_sized <- function(x) {
|
||||
any(c("size", "z") %in% names(x))
|
||||
}
|
||||
|
||||
#' @importFrom rlang quo
|
||||
rename_aes_heatmap <- function(mapping) {
|
||||
if (is.null(mapping["x"]))
|
||||
stop("apex(..., type = 'heatmap') must have an 'x' aesthetic", call. = FALSE)
|
||||
mapping[["x"]] <- quo(as.character(!!mapping[["x"]]))
|
||||
n_mapping <- names(mapping)
|
||||
n_mapping[n_mapping == "y"] <- "group"
|
||||
if ("fill" %in% n_mapping) {
|
||||
n_mapping[n_mapping == "fill"] <- "y"
|
||||
}
|
||||
if ("colour" %in% n_mapping) {
|
||||
n_mapping[n_mapping == "colour"] <- "y"
|
||||
}
|
||||
names(mapping) <- n_mapping
|
||||
return(mapping)
|
||||
}
|
||||
|
||||
rename_aes <- function(mapping) {
|
||||
|
@ -77,6 +236,9 @@ rename_aes <- function(mapping) {
|
|||
if ("fill" %in% names(mapping)) {
|
||||
names(mapping)[names(mapping) == "fill"] <- "group"
|
||||
}
|
||||
if ("size" %in% names(mapping)) {
|
||||
names(mapping)[names(mapping) == "size"] <- "z"
|
||||
}
|
||||
mapping
|
||||
}
|
||||
|
||||
|
@ -94,24 +256,67 @@ list1 <- function(x) {
|
|||
|
||||
# Change type of charts for helpers type
|
||||
correct_type <- function(type) {
|
||||
if (identical(type, "column")) {
|
||||
if (isTRUE(type %in% c("column"))) {
|
||||
"bar"
|
||||
} else if (identical(type, "spline")) {
|
||||
} else if (isTRUE(type %in% c("spline", "step", "slope"))) {
|
||||
"line"
|
||||
} else if (isTRUE(type %in% c("area-spline", "area-step"))) {
|
||||
"area"
|
||||
} else if (isTRUE(type %in% c("timeline", "dumbbell"))) {
|
||||
"rangeBar"
|
||||
} else if (identical(type, "boxplot")) {
|
||||
"boxPlot"
|
||||
} else {
|
||||
type
|
||||
}
|
||||
}
|
||||
|
||||
range_num <- function(x) {
|
||||
if (is.numeric(x)) {
|
||||
range(pretty(x))
|
||||
multi_type <- function(x) {
|
||||
multis <- c("column", "area", "line",
|
||||
"spline", "step", "scatter",
|
||||
"bubble", "rangeArea")
|
||||
if (isTRUE(x %in% multis)) {
|
||||
correct_type(x)
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
}
|
||||
|
||||
range_num <- function(x) {
|
||||
if (is.numeric(x) & length(x) > 0) {
|
||||
p <- pretty(x)
|
||||
list(
|
||||
values = p,
|
||||
n = length(p) - 1,
|
||||
range = range(p)
|
||||
)
|
||||
} else {
|
||||
NULL
|
||||
}
|
||||
}
|
||||
|
||||
#' @importFrom rlang %||%
|
||||
compute_count <- function(mapdata) {
|
||||
if (!is_grouped(mapdata)) {
|
||||
x <- mapdata$x
|
||||
weight <- mapdata$weight %||% rep(1, length(x))
|
||||
count <- tapply(weight, x, sum, na.rm = TRUE, simplify = FALSE)
|
||||
mapdata$x <- names(count)
|
||||
mapdata$y <- as.numeric(count)
|
||||
} else {
|
||||
weight <- mapdata$weight %||% rep(1, length(mapdata$x))
|
||||
count <- tapply(weight, mapdata[c("x", "group")], sum, na.rm = TRUE, simplify = FALSE)
|
||||
mapdata$x <- rep(rownames(count), ncol(count))
|
||||
mapdata$y <- unlist(count, use.names = FALSE)
|
||||
mapdata$group <- rep(colnames(count), each = nrow(count))
|
||||
}
|
||||
mapdata$y[is.na(mapdata$y)] <- 0
|
||||
return(mapdata)
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Configs ----
|
||||
|
||||
|
||||
# Switch between auto configs according to type & mapping
|
||||
|
@ -119,36 +324,54 @@ choose_config <- function(type, mapdata) {
|
|||
datetime <- is_x_datetime(mapdata)
|
||||
range_x <- range_num(mapdata$x)
|
||||
range_y <- range_num(mapdata$y)
|
||||
if (identical(type, "boxplot")) {
|
||||
box_horiz <- !is.numeric(mapdata$y) & is.numeric(mapdata$x)
|
||||
}
|
||||
switch(
|
||||
type,
|
||||
type,
|
||||
"bar" = config_bar(horizontal = TRUE),
|
||||
"column" = config_bar(horizontal = FALSE),
|
||||
"dumbbell" = config_bar(horizontal = TRUE, isDumbbell = TRUE),
|
||||
"column" = config_bar(horizontal = FALSE, datetime = datetime),
|
||||
"line" = config_line(datetime = datetime),
|
||||
"area" = config_line(datetime = datetime),
|
||||
"rangeArea" = config_line(datetime = datetime),
|
||||
"spline" = config_line(curve = "smooth", datetime = datetime),
|
||||
"scatter" = config_scatter(range_x = range_x, range_y = range_y),
|
||||
"step" = config_line(curve = "stepline", datetime = datetime),
|
||||
"area-spline" = config_line(curve = "smooth", datetime = datetime),
|
||||
"area-step" = config_line(curve = "stepline", datetime = datetime),
|
||||
"scatter" = config_scatter(range_x = range_x, range_y = range_y, datetime = datetime),
|
||||
"bubble" = config_scatter(range_x = range_x, range_y = range_y, datetime = datetime),
|
||||
"timeline" = config_timeline(),
|
||||
"candlestick" = config_candlestick(),
|
||||
"boxplot" = config_boxplot(horizontal = box_horiz),
|
||||
"slope" = config_slope(),
|
||||
list()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
# Config for column & bar charts
|
||||
config_bar <- function(horizontal = FALSE) {
|
||||
config_bar <- function(horizontal = FALSE, datetime = FALSE, isDumbbell = FALSE) {
|
||||
config <- list(
|
||||
dataLabels = list(enabled = FALSE),
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = horizontal
|
||||
horizontal = horizontal,
|
||||
isDumbbell = isDumbbell
|
||||
)
|
||||
),
|
||||
tooltip = list(
|
||||
shared = TRUE,
|
||||
intersect = FALSE,
|
||||
followCursor = TRUE
|
||||
),
|
||||
grid = list(
|
||||
yaxis = list(lines = list(show = !isTRUE(horizontal))),
|
||||
xaxis = list(lines = list(show = isTRUE(horizontal)))
|
||||
)
|
||||
)
|
||||
if (isTRUE(horizontal)) {
|
||||
config <- c(config, list(
|
||||
grid = list(
|
||||
yaxis = list(lines = list(show = FALSE)),
|
||||
xaxis = list(lines = list(show = TRUE))
|
||||
)
|
||||
))
|
||||
if (isTRUE(datetime)) {
|
||||
config$xaxis$type <- "datetime"
|
||||
}
|
||||
config
|
||||
}
|
||||
|
@ -158,7 +381,11 @@ config_line <- function(curve = "straight", datetime = FALSE) {
|
|||
config <- list(
|
||||
dataLabels = list(enabled = FALSE),
|
||||
stroke = list(
|
||||
curve = curve
|
||||
curve = curve,
|
||||
width = 2
|
||||
),
|
||||
yaxis = list(
|
||||
decimalsInFloat = 2
|
||||
)
|
||||
)
|
||||
if (isTRUE(datetime)) {
|
||||
|
@ -170,16 +397,80 @@ config_line <- function(curve = "straight", datetime = FALSE) {
|
|||
}
|
||||
|
||||
|
||||
config_scatter <- function(range_x, range_y) {
|
||||
config_scatter <- function(range_x, range_y, datetime = FALSE) {
|
||||
config <- list(
|
||||
dataLabels = list(enabled = FALSE),
|
||||
xaxis = list(
|
||||
min = range_x[1], max = range_x[2]
|
||||
type = "numeric",
|
||||
min = range_x$range[1],
|
||||
max = range_x$range[2],
|
||||
tickAmount = range_x$n,
|
||||
# labels = list(formatter = format_num("~r")),
|
||||
crosshairs = list(
|
||||
show = TRUE,
|
||||
stroke = list(dashArray = 0)
|
||||
)
|
||||
),
|
||||
yaxis = list(
|
||||
min = range_y[1], max = range_y[2]
|
||||
min = range_y$range[1],
|
||||
max = range_y$range[2],
|
||||
tickAmount = range_y$n,
|
||||
labels = list(formatter = format_num("~r")),
|
||||
tooltip = list(
|
||||
enabled = TRUE
|
||||
)
|
||||
),
|
||||
grid = list(
|
||||
xaxis = list(
|
||||
lines = list(
|
||||
show = TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
if (isTRUE(datetime)) {
|
||||
config$xaxis$type <- "datetime"
|
||||
}
|
||||
config
|
||||
}
|
||||
|
||||
config_timeline <- function() {
|
||||
list(
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = TRUE
|
||||
)
|
||||
),
|
||||
xaxis = list(
|
||||
type = "datetime"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
config_candlestick <- function() {
|
||||
list(
|
||||
xaxis = list(
|
||||
type = "datetime"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
config_boxplot <- function(horizontal = FALSE) {
|
||||
list(
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = horizontal
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
config_slope <- function() {
|
||||
list(
|
||||
plotOptions = list(
|
||||
line = list(
|
||||
isSlopeChart = TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
#' to create interactive and modern SVG charts.
|
||||
#'
|
||||
#' @name apexcharter-package
|
||||
#' @docType package
|
||||
#' @author Victor Perrier (@@dreamRs_fr)
|
||||
NULL
|
||||
"_PACKAGE"
|
||||
|
||||
#' apexcharter exported operators and S3 methods
|
||||
#'
|
||||
|
@ -29,3 +28,21 @@ NULL
|
|||
#' @export
|
||||
#' @rdname apexcharter-exports
|
||||
NULL
|
||||
|
||||
#' @importFrom ggplot2 vars
|
||||
#' @name vars
|
||||
#' @export
|
||||
#' @rdname apexcharter-exports
|
||||
NULL
|
||||
|
||||
#' @importFrom ggplot2 label_value
|
||||
#' @name label_value
|
||||
#' @export
|
||||
#' @rdname apexcharter-exports
|
||||
NULL
|
||||
|
||||
#' @importFrom htmlwidgets JS
|
||||
#' @name JS
|
||||
#' @export
|
||||
#' @rdname apexcharter-exports
|
||||
NULL
|
||||
|
|
147
R/apexcharter.R
147
R/apexcharter.R
|
@ -1,45 +1,50 @@
|
|||
|
||||
#' Create a apexcharts.js widget
|
||||
#' Create an ApexCharts widget
|
||||
#'
|
||||
#' @param ax_opts A \code{list} in JSON format with chart parameters.
|
||||
#' @param auto_update In Shiny application, update existing chart rather than generating new one.
|
||||
#' @param width A numeric input in pixels.
|
||||
#' @param height A numeric input in pixels.
|
||||
#' @param ax_opts A `list` in JSON format with chart parameters.
|
||||
#' @param auto_update In Shiny application, update existing chart
|
||||
#' rather than generating new one. Can be `TRUE`/`FALSE` or
|
||||
#' use [config_update()] for more control.
|
||||
#' @param width,height A numeric input in pixels.
|
||||
#' @param elementId Use an explicit element ID for the widget.
|
||||
#'
|
||||
#' @return A \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @return An [apexchart()] `htmlwidget` object.
|
||||
#' @seealso For quickly create a chart, see [apex()].
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmlwidgets createWidget sizingPolicy
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' library(apexcharter)
|
||||
#'
|
||||
#' apexchart(ax_opts = list(
|
||||
#' chart = list(type = "bar"),
|
||||
#' series = list(list(
|
||||
#' name = "Example",
|
||||
#' data = sample(1:100, 5)
|
||||
#' )),
|
||||
#' xaxis = list(categories = LETTERS[1:5])
|
||||
#' ))
|
||||
apexchart <- function(ax_opts = list(), auto_update = TRUE, width = NULL, height = NULL, elementId = NULL) {
|
||||
#' @example examples/apexchart.R
|
||||
apexchart <- function(ax_opts = list(),
|
||||
auto_update = TRUE,
|
||||
width = NULL,
|
||||
height = NULL,
|
||||
elementId = NULL) {
|
||||
|
||||
if (isTRUE(auto_update)) {
|
||||
auto_update <- config_update()
|
||||
}
|
||||
|
||||
# forward options using x
|
||||
x <- list(
|
||||
ax_opts = ax_opts,
|
||||
auto_update = auto_update
|
||||
auto_update = auto_update,
|
||||
sparkbox = FALSE
|
||||
)
|
||||
|
||||
# create widget
|
||||
htmlwidgets::createWidget(
|
||||
name = 'apexcharter',
|
||||
name = "apexcharter",
|
||||
x = x,
|
||||
width = width,
|
||||
height = height,
|
||||
package = 'apexcharter',
|
||||
package = "apexcharter",
|
||||
elementId = elementId,
|
||||
preRenderHook = function(widget) {
|
||||
widget$x$data <- NULL
|
||||
widget$x$mapping <- NULL
|
||||
widget$x$add_line <- NULL
|
||||
add_locale_apex(widget)
|
||||
},
|
||||
sizingPolicy = htmlwidgets::sizingPolicy(
|
||||
defaultWidth = "100%",
|
||||
defaultHeight = "100%",
|
||||
|
@ -51,37 +56,103 @@ apexchart <- function(ax_opts = list(), auto_update = TRUE, width = NULL, height
|
|||
browser.fill = TRUE,
|
||||
viewer.suppress = FALSE,
|
||||
browser.external = TRUE,
|
||||
padding = 20
|
||||
padding = 0
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
#' Shiny bindings for apexcharter
|
||||
# dput(tools::file_path_sans_ext(list.files("inst/apexcharts-locale/")))
|
||||
#' @importFrom jsonlite fromJSON
|
||||
add_locale_apex <- function(widget) {
|
||||
if (!is.null(widget$x$ax_opts$chart$defaultLocale)) {
|
||||
defaultLocale <- widget$x$ax_opts$chart$defaultLocale
|
||||
defaultLocale <- match.arg(
|
||||
arg = defaultLocale,
|
||||
choices = c("ca", "cs", "de", "el", "en", "es", "fi", "fr", "he", "hi",
|
||||
"hr", "hu", "hy", "id", "it", "ja", "ka", "ko", "lt", "nb", "nl",
|
||||
"pl", "pt-br", "pt", "rs", "ru", "se", "sk", "sl", "sq", "th",
|
||||
"tr", "ua", "zh-cn")
|
||||
)
|
||||
if (!is.null(widget$x$ax_opts$chart$locales)) {
|
||||
warning(
|
||||
"defaultLocale is used but will be ignored since",
|
||||
" a custom array for locales is provided."
|
||||
)
|
||||
} else {
|
||||
path <- system.file(
|
||||
file.path("apexcharts-locale", paste0(defaultLocale, ".json")),
|
||||
package = "apexcharter"
|
||||
)
|
||||
locale <- jsonlite::fromJSON(txt = path)
|
||||
widget$x$ax_opts$chart$locales <- list(locale)
|
||||
}
|
||||
}
|
||||
widget
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' Configuration for auto update
|
||||
#'
|
||||
#' Output and render functions for using apexcharter within Shiny
|
||||
#' @param series_animate Should the chart animate on re-rendering.
|
||||
#' @param update_options Update or not global options for chart.
|
||||
#' @param options_animate Should the chart animate on re-rendering.
|
||||
#' @param options_redrawPaths When the chart is re-rendered,
|
||||
#' should it draw from the existing paths or completely redraw
|
||||
#' the chart paths from the beginning. By default, the chart
|
||||
#' is re-rendered from the existing paths.
|
||||
#' @param update_synced_charts All the charts in a group should
|
||||
#' also update when one chart in a group is updated.
|
||||
#'
|
||||
#' @export
|
||||
config_update <- function(series_animate = TRUE,
|
||||
update_options = FALSE,
|
||||
options_animate = TRUE,
|
||||
options_redrawPaths = TRUE,
|
||||
update_synced_charts = FALSE) {
|
||||
list(
|
||||
series_animate = series_animate,
|
||||
update_options = update_options,
|
||||
options_animate = options_animate,
|
||||
options_redrawPaths = options_redrawPaths,
|
||||
update_synced_charts = update_synced_charts
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
#' @title Shiny bindings for apexcharter
|
||||
#'
|
||||
#' @description Output and render functions for using apexcharter within Shiny
|
||||
#' applications and interactive Rmd documents.
|
||||
#'
|
||||
#' @param outputId output variable to read from
|
||||
#' @param width,height Must be a valid CSS unit (like \code{'100\%'},
|
||||
#' \code{'400px'}, \code{'auto'}) or a number, which will be coerced to a
|
||||
#' string and have \code{'px'} appended.
|
||||
#' @param expr An expression that generates a apexcharter
|
||||
#' @param env The environment in which to evaluate \code{expr}.
|
||||
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
|
||||
#' @param outputId Output variable to read from.
|
||||
#' @param width,height Must be a valid CSS unit (like `100%`,
|
||||
#' `400px`, `auto`) or a number, which will be coerced to a
|
||||
#' string and have `px` appended.
|
||||
#' @param expr An expression that generates a calendar
|
||||
#' @param env The environment in which to evaluate `expr`.
|
||||
#' @param quoted Is `expr` a quoted expression (with `quote()`)? This
|
||||
#' is useful if you want to save an expression in a variable.
|
||||
#'
|
||||
#' @return Output element that can be included in UI. Render function to create output in server.
|
||||
#'
|
||||
#' @note To render a chart with facets (using [ax_facet_wrap()] or [ax_facet_grid()]) in Shiny,
|
||||
#' see [apexfacetOutput()] (in UI) and [renderApexfacet()] (in Server).
|
||||
#'
|
||||
#' @name apexcharter-shiny
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmlwidgets shinyWidgetOutput shinyRenderWidget
|
||||
apexchartOutput <- function(outputId, width = '100%', height = '400px'){
|
||||
htmlwidgets::shinyWidgetOutput(outputId, 'apexcharter', width, height, package = 'apexcharter')
|
||||
}
|
||||
#'
|
||||
#' @example examples/apexcharter-shiny.R
|
||||
apexchartOutput <- function(outputId, width = "100%", height = "400px") { # nocov start
|
||||
htmlwidgets::shinyWidgetOutput(outputId, "apexcharter", width, height, package = "apexcharter")
|
||||
} # nocov end
|
||||
|
||||
#' @rdname apexcharter-shiny
|
||||
#' @export
|
||||
renderApexchart <- function(expr, env = parent.frame(), quoted = FALSE) {
|
||||
renderApexchart <- function(expr, env = parent.frame(), quoted = FALSE) { # nocov start
|
||||
if (!quoted) { expr <- substitute(expr) } # force quoted
|
||||
htmlwidgets::shinyRenderWidget(expr, apexchartOutput, env, quoted = TRUE)
|
||||
}
|
||||
} # nocov end
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
#' Set specific color's series
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param values Named list, names represent data series, values colors to use.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @example examples/colors.R
|
||||
ax_colors_manual <- function(ax, values) {
|
||||
if (!inherits(ax, "apexcharter"))
|
||||
stop("ax_colors_manual: ax must be an apexcharter object", call. = FALSE)
|
||||
ax$x$colors_manual <- values
|
||||
ax$x$ax_opts$colors <- NULL
|
||||
groups <- get_groups(ax)
|
||||
values <- validate_values(values, groups)
|
||||
ax_colors(ax = ax, values$val)
|
||||
}
|
||||
|
||||
#' @importFrom rlang is_named
|
||||
validate_values <- function(values, groups) {
|
||||
if (!rlang::is_named(values))
|
||||
stop("values must be a named list or vector")
|
||||
nm <- names(values)
|
||||
val <- unname(unlist(values))
|
||||
nm_check <- setdiff(groups, nm)
|
||||
if (length(nm_check) > 0) {
|
||||
warning("Some groups doesn't have a corresponding color value")
|
||||
}
|
||||
list(
|
||||
nm = intersect(groups, nm),
|
||||
val = val[match(x = groups, table = nm, nomatch = 0L)]
|
||||
)
|
||||
}
|
||||
|
||||
get_groups <- function(ax) {
|
||||
if (!inherits(ax, "apexcharter"))
|
||||
stop("ax must be an apexcharter htmlwidget")
|
||||
if (is.null(ax$x$ax_opts$series))
|
||||
stop("ax must have a serie of data")
|
||||
groups <- lapply(ax$x$ax_opts$series, `[[`, "name")
|
||||
groups <- unlist(groups)
|
||||
as.character(groups)
|
||||
}
|
||||
|
||||
|
||||
|
102
R/data.R
102
R/data.R
|
@ -1,18 +1,100 @@
|
|||
#' UNHCR data for 2017
|
||||
|
||||
#' UNHCR data by continent of origin
|
||||
#'
|
||||
#' The dataset contains data about UNHCR's populations of concern for the year 2017.
|
||||
#' The dataset contains data about UNHCR's populations of concern summarised by continent of origin.
|
||||
#'
|
||||
#' @format A data frame with 11237 observations on the following 6 variables.
|
||||
#' @format A data frame with 913 observations and the following 4 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{country_origin}}{Country of origin of population}
|
||||
#' \item{\code{country_residence}}{Country / territory of asylum/residence of population}
|
||||
#' \item{\code{year}}{Year concerned.}
|
||||
#' \item{\code{population_type}}{Populations of concern : Refugees, Asylum-seekers, Internally displaced persons (IDPs), Returned refugees,
|
||||
#' Returned IDPs, Stateless persons, Others of concern.}
|
||||
#' \item{\code{value}}{Number of people concerned}
|
||||
#' \item{\code{continent_residence}}{Continent of origin of population}
|
||||
#' \item{\code{continent_origin}}{Continent of residence of population}
|
||||
#' \item{\code{continent_origin}}{Continent of residence of population.}
|
||||
#' \item{\code{n}}{Number of people concerned.}
|
||||
#' }
|
||||
#' @source UNHCR (The UN Refugee Agency) (\url{http://popstats.unhcr.org/en/overview})
|
||||
"unhcr_popstats_2017"
|
||||
#' @source UNHCR (The UN Refugee Agency) (\url{https://data.unhcr.org/})
|
||||
"unhcr_ts"
|
||||
|
||||
|
||||
|
||||
#' Electricity consumption and forecasting
|
||||
#'
|
||||
#' Electricity consumption per day in France for january and february of year 2020.
|
||||
#'
|
||||
#' @format A data frame with 120 observations and the following 3 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{date}}{date.}
|
||||
#' \item{\code{type}}{Type of data : realized or forecast.}
|
||||
#' \item{\code{value}}{Value in giga-watt per hour.}
|
||||
#' }
|
||||
#' @source Rte (Electricity Transmission Network in France) (\url{https://data.rte-france.com/})
|
||||
"consumption"
|
||||
|
||||
|
||||
#' Candlestick demo data
|
||||
#'
|
||||
#'
|
||||
#' @format A data frame with 60 observations and the following 5 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{datetime}}{Timestamp.}
|
||||
#' \item{\code{open}}{Open value.}
|
||||
#' \item{\code{high}}{Highest value.}
|
||||
#' \item{\code{low}}{Lowest value.}
|
||||
#' \item{\code{close}}{Close value.}
|
||||
#' }
|
||||
#' @source Apexcharts (\url{https://apexcharts.com/javascript-chart-demos/candlestick-charts/basic/})
|
||||
"candles"
|
||||
|
||||
|
||||
#' @title Paris Climate
|
||||
#'
|
||||
#' @description Average temperature and precipitation in Paris for the period 1971-2000.
|
||||
#'
|
||||
#'
|
||||
#' @format A data frame with 12 observations and the following 3 variables:
|
||||
#' \describe{
|
||||
#' \item{\code{month}}{Month}
|
||||
#' \item{\code{temperature}}{Temperature (in degree celsius).}
|
||||
#' \item{\code{precipitation}}{Precipitation (in mm).}
|
||||
#' }
|
||||
#' @source Wikipedia (\url{https://fr.wikipedia.org/wiki/Climat_de_Paris})
|
||||
"climate_paris"
|
||||
|
||||
|
||||
#' @title eco2mix data
|
||||
#'
|
||||
#' @description The dataset contains data about electricity consumption and production in France between 2012 and 2022.
|
||||
#'
|
||||
#' @format A data frame with 3,033 observations and 3 variables.
|
||||
#'
|
||||
#' @source Rte (Réseau et transport d'électricité) (\url{https://www.rte-france.com/eco2mix} and \url{https://opendata.reseaux-energies.fr/})
|
||||
"eco2mix"
|
||||
|
||||
|
||||
#' @title Temperature data
|
||||
#'
|
||||
#' @description The dataset contains data about temperatures in France between 2018 and 2022.
|
||||
#'
|
||||
#' @format A data frame with 365 observations and 6 variables.
|
||||
#'
|
||||
#' @source Enedis (\url{https://data.enedis.fr/explore/dataset/donnees-de-temperature-et-de-pseudo-rayonnement/})
|
||||
"temperatures"
|
||||
|
||||
|
||||
#' @title Life expectancy data
|
||||
#'
|
||||
#' @description The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
#'
|
||||
#' @format A data frame with 10 observations and 4 variables.
|
||||
#'
|
||||
#' @source gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
"life_expec"
|
||||
|
||||
#' @title Life expectancy data (long format)
|
||||
#'
|
||||
#' @description The dataset contains data about life expectancy in 1972 and 2007 for 10 countries.
|
||||
#'
|
||||
#' @format A data frame with 20 observations and 3 variables.
|
||||
#'
|
||||
#' @source gapminder package (\url{https://jennybc.github.io/gapminder/} and \url{https://www.gapminder.org/data/})
|
||||
"life_expec_long"
|
||||
|
||||
|
|
|
@ -0,0 +1,180 @@
|
|||
|
||||
#' @importFrom rlang eval_tidy
|
||||
get_facets <- function(data, rows, cols, type = c("wrap", "grid")) {
|
||||
type <- match.arg(type)
|
||||
byrows <- lapply(X = rows, FUN = eval_tidy, data = data)
|
||||
bycols <- lapply(X = cols, FUN = eval_tidy, data = data)
|
||||
facets <- split(x = data, f = c(bycols, byrows), sep = "|__|")
|
||||
facets <- lapply(
|
||||
X = seq_along(facets),
|
||||
FUN = function(i) {
|
||||
facet <- facets[[i]]
|
||||
attr(facet, "keys") <- strsplit(
|
||||
x = names(facets)[i],
|
||||
split = "|__|", fixed = TRUE
|
||||
)[[1]]
|
||||
facet
|
||||
}
|
||||
)
|
||||
label_row <- lapply(byrows, unique)
|
||||
label_row <- lapply(label_row, sort)
|
||||
label_row <- apply(expand.grid(label_row), 1, paste, collapse = "*")
|
||||
label_col <- lapply(bycols, unique)
|
||||
label_col <- lapply(label_col, sort)
|
||||
label_col <- apply(expand.grid(label_col), 1, paste, collapse = "*")
|
||||
list(
|
||||
facets = facets,
|
||||
nrow = if (identical(type, "grid")) n_facet(byrows) else NULL,
|
||||
ncol = if (identical(type, "grid")) n_facet(bycols) else NULL,
|
||||
label_row = label_row,
|
||||
label_col = label_col
|
||||
)
|
||||
}
|
||||
|
||||
n_facet <- function(l) {
|
||||
l <- lapply(l, function(x) {
|
||||
length(unique(x))
|
||||
})
|
||||
Reduce(`*`, l)
|
||||
}
|
||||
|
||||
#' @importFrom rlang %||% is_list is_named
|
||||
set_scale <- function(ax, values, scales = c("fixed", "free", "free_y", "free_x"), axis = c("x", "y", "y2")) {
|
||||
if (is.null(scales))
|
||||
return(ax)
|
||||
scales <- match.arg(scales)
|
||||
axis <- match.arg(axis)
|
||||
if (identical(axis, "y2")) {
|
||||
axis <- "y"
|
||||
wyaxis <- 2
|
||||
} else {
|
||||
wyaxis <- 1
|
||||
}
|
||||
if (is.null(values))
|
||||
return(ax)
|
||||
|
||||
if (inherits(values, c("numeric", "integer", "Date", "POSIXt"))) {
|
||||
range_vals <- range(pretty(values, n = 10), na.rm = TRUE)
|
||||
} else {
|
||||
range_vals <- NULL
|
||||
}
|
||||
|
||||
waxis <- switch(
|
||||
axis,
|
||||
"x" = "xaxis",
|
||||
"y" = "yaxis"
|
||||
)
|
||||
|
||||
this_axis <- ax$x$ax_opts[[waxis]]
|
||||
if (inherits(this_axis, "yaxis2")) {
|
||||
ax$x$ax_opts[[waxis]][[wyaxis]] <- set_scale_axis(
|
||||
this_axis[[wyaxis]],
|
||||
range_vals = range_vals,
|
||||
scales = scales,
|
||||
axis = axis
|
||||
)
|
||||
# ax$x$ax_opts[[waxis]][[2]] <- set_scale_axis(
|
||||
# this_axis[[2]],
|
||||
# range_vals = range_vals,
|
||||
# scales = scales,
|
||||
# axis = axis
|
||||
# )
|
||||
} else {
|
||||
ax$x$ax_opts[[waxis]] <- set_scale_axis(
|
||||
this_axis,
|
||||
range_vals = range_vals,
|
||||
scales = scales,
|
||||
axis = axis
|
||||
)
|
||||
}
|
||||
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
scale_fmt <- function(x, time = inherits(x, c("Date", "POSIXt"))) {
|
||||
if (is.null(x))
|
||||
return(NULL)
|
||||
if (time)
|
||||
x <- format_date(x)
|
||||
x
|
||||
}
|
||||
|
||||
|
||||
set_scale_axis <- function(this_axis,
|
||||
range_vals,
|
||||
scales = c("fixed", "free", "free_y", "free_x"),
|
||||
axis = c("x", "y")) {
|
||||
scales <- match.arg(scales)
|
||||
axis <- match.arg(axis)
|
||||
if (scales == "fixed") {
|
||||
this_axis$min <- this_axis$min %||% scale_fmt(range_vals[1])
|
||||
this_axis$max <- this_axis$max %||% scale_fmt(range_vals[2])
|
||||
} else if (scales == "free") {
|
||||
this_axis$min <- NULL
|
||||
this_axis$max <- NULL
|
||||
} else if (scales == "free_x") {
|
||||
if (axis == "y") {
|
||||
this_axis$min <- this_axis$min %||% scale_fmt(range_vals[1])
|
||||
this_axis$max <- this_axis$max %||% scale_fmt(range_vals[2])
|
||||
} else {
|
||||
this_axis$min <- NULL
|
||||
this_axis$max <- NULL
|
||||
}
|
||||
} else if (scales == "free_y") {
|
||||
if (axis == "x") {
|
||||
this_axis$min <- this_axis$min %||% scale_fmt(range_vals[1])
|
||||
this_axis$max <- this_axis$max %||% scale_fmt(range_vals[2])
|
||||
} else {
|
||||
this_axis$min <- NULL
|
||||
this_axis$max <- NULL
|
||||
}
|
||||
}
|
||||
return(this_axis)
|
||||
}
|
||||
|
||||
|
||||
get_option <- function(ax, opt1, opt2 = NULL) {
|
||||
if (is.null(opt2)) {
|
||||
ax$x$ax_opts[[opt1]]
|
||||
} else {
|
||||
ax$x$ax_opts[[opt1]][[opt2]]
|
||||
}
|
||||
}
|
||||
remove_option <- function(ax, opt1, opt2 = NULL) {
|
||||
if (is.null(opt2)) {
|
||||
ax$x$ax_opts[[opt1]] <- NULL
|
||||
} else {
|
||||
ax$x$ax_opts[[opt1]][[opt2]] <- NULL
|
||||
}
|
||||
ax
|
||||
}
|
||||
|
||||
|
||||
get_yaxis_serie <- function(ax, which = 1) {
|
||||
series <- ax$x$ax_opts$series
|
||||
yaxis <- ax$x$ax_opts$yaxis
|
||||
if (inherits(yaxis, c("yaxis", "yaxis2"))) {
|
||||
yaxis <- yaxis[[which]]
|
||||
name <- yaxis$serieName
|
||||
if (!is.null(name)) {
|
||||
series_names <- vapply(series, FUN = `[[`, "name", FUN.VALUE = character(1))
|
||||
indice <- which(name == series_names)
|
||||
} else {
|
||||
indice <- which
|
||||
}
|
||||
unlist(lapply(series[[indice]]$data, FUN = `[[`, "y"))
|
||||
} else {
|
||||
unlist(lapply(
|
||||
X = seq_along(series),
|
||||
FUN = function(indice) {
|
||||
unlist(lapply(series[[indice]]$data, FUN = `[[`, "y"))
|
||||
}
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
has_yaxis2 <- function(ax) {
|
||||
inherits(ax$x$ax_opts$yaxis, "yaxis2")
|
||||
}
|
|
@ -0,0 +1,498 @@
|
|||
|
||||
|
||||
#' @importFrom rlang eval_tidy is_null is_function
|
||||
build_facets <- function(chart) {
|
||||
data <- chart$x$data
|
||||
mapall <- lapply(chart$x$mapping, eval_tidy, data = data)
|
||||
labeller <- chart$x$facet$labeller
|
||||
title <- get_option(chart, "title")
|
||||
chart <- remove_option(chart, "title")
|
||||
subtitle <- get_option(chart, "subtitle")
|
||||
chart <- remove_option(chart, "subtitle")
|
||||
xaxis_title <- get_option(chart, "xaxis", "title")
|
||||
chart <- remove_option(chart, "xaxis", "title")
|
||||
yaxis_title <- get_option(chart, "yaxis", "title")
|
||||
chart <- remove_option(chart, "yaxis", "title")
|
||||
facets_list <- get_facets(
|
||||
data = data,
|
||||
rows = chart$x$facet$facets_row,
|
||||
cols = chart$x$facet$facets_col,
|
||||
type = chart$x$facet$type
|
||||
)
|
||||
facets_data <- facets_list$facets
|
||||
nrow_ <- facets_list$nrow %||% chart$x$facet$nrow
|
||||
ncol_ <- facets_list$ncol %||% chart$x$facet$ncol
|
||||
nums <- seq_along(facets_data)
|
||||
dims <- get_grid_dims(nums, nrow = nrow_, ncol = ncol_)
|
||||
grid <- matrix(
|
||||
data = c(
|
||||
nums,
|
||||
rep(NA, times = (dims$nrow * dims$ncol) - length(nums))
|
||||
),
|
||||
nrow = dims$nrow,
|
||||
ncol = dims$ncol,
|
||||
byrow = TRUE
|
||||
)
|
||||
lrow <- get_last_row(grid)
|
||||
facet_data_add_line <- if (!is.null(chart$x$add_line)) {
|
||||
get_facets(
|
||||
data = chart$x$add_line$data,
|
||||
rows = chart$x$facet$facets_row,
|
||||
cols = chart$x$facet$facets_col,
|
||||
type = chart$x$facet$type
|
||||
)$facets
|
||||
}
|
||||
facets <- lapply(
|
||||
X = nums,
|
||||
FUN = function(i) {
|
||||
new <- chart
|
||||
facet <- facets_data[[i]]
|
||||
if (identical(chart$x$facet$type, "wrap") && !is_null(labeller) && is_function(labeller)) {
|
||||
keys <- attr(facet, "keys")
|
||||
text <- labeller(keys)
|
||||
new <- ax_title(new, text = text, margin = 0, floating = length(text) <= 1)
|
||||
}
|
||||
mapdata <- lapply(chart$x$mapping, eval_tidy, data = facet)
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_y") & chart$x$type %in% c("bar")) {
|
||||
mapdata <- complete_mapdata(mapdata, mapall)
|
||||
}
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_x") & chart$x$type %in% c("column")) {
|
||||
mapdata <- complete_mapdata(mapdata, mapall)
|
||||
}
|
||||
new$x$ax_opts$series <- make_series(mapdata, chart$x$mapping, chart$x$type, chart$x$serie_name)
|
||||
new <- set_scale(new, mapall$x, scales = chart$x$facet$scales, axis = "x")
|
||||
new <- set_scale(new, mapall$y, scales = chart$x$facet$scales, axis = "y")
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_x")) {
|
||||
new <- ax_yaxis(new, show = i %in% grid[, 1])
|
||||
}
|
||||
# if (chart$x$facet$scales %in% c("fixed", "free_y")) {
|
||||
# new <- ax_xaxis(new, labels = list(show = i %in% lrow), axisTicks = list(show = TRUE))
|
||||
# }
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_y") & chart$x$type %in% c("bar", "column")) {
|
||||
new <- ax_xaxis(new, labels = list(show = i %in% lrow))
|
||||
}
|
||||
if (!is.null(new$x$colors_manual)) {
|
||||
new <- ax_colors_manual(ax = new, values = new$x$colors_manual)
|
||||
}
|
||||
if (!is.null(facet_data_add_line)) {
|
||||
maplinedata <- lapply(chart$x$add_line$mapping, eval_tidy, data = facet_data_add_line[[i]])
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_y") & chart$x$type %in% c("bar")) {
|
||||
maplinedata <- complete_mapdata(maplinedata, mapall)
|
||||
}
|
||||
if (chart$x$facet$scales %in% c("fixed", "free_x") & chart$x$type %in% c("column")) {
|
||||
maplinedata <- complete_mapdata(maplinedata, mapall)
|
||||
}
|
||||
new$x$ax_opts$series <- c(
|
||||
new$x$ax_opts$series,
|
||||
make_series(
|
||||
mapdata = maplinedata,
|
||||
mapping = chart$x$add_line$mapping,
|
||||
type = chart$x$add_line$type,
|
||||
serie_name = chart$x$add_line$serie_name,
|
||||
force_datetime_names = c("x", "y")
|
||||
)
|
||||
)
|
||||
# new <- add_line(
|
||||
# ax = new,
|
||||
# mapping = chart$x$add_line$mapping,
|
||||
# data = facet_data_add_line[[i]],
|
||||
# type = chart$x$add_line$type,
|
||||
# serie_name = chart$x$add_line$serie_name
|
||||
# )
|
||||
}
|
||||
if (has_yaxis2(new)) {
|
||||
values <- get_yaxis_serie(chart, 2)
|
||||
new <- set_scale(new, values, scales = chart$x$facet$scales, axis = "y2")
|
||||
}
|
||||
new$height <- chart$height %||% chart$x$facet$chart_height
|
||||
new$x$facet <- NULL
|
||||
class(new) <- setdiff(class(new), "apex_facet")
|
||||
return(new)
|
||||
}
|
||||
)
|
||||
list(
|
||||
facets = facets,
|
||||
type = chart$x$facet$type,
|
||||
nrow = facets_list$nrow,
|
||||
ncol = facets_list$ncol,
|
||||
label_row = facets_list$label_row,
|
||||
label_col = facets_list$label_col,
|
||||
title = title,
|
||||
subtitle = subtitle,
|
||||
xaxis_title = xaxis_title,
|
||||
yaxis_title = yaxis_title
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
get_last_row <- function(mat) {
|
||||
apply(X = mat, MARGIN = 2, FUN = function(x) {
|
||||
x <- x[!is.na(x)]
|
||||
x[length(x)]
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @title Facets for ApexCharts
|
||||
#'
|
||||
#' @description Create matrix of charts by row and column faceting variable (`ax_facet_grid`),
|
||||
#' or by specified number of row and column for faceting variable(s) (`ax_facet_wrap`).
|
||||
#'
|
||||
#' @param ax An [apexchart()] `htmlwidget` object.
|
||||
#' @param facets Variable(s) to use for facetting, wrapped in `vars(...)`.
|
||||
#' @param nrow,ncol Number of row and column in output matrix.
|
||||
#' @param scales Should scales be fixed (`"fixed"`, the default),
|
||||
#' free (`"free"`), or free in one dimension (`"free_x"`, `"free_y"`)?
|
||||
#' @param labeller A function with one argument containing for each facet the value of the faceting variable.
|
||||
#' @param chart_height Individual chart height, ignored if an height is defined in `apex()` or `apexcharter()`.
|
||||
#' @param grid_width Total width for the grid, regardless of the number of column.
|
||||
#'
|
||||
#' @return An [apexchart()] `htmlwidget` object with an additionnal class `"apex_facet"`.
|
||||
#'
|
||||
#' @details # Warning
|
||||
#' To properly render in Shiny applications, use [apexfacetOutput()] (in UI) and [renderApexfacet()] (in Server).
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @name apex-facets
|
||||
#'
|
||||
#' @importFrom rlang quos syms
|
||||
#'
|
||||
#' @example examples/facet_wrap.R
|
||||
ax_facet_wrap <- function(ax,
|
||||
facets,
|
||||
nrow = NULL,
|
||||
ncol = NULL,
|
||||
scales = c("fixed", "free", "free_y", "free_x"),
|
||||
labeller = label_value,
|
||||
chart_height = "300px",
|
||||
grid_width = "100%") {
|
||||
if (!inherits(ax, "apex"))
|
||||
stop("ax_facet_wrap only works with charts generated with apex()", call. = FALSE)
|
||||
scales <- match.arg(scales)
|
||||
if (is.character(facets))
|
||||
facets <- quos(!!!syms(facets))
|
||||
ax$x$facet <- list(
|
||||
facets_row = facets,
|
||||
nrow = nrow,
|
||||
ncol = ncol,
|
||||
scales = scales,
|
||||
labeller = labeller,
|
||||
chart_height = chart_height,
|
||||
grid_width = grid_width,
|
||||
type = "wrap"
|
||||
)
|
||||
class(ax) <- c("apex_facet", class(ax))
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
#' @param rows,cols A set of variables or expressions quoted by `vars()`
|
||||
#' and defining faceting groups on the rows or columns dimension.
|
||||
#' @export
|
||||
#'
|
||||
#' @rdname apex-facets
|
||||
#'
|
||||
#' @example examples/facet_grid.R
|
||||
ax_facet_grid <- function(ax,
|
||||
rows = NULL,
|
||||
cols = NULL,
|
||||
scales = c("fixed", "free", "free_y", "free_x"),
|
||||
labeller = label_value,
|
||||
chart_height = "300px",
|
||||
grid_width = "100%") {
|
||||
if (!inherits(ax, "apex"))
|
||||
stop("ax_facet_wrap only works with charts generated with apex()", call. = FALSE)
|
||||
scales <- match.arg(scales)
|
||||
if (!is.null(rows) && is.character(rows))
|
||||
rows <- quos(!!!syms(rows))
|
||||
if (!is.null(cols) && is.character(cols))
|
||||
cols <- quos(!!!syms(cols))
|
||||
ax$x$facet <- list(
|
||||
facets_row = rows,
|
||||
facets_col = cols,
|
||||
nrow = NULL,
|
||||
ncol = NULL,
|
||||
scales = scales,
|
||||
labeller = labeller,
|
||||
chart_height = chart_height,
|
||||
grid_width = grid_width,
|
||||
type = "grid"
|
||||
)
|
||||
class(ax) <- c("apex_facet", class(ax))
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Tag ---------------------------------------------------------------------
|
||||
|
||||
#' @importFrom rlang %||%
|
||||
#' @importFrom htmltools tags css validateCssUnit
|
||||
build_facet_tag <- function(x) {
|
||||
facets <- build_facets(x)
|
||||
content <- facets$facets
|
||||
d <- get_grid_dims(content, x$x$facet$nrow, x$x$facet$ncol)
|
||||
row_after <- col_before <- NULL
|
||||
if (!is.null(facets$xaxis_title)) {
|
||||
if (identical(facets$type, "wrap")) {
|
||||
area <- paste(
|
||||
d$nrow + 1,
|
||||
1,
|
||||
d$nrow + 1,
|
||||
d$ncol + 2,
|
||||
sep = " / "
|
||||
)
|
||||
} else {
|
||||
area <- paste(
|
||||
(facets$nrow %||% 1) + 1 + !is.null(facets$ncol),
|
||||
1,
|
||||
(facets$nrow %||% 1) + 1 + !is.null(facets$ncol),
|
||||
(facets$ncol %||% 1) + 2,
|
||||
sep = " / "
|
||||
)
|
||||
}
|
||||
TAGX <- tags$div(
|
||||
class = "apexcharter-facet-xaxis-title",
|
||||
facets$xaxis_title$text,
|
||||
style = make_styles(facets$xaxis_title$style),
|
||||
style = paste("grid-area:", area, ";")
|
||||
)
|
||||
content <- c(content, list(TAGX))
|
||||
row_after <- "30px"
|
||||
}
|
||||
if (!is.null(facets$yaxis_title)) {
|
||||
if (identical(facets$type, "wrap")) {
|
||||
area <- paste(
|
||||
1,
|
||||
1,
|
||||
d$nrow + 1,
|
||||
2,
|
||||
sep = " / "
|
||||
)
|
||||
} else {
|
||||
area <- paste(
|
||||
1,
|
||||
1,
|
||||
(facets$nrow %||% 1) + 1 + !is.null(facets$ncol),
|
||||
2,
|
||||
sep = " / "
|
||||
)
|
||||
}
|
||||
TAGY <- tags$div(
|
||||
class = "apexcharter-facet-yaxis-title apexcharter-facet-rotate180",
|
||||
facets$yaxis_title$text,
|
||||
style = make_styles(facets$yaxis_title$style),
|
||||
style = paste("grid-area:", area, ";")
|
||||
)
|
||||
content <- c(content, list(TAGY))
|
||||
col_before <- "30px"
|
||||
}
|
||||
if (identical(facets$type, "wrap")) {
|
||||
TAG <- build_grid(
|
||||
content = content,
|
||||
nrow = d$nrow,
|
||||
ncol = d$ncol,
|
||||
row_after = row_after,
|
||||
col_before = col_before
|
||||
)
|
||||
} else if (identical(facets$type, "grid")) {
|
||||
if (!is.null(facets$nrow)) {
|
||||
for (i in seq_along(facets$label_row)) {
|
||||
content <- append(
|
||||
x = content,
|
||||
values = tagList(tags$div(
|
||||
class = "apexcharter-facet-row-label",
|
||||
x$x$facet$labeller(facets$label_row[i])
|
||||
)),
|
||||
after = ((facets$ncol %||% 1 + 1) * i) - 1
|
||||
)
|
||||
}
|
||||
}
|
||||
if (!is.null(facets$ncol)) {
|
||||
content <- tagList(
|
||||
lapply(
|
||||
X = facets$label_col,
|
||||
FUN = function(label_col) {
|
||||
tags$div(x$x$facet$labeller(label_col), class = "apexcharter-facet-col-label")
|
||||
}
|
||||
),
|
||||
if (!is.null(facets$nrow)) tags$div(),
|
||||
content
|
||||
)
|
||||
}
|
||||
TAG <- build_grid(
|
||||
content,
|
||||
nrow = facets$nrow %||% 1,
|
||||
ncol = facets$ncol %||% 1,
|
||||
row_before = if (!is.null(facets$ncol)) "30px",
|
||||
col_after = if (!is.null(facets$nrow)) "30px",
|
||||
row_gap = "3px",
|
||||
col_gap = "3px",
|
||||
row_after = row_after,
|
||||
col_before = col_before
|
||||
)
|
||||
} else {
|
||||
stop("Facetting must be wrap or grid", call. = FALSE)
|
||||
}
|
||||
if (!is.null(facets$subtitle)) {
|
||||
TAG <- tagList(
|
||||
tags$div(
|
||||
class = "apexcharter-facet-subtitle",
|
||||
facets$subtitle$text,
|
||||
style = make_styles(facets$subtitle$style)
|
||||
),
|
||||
TAG
|
||||
)
|
||||
}
|
||||
if (!is.null(facets$title)) {
|
||||
TAG <- tagList(
|
||||
tags$div(
|
||||
class = "apexcharter-facet-title",
|
||||
facets$title$text,
|
||||
style = make_styles(facets$title$style)
|
||||
),
|
||||
TAG
|
||||
)
|
||||
}
|
||||
TAG <- tags$div(
|
||||
style = css(width = validateCssUnit(x$x$facet$grid_width)),
|
||||
class = "apexcharter-facet",
|
||||
TAG
|
||||
)
|
||||
return(TAG)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Shiny -------------------------------------------------------------------
|
||||
|
||||
|
||||
#' @title Shiny bindings for faceting with apexcharter
|
||||
#'
|
||||
#' @description Output and render functions for using apexcharter faceting within Shiny
|
||||
#' applications and interactive Rmd documents.
|
||||
#'
|
||||
#' @param outputId output variable to read from
|
||||
#'
|
||||
#' @return An Apexcharts output that can be included in the application UI.
|
||||
#' @export
|
||||
#'
|
||||
#' @name apexcharter-shiny-facets
|
||||
#'
|
||||
#' @importFrom htmltools tagList
|
||||
#' @importFrom shiny uiOutput
|
||||
#' @importFrom htmlwidgets getDependency
|
||||
#'
|
||||
#' @example examples/facet-wrap-shiny.R
|
||||
apexfacetOutput <- function(outputId) {
|
||||
tagList(
|
||||
uiOutput(outputId = outputId),
|
||||
getDependency(name = "apexcharter", package = "apexcharter")
|
||||
)
|
||||
}
|
||||
|
||||
#' @param expr An expression that generates a apexcharter facet with [ax_facet_wrap()] or [ax_facet_grid()].
|
||||
#' @param env The environment in which to evaluate `expr`.
|
||||
#' @param quoted Is `expr` a quoted expression (with `quote()`)? This
|
||||
#' is useful if you want to save an expression in a variable.
|
||||
#'
|
||||
#' @seealso [ax_facet_wrap()], [ax_facet_grid()]
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @rdname apexcharter-shiny-facets
|
||||
#'
|
||||
#' @importFrom shiny exprToFunction createRenderFunction createWebDependency
|
||||
#' @importFrom htmltools renderTags resolveDependencies
|
||||
renderApexfacet <- function(expr, env = parent.frame(), quoted = FALSE) { # nocov start
|
||||
func <- exprToFunction(expr, env, quoted)
|
||||
createRenderFunction(
|
||||
func = func,
|
||||
transform = function(result, shinysession, name, ...) {
|
||||
if (is.null(result) || length(result) == 0)
|
||||
return(NULL)
|
||||
if (!inherits(result, "apex_facet")) {
|
||||
stop(
|
||||
"renderApexfacet: 'expr' must return an apexcharter facet object.",
|
||||
call. = FALSE
|
||||
)
|
||||
}
|
||||
TAG <- build_facet_tag(result)
|
||||
rendered <- renderTags(TAG)
|
||||
deps <- lapply(
|
||||
X = resolveDependencies(rendered$dependencies),
|
||||
FUN = createWebDependency
|
||||
)
|
||||
list(
|
||||
html = rendered$html,
|
||||
deps = deps
|
||||
)
|
||||
}, apexfacetOutput, list()
|
||||
)
|
||||
} # nocov end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Print methods -----------------------------------------------------------
|
||||
|
||||
#' @export
|
||||
print.apex_facet <- function(x, ...) { # nocov start
|
||||
TAG <- build_facet_tag(x)
|
||||
print(htmltools::browsable(TAG))
|
||||
} # nocov end
|
||||
|
||||
knit_print.apex_facet <- function(x, ..., options = NULL) { # nocov start
|
||||
TAG <- build_facet_tag(x)
|
||||
knitr::knit_print(htmltools::browsable(TAG), options = options, ...)
|
||||
} # nocov end
|
||||
|
||||
|
||||
|
||||
|
||||
# Complete ----------------------------------------------------------------
|
||||
|
||||
complete_mapdata <- function(mapdata, mapall) {
|
||||
data <- as.data.frame(mapdata)
|
||||
full_x <- unique(mapall$x)
|
||||
full_data <- data.frame(
|
||||
xorder = seq_along(full_x),
|
||||
x = full_x,
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
full_data <- merge(
|
||||
x = full_data,
|
||||
y = data,
|
||||
by = "x",
|
||||
all.x = TRUE,
|
||||
sort = FALSE
|
||||
)
|
||||
full_data <- full_data[order(full_data$xorder), ]
|
||||
full_data$xorder <- NULL
|
||||
full_data$y[is.na(full_data$y)] <- 0
|
||||
return(as.list(full_data))
|
||||
}
|
||||
|
||||
complete_data <- function(data, vars, fill_var, fill_value = 0) {
|
||||
full_data <- expand.grid(lapply(
|
||||
X = data[, vars],
|
||||
FUN = unique
|
||||
))
|
||||
full_data <- merge(
|
||||
x = full_data,
|
||||
y = data,
|
||||
by = vars,
|
||||
all.x = TRUE,
|
||||
sort = FALSE
|
||||
)
|
||||
full_data[[fill_var]][is.na(full_data[[fill_var]])] <- fill_value
|
||||
return(full_data)
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
|
||||
#' Format numbers (with D3)
|
||||
#'
|
||||
#' @param format Format for numbers, currency, percentage, e.g. \code{".0\%"} for rounded percentage.
|
||||
#' See online documentation : \url{https://github.com/d3/d3-format}.
|
||||
#' @param prefix Character string to append before formatted value.
|
||||
#' @param suffix Character string to append after formatted value.
|
||||
#' @param locale Localization to use, for example \code{"fr-FR"} for french,
|
||||
#' see possible values here: \url{https://github.com/d3/d3-format/tree/master/locale}.
|
||||
#'
|
||||
#' @return a \code{JS} function
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmlwidgets JS
|
||||
#'
|
||||
#' @example examples/format.R
|
||||
format_num <- function(format, prefix = "", suffix = "", locale = "en-US") {
|
||||
check_locale_d3(locale)
|
||||
path <- system.file(file.path("d3-format-locale", paste0(locale, ".json")), package = "apexcharter")
|
||||
if (path != "") {
|
||||
locale <- paste(readLines(con = path, encoding = "UTF-8"), collapse = "")
|
||||
}
|
||||
JS(sprintf(
|
||||
"function(value) {var locale = formatLocale(JSON.parse('%s')); return '%s' + locale.format('%s')(value) + '%s';}",
|
||||
locale, prefix, format, suffix
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
check_locale_d3 <- function(x) {
|
||||
json <- list.files(system.file("d3-format-locale", package = "apexcharter"))
|
||||
njson <- gsub("\\.json", "", json)
|
||||
if (!x %in% njson) {
|
||||
stop(paste(
|
||||
"Invalid D3 locale, must be one of:",
|
||||
paste(njson, collapse = ", ")
|
||||
), call. = FALSE)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' Format date in JS
|
||||
#'
|
||||
#' @param x Date to use in JavaScript
|
||||
#'
|
||||
#' @return a JavaScript string
|
||||
#' @export
|
||||
#'
|
||||
format_date <- function(x) {
|
||||
stopifnot(length(x) == 1)
|
||||
JS(sprintf("new Date('%s').getTime()", x))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
|
||||
get_grid_dims <- function(content, nrow = NULL, ncol = NULL) {
|
||||
n <- length(content)
|
||||
if (is.null(nrow) & !is.null(ncol))
|
||||
nrow <- ceiling(n / ncol)
|
||||
if (!is.null(nrow) & is.null(ncol))
|
||||
ncol <- ceiling(n / nrow)
|
||||
if (is.null(nrow) & is.null(ncol)) {
|
||||
if (n %% 3 < 1) {
|
||||
ncol <- 3
|
||||
nrow <- ceiling(n / ncol)
|
||||
} else {
|
||||
ncol <- 2
|
||||
nrow <- ceiling(n / ncol)
|
||||
}
|
||||
}
|
||||
list(nrow = nrow, ncol = ncol)
|
||||
}
|
||||
|
||||
|
||||
#' @importFrom htmltools tags
|
||||
build_grid <- function(content,
|
||||
nrow = NULL,
|
||||
ncol = NULL,
|
||||
row_gap = "5px",
|
||||
col_gap = "0px",
|
||||
row_before = NULL,
|
||||
row_after = NULL,
|
||||
col_before = NULL,
|
||||
col_after = NULL,
|
||||
height = NULL,
|
||||
width = NULL) {
|
||||
d <- get_grid_dims(content, nrow, ncol)
|
||||
col_style <- paste("grid-template-columns:", col_before, sprintf("repeat(%s, 1fr)", d$ncol), col_after, ";")
|
||||
row_style <- paste("grid-template-rows:", row_before, sprintf("repeat(%s, 1fr)", d$nrow), row_after, ";")
|
||||
tags$div(
|
||||
class = "apexcharter-grid-container",
|
||||
style = if (!is.null(height)) paste0("height:", height, ";"),
|
||||
style = if (!is.null(width)) paste0("width:", width, ";"),
|
||||
style = "display: grid;",
|
||||
style = col_style,
|
||||
style = row_style,
|
||||
style = sprintf("grid-column-gap: %s;", col_gap),
|
||||
style = sprintf("grid-row-gap: %s;", row_gap),
|
||||
content
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' Create a grid of ApexCharts
|
||||
#'
|
||||
#' @param ... Several \code{apexcharts} \code{htmlwidget} objects.
|
||||
#' @param nrow,ncol Number of rows and columns.
|
||||
#' @param row_gap,col_gap Gap between rows and columns.
|
||||
#' @param grid_area Custom grid area to make elements take more than a single
|
||||
#' cell in grid, see \url{https://cssgrid-generator.netlify.app/} for examples.
|
||||
#' @param height,width Height and width of the main grid.
|
||||
#' @param .list A list of \code{apexcharts} \code{htmlwidget} objects.
|
||||
#'
|
||||
#' @return Custom \code{apex_grid} object.
|
||||
#'
|
||||
#' @note You have to provide either height for the grid or individual chart height to make it work.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmltools tags
|
||||
#'
|
||||
#' @example examples/apex_grid.R
|
||||
apex_grid <- function(...,
|
||||
nrow = NULL,
|
||||
ncol = NULL,
|
||||
row_gap = "10px",
|
||||
col_gap = "0px",
|
||||
grid_area = NULL,
|
||||
height = NULL,
|
||||
width = NULL,
|
||||
.list = NULL) {
|
||||
content <- c(list(...), .list)
|
||||
if (!is.null(grid_area)) {
|
||||
stopifnot(length(grid_area) == length(content))
|
||||
content <- lapply(
|
||||
X = seq_along(content),
|
||||
FUN = function(i) {
|
||||
tags$div(
|
||||
style = paste0("grid-area:", grid_area[i]),
|
||||
content[i]
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
grid <- list(
|
||||
content = content,
|
||||
nrow = nrow,
|
||||
ncol = ncol,
|
||||
col_gap = col_gap,
|
||||
row_gap = row_gap,
|
||||
height = height,
|
||||
width = width
|
||||
)
|
||||
class(grid) <- c("apex_grid", class(grid))
|
||||
return(grid)
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Shiny -------------------------------------------------------------------
|
||||
|
||||
|
||||
#' @title Shiny bindings for grid with apexcharter
|
||||
#'
|
||||
#' @description Output and render functions for using apexcharter grid within Shiny
|
||||
#' applications and interactive Rmd documents.
|
||||
#'
|
||||
#' @param outputId output variable to read from
|
||||
#'
|
||||
#' @return An Apexcharts output that can be included in the application UI.
|
||||
#' @export
|
||||
#'
|
||||
#' @name apexcharter-shiny-grid
|
||||
#'
|
||||
#' @importFrom htmltools tagList
|
||||
#' @importFrom shiny uiOutput
|
||||
#' @importFrom htmlwidgets getDependency
|
||||
#'
|
||||
#' @example examples/grid-shiny.R
|
||||
apexgridOutput <- function(outputId) {
|
||||
tagList(
|
||||
uiOutput(outputId = outputId),
|
||||
getDependency(name = "apexcharter", package = "apexcharter")
|
||||
)
|
||||
}
|
||||
|
||||
#' @param expr An expression that generates a apexcharter grid.
|
||||
#' @param env The environment in which to evaluate \code{expr}.
|
||||
#' @param quoted Is \code{expr} a quoted expression (with \code{quote()})? This
|
||||
#' is useful if you want to save an expression in a variable.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @rdname apexcharter-shiny-grid
|
||||
#'
|
||||
#' @importFrom shiny exprToFunction createRenderFunction createWebDependency
|
||||
#' @importFrom htmltools renderTags resolveDependencies
|
||||
renderApexgrid <- function(expr, env = parent.frame(), quoted = FALSE) { # nocov start
|
||||
func <- exprToFunction(expr, env, quoted)
|
||||
createRenderFunction(
|
||||
func = func,
|
||||
transform = function(result, shinysession, name, ...) {
|
||||
if (is.null(result) || length(result) == 0)
|
||||
return(NULL)
|
||||
if (!inherits(result, "apex_grid")) {
|
||||
stop(
|
||||
"renderApexgrid: 'expr' must return an apexcharter grid object.",
|
||||
call. = FALSE
|
||||
)
|
||||
}
|
||||
TAG <- build_grid(
|
||||
result$content,
|
||||
nrow = result$nrow,
|
||||
ncol = result$ncol,
|
||||
col_gap = result$col_gap,
|
||||
row_gap = result$row_gap,
|
||||
height = result$height,
|
||||
width = result$width
|
||||
)
|
||||
rendered <- renderTags(TAG)
|
||||
deps <- lapply(
|
||||
X = resolveDependencies(rendered$dependencies),
|
||||
FUN = createWebDependency
|
||||
)
|
||||
list(
|
||||
html = rendered$html,
|
||||
deps = deps
|
||||
)
|
||||
}, apexgridOutput, list()
|
||||
)
|
||||
} # nocov end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Print methods -----------------------------------------------------------
|
||||
# nocov start
|
||||
#' @export
|
||||
print.apex_grid <- function(x, ...) {
|
||||
TAG <- build_grid(
|
||||
x$content,
|
||||
nrow = x$nrow,
|
||||
ncol = x$ncol,
|
||||
col_gap = x$col_gap,
|
||||
row_gap = x$row_gap,
|
||||
height = x$height,
|
||||
width = x$width
|
||||
)
|
||||
print(htmltools::browsable(TAG))
|
||||
}
|
||||
|
||||
knit_print.apex_grid <- function(x, ..., options = NULL) {
|
||||
TAG <- build_grid(
|
||||
x$content,
|
||||
nrow = x$nrow,
|
||||
ncol = x$ncol,
|
||||
col_gap = x$col_gap,
|
||||
row_gap = x$row_gap,
|
||||
height = x$height,
|
||||
width = x$width
|
||||
)
|
||||
knitr::knit_print(htmltools::browsable(TAG), options = options, ...)
|
||||
}
|
||||
# nocov end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
30
R/labs.R
30
R/labs.R
|
@ -1,7 +1,7 @@
|
|||
|
||||
#' Modify axis, legend, and chart labels
|
||||
#'
|
||||
#' @param ax A \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @template ax-default
|
||||
#' @param title Text for the title.
|
||||
#' @param subtitle Text for the subtitle.
|
||||
#' @param x Text for the x-axis label.
|
||||
|
@ -16,25 +16,39 @@
|
|||
#' tmin = c(3, 3, 5, 7, 11, 14, 16, 16, 13, 10, 6, 3)
|
||||
#' )
|
||||
#'
|
||||
#' apex(meteo_paris, type = "column", aes(x = month, y = tmin)) %>%
|
||||
#' apex(meteo_paris, type = "column", aes(x = month, y = tmin)) %>%
|
||||
#' ax_labs(
|
||||
#' title = "Average minimal temperature in Paris",
|
||||
#' subtitle = "Data from NOAA",
|
||||
#' x = "Month",
|
||||
#' y = "Temperature (°C)"
|
||||
#' x = "Month",
|
||||
#' y = "Temperature (\u00b0C)"
|
||||
#' )
|
||||
ax_labs <- function(ax, title = NULL, subtitle = NULL, x = NULL, y = NULL) {
|
||||
if (!is.null(title)) {
|
||||
ax <- ax_title(ax = ax, text = title)
|
||||
ax <- ax_title(
|
||||
ax = ax,
|
||||
text = title,
|
||||
style = list(fontWeight = 700, fontSize = "16px")
|
||||
)
|
||||
}
|
||||
if (!is.null(subtitle)) {
|
||||
ax <- ax_subtitle(ax = ax, text = subtitle)
|
||||
ax <- ax_subtitle(
|
||||
ax = ax,
|
||||
text = subtitle,
|
||||
style = list(fontWeight = 400, fontSize = "14px")
|
||||
)
|
||||
}
|
||||
if (!is.null(x)) {
|
||||
ax <- ax_xaxis(ax = ax, title = list(text = x))
|
||||
ax <- ax_xaxis(
|
||||
ax = ax,
|
||||
title = list(text = x, style = list(fontWeight = 400, fontSize = "14px"))
|
||||
)
|
||||
}
|
||||
if (!is.null(y)) {
|
||||
ax <- ax_yaxis(ax = ax, title = list(text = y))
|
||||
ax <- ax_yaxis(
|
||||
ax = ax,
|
||||
title = list(text = y, style = list(fontWeight = 400, fontSize = "14px"))
|
||||
)
|
||||
}
|
||||
ax
|
||||
}
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
|
||||
#' @title Add a line to a chart
|
||||
#'
|
||||
#' @description Add a line to an existing chart (bar, scatter and line types supported).
|
||||
#' On scatter charts you can also add a smooth line.
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param mapping Default list of aesthetic mappings to use for chart.
|
||||
#' @param data A \code{data.frame} to use to add a line, if \code{NULL} (default),
|
||||
#' the \code{data.frame} provided in \code{apex()} will be used.
|
||||
#' @param type Type of line.
|
||||
#' @param serie_name Name for the serie displayed in tooltip and legend.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @name add-line
|
||||
#'
|
||||
#' @example examples/mixed-charts.R
|
||||
add_line <- function(ax,
|
||||
mapping,
|
||||
data = NULL,
|
||||
type = c("line", "spline"),
|
||||
serie_name = NULL) {
|
||||
type <- match.arg(type)
|
||||
if (!inherits(ax, "apex"))
|
||||
stop("add_line: ax must have been created with apex() function.", call. = FALSE)
|
||||
if (is.null(ax$x$mixed_type)) {
|
||||
apex_type <- ax$x$ax_opts$chart$type
|
||||
ax$x$mixed_type <- apex_type
|
||||
} else {
|
||||
apex_type <- ax$x$mixed_type
|
||||
}
|
||||
if (!isTRUE(apex_type %in% c("line", "bar", "scatter", "candlestick", "rangeArea")))
|
||||
stop("add_line: apex() must be a column, scatter or candlestick chart.", call. = FALSE)
|
||||
if (!identical(apex_type, "rangeArea"))
|
||||
ax$x$ax_opts$chart$type <- "line"
|
||||
if (is.null(data))
|
||||
data <- ax$x$data
|
||||
data <- as.data.frame(data)
|
||||
mapdata <- lapply(mapping, rlang::eval_tidy, data = data)
|
||||
ax$x$ax_opts$series <- c(
|
||||
ax$x$ax_opts$series,
|
||||
make_series(mapdata, mapping, type, serie_name, force_datetime_names = c("x", "y"))
|
||||
)
|
||||
ax$x$add_line <- list(
|
||||
data = data,
|
||||
mapping = mapping,
|
||||
type = type,
|
||||
serie_name = serie_name
|
||||
)
|
||||
if (identical(apex_type, "scatter")) {
|
||||
if (is.null(ax$x$ax_opts$markers$size)) {
|
||||
ax$x$ax_opts$markers$size <- c(6, 0)
|
||||
} else {
|
||||
ax$x$ax_opts$markers$size <- c(ax$x$ax_opts$markers$size, 0)
|
||||
}
|
||||
}
|
||||
if (identical(apex_type, "bar")) {
|
||||
if (is.null(ax$x$ax_opts$stroke$width)) {
|
||||
ax$x$ax_opts$stroke$width <- c(0, 4)
|
||||
} else {
|
||||
ax$x$ax_opts$stroke$width <- c(ax$x$ax_opts$stroke$width, 4)
|
||||
}
|
||||
}
|
||||
if (identical(apex_type, "candlestick")) {
|
||||
if (is.null(ax$x$ax_opts$stroke$width)) {
|
||||
ax$x$ax_opts$stroke$width <- c(1, 4)
|
||||
} else {
|
||||
ax$x$ax_opts$stroke$width <- c(ax$x$ax_opts$stroke$width, 4)
|
||||
}
|
||||
}
|
||||
if (identical(type, "line")) {
|
||||
ax$x$ax_opts$stroke$curve <- "straight"
|
||||
} else if (identical(type, "spline")) {
|
||||
ax$x$ax_opts$stroke$curve <- "smooth"
|
||||
}
|
||||
return(ax)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#' @param formula Formula passed to the \code{method}, default to \code{y ~ x} from main aesthetics.
|
||||
#' @param model Model to use between \code{\link{lm}} or \code{\link{loess}}.
|
||||
#' @param n Number of points used for predictions.
|
||||
#' @param ... Arguments passed to \code{model}.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom stats lm loess predict
|
||||
#' @importFrom rlang !! sym
|
||||
#'
|
||||
#' @name add-line
|
||||
add_smooth_line <- function(ax,
|
||||
formula = y ~ x,
|
||||
model = c("lm", "loess"),
|
||||
n = 100,
|
||||
...,
|
||||
type = c("line", "spline"),
|
||||
serie_name = NULL) {
|
||||
model <- match.arg(model)
|
||||
type <- match.arg(type)
|
||||
if (!inherits(ax, "apex"))
|
||||
stop("add_smooth_line: ax must have been created with apex() function.", call. = FALSE)
|
||||
if (is.null(ax$x$mixed_type)) {
|
||||
apex_type <- ax$x$ax_opts$chart$type
|
||||
ax$x$mixed_type <- apex_type
|
||||
} else {
|
||||
apex_type <- ax$x$mixed_type
|
||||
}
|
||||
if (!isTRUE(apex_type %in% c("scatter")))
|
||||
stop("add_smooth_line: apex() must be a scatter chart.", call. = FALSE)
|
||||
ax$x$ax_opts$chart$type <- "line"
|
||||
data <- as.data.frame(ax$x$data)
|
||||
mapping <- ax$x$mapping
|
||||
mapdata <- lapply(mapping, rlang::eval_tidy, data = data)
|
||||
if (identical(model, "lm")) {
|
||||
model_results <- lm(formula = formula, data = mapdata, ...)
|
||||
} else if (identical(model, "loess")) {
|
||||
model_results <- loess(formula = formula, data = mapdata, ...)
|
||||
}
|
||||
new_data <- data.frame(x = seq(
|
||||
from = min(mapdata$x, na.rm = TRUE),
|
||||
to = max(mapdata$x, na.rm = TRUE),
|
||||
length.out = n
|
||||
))
|
||||
new_data$smooth <- predict(model_results, new_data)
|
||||
add_line(
|
||||
ax = ax,
|
||||
mapping = aes(x = `!!`(sym("x")), y = `!!`(sym("smooth"))),
|
||||
data = new_data,
|
||||
type = type,
|
||||
serie_name = serie_name
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
#' @importFrom shiny registerInputHandler
|
||||
.onLoad <- function(...) { # nocov start
|
||||
shiny::registerInputHandler("apex_click", function(data, ...) {
|
||||
if (is.null(data)) {
|
||||
NULL
|
||||
} else {
|
||||
value <- ununlist(data$value)
|
||||
if (isTRUE(data$datetime)) {
|
||||
if (is.list(value)) {
|
||||
value <- rapply(value, to_posix, how = "replace")
|
||||
} else {
|
||||
value <- to_posix(value)
|
||||
}
|
||||
}
|
||||
return(value)
|
||||
}
|
||||
}, force = TRUE)
|
||||
shiny::registerInputHandler("apex_datetime", function(data, ...) {
|
||||
if (is.null(data)) {
|
||||
NULL
|
||||
} else {
|
||||
result <- try({
|
||||
data$x <- list(
|
||||
min = to_posix(data$x$min),
|
||||
max = to_posix(data$x$max)
|
||||
)
|
||||
data
|
||||
}, silent = TRUE)
|
||||
if (inherits(result, "try-error")) {
|
||||
warning("apexcharter: Failed to parse dates!", call. = FALSE)
|
||||
data
|
||||
} else {
|
||||
result
|
||||
}
|
||||
}
|
||||
}, force = TRUE)
|
||||
register_s3_method("knitr", "knit_print", "apex_facet")
|
||||
register_s3_method("knitr", "knit_print", "apex_grid")
|
||||
} # nocov end
|
148
R/parse-data.R
148
R/parse-data.R
|
@ -6,9 +6,23 @@
|
|||
#' @param data A \code{data.frame} or an object coercible to \code{data.frame}.
|
||||
#' @param add_names Use names of columns in output. Can be logical to
|
||||
#' reuse \code{data} names or a character vector of new names.
|
||||
#'
|
||||
#' @return A \code{list} that can be used to specify data in \code{\link{ax_series}} for example.
|
||||
#'
|
||||
#' @export
|
||||
#' @importFrom stats setNames
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' # All iris dataset
|
||||
#' parse_df(iris)
|
||||
#'
|
||||
#' # Keep variables names
|
||||
#' parse_df(iris[, 1:2], add_names = TRUE)
|
||||
#'
|
||||
#' # Use custom names
|
||||
#'
|
||||
#' parse_df(iris[, 1:2], add_names = c("x", "y"))
|
||||
#'
|
||||
parse_df <- function(data, add_names = FALSE) {
|
||||
data <- as.data.frame(data)
|
||||
|
@ -17,9 +31,10 @@ parse_df <- function(data, add_names = FALSE) {
|
|||
X = data[],
|
||||
FUN = function(x) {
|
||||
if (inherits(x, "Date")) {
|
||||
# as.numeric(x) * 86400000
|
||||
format(x)
|
||||
# js_date(x)
|
||||
as.numeric(x) * 1000 * 60*60*24
|
||||
} else if (inherits(x, "POSIXt")) {
|
||||
# js_date(x)
|
||||
as.numeric(x) * 1000
|
||||
} else if (inherits(x, "factor")) {
|
||||
as.character(x)
|
||||
|
@ -48,3 +63,132 @@ parse_df <- function(data, add_names = FALSE) {
|
|||
)
|
||||
return(ll)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @importFrom htmlwidgets JS
|
||||
js_date <- function(x) {
|
||||
if (inherits(x, "POSIXt"))
|
||||
x <- format(x, format = "%Y-%m-%d %H:%M:%S")
|
||||
lapply(sprintf("new Date('%s').getTime()", x), JS)
|
||||
}
|
||||
|
||||
parse_timeline_data <- function(.list) {
|
||||
if (is.null(.list$group)) {
|
||||
lapply(
|
||||
X = seq_len(length(.list[[1]])),
|
||||
FUN = function(i) {
|
||||
val <- lapply(.list, `[[`, i)
|
||||
l <- list(
|
||||
x = as.character(val$x),
|
||||
y = js_date(c(val$start, val$end))
|
||||
)
|
||||
if (!is.null(val$fill)) {
|
||||
l$fillColor <- val$fill
|
||||
}
|
||||
l
|
||||
}
|
||||
)
|
||||
} else {
|
||||
grouped <- as.data.frame(.list, stringsAsFactors = FALSE)
|
||||
grouped$group <- NULL
|
||||
grouped <- split(
|
||||
x = grouped,
|
||||
f = .list$group
|
||||
)
|
||||
grouped <- lapply(grouped, as.list)
|
||||
lapply(
|
||||
X = names(grouped),
|
||||
FUN = function(name) {
|
||||
list(
|
||||
name = name,
|
||||
data = parse_timeline_data(grouped[[name]])
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
parse_dumbbell_data <- function(.list) {
|
||||
if (is.null(.list$group)) {
|
||||
lapply(
|
||||
X = seq_len(length(.list[[1]])),
|
||||
FUN = function(i) {
|
||||
val <- lapply(.list, `[[`, i)
|
||||
l <- list(
|
||||
x = as.character(val$y),
|
||||
y = list(val$x, val$xend)
|
||||
)
|
||||
if (!is.null(val$fill)) {
|
||||
l$fillColor <- val$fill
|
||||
}
|
||||
l
|
||||
}
|
||||
)
|
||||
} else {
|
||||
grouped <- as.data.frame(.list, stringsAsFactors = FALSE)
|
||||
grouped$group <- NULL
|
||||
grouped <- split(
|
||||
x = grouped,
|
||||
f = .list$group
|
||||
)
|
||||
grouped <- lapply(grouped, as.list)
|
||||
lapply(
|
||||
X = names(grouped),
|
||||
FUN = function(name) {
|
||||
list(
|
||||
name = name,
|
||||
data = parse_dumbbell_data(grouped[[name]])
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
parse_candlestick_data <- function(.list) {
|
||||
list(list(
|
||||
type = "candlestick",
|
||||
data = lapply(
|
||||
X = seq_len(length(.list[[1]])),
|
||||
FUN = function(i) {
|
||||
val <- lapply(.list, `[[`, i)
|
||||
list(
|
||||
# x = js_date(val$x)[[1]],
|
||||
x = as.numeric(val$x) * 1000,
|
||||
y = c(val$open, val$high, val$low, val$close)
|
||||
)
|
||||
}
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
|
||||
#' @importFrom graphics boxplot
|
||||
parse_boxplot_data <- function(.list, serie_name = NULL) {
|
||||
if (!is.numeric(.list$y) & is.numeric(.list$x)) {
|
||||
.list[c("x", "y")] <- .list[c("y", "x")]
|
||||
}
|
||||
boxed <- boxplot(y ~ x, data = .list, plot = FALSE)
|
||||
list(dropNulls(list(
|
||||
serie_name = serie_name,
|
||||
type = "boxPlot",
|
||||
data = lapply(
|
||||
X = seq_along(boxed$names),
|
||||
FUN = function(i) {
|
||||
list(
|
||||
x = boxed$names[i],
|
||||
y = c(
|
||||
boxed$stats[1, i],
|
||||
boxed$stats[2, i],
|
||||
boxed$stats[3, i],
|
||||
boxed$stats[4, i],
|
||||
boxed$stats[5, i]
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
)))
|
||||
}
|
||||
|
|
190
R/proxy.R
190
R/proxy.R
|
@ -1,26 +1,28 @@
|
|||
|
||||
#' @title Proxy for \code{apexchart}
|
||||
#'
|
||||
#'
|
||||
#' @description Allow to update a chart in Shiny application.
|
||||
#'
|
||||
#' @param shinyId single-element character vector indicating the output ID of the
|
||||
#' chart to modify (if invoked from a Shiny module, the namespace will be added
|
||||
#' automatically)
|
||||
#' @param session the Shiny session object to which the chart belongs; usually the
|
||||
#' default value will suffice
|
||||
#' default value will suffice
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny getDefaultReactiveDomain
|
||||
#'
|
||||
apexchartProxy <- function(shinyId, session = shiny::getDefaultReactiveDomain()) {
|
||||
|
||||
|
||||
if (is.null(session)) {
|
||||
stop("apexchartProxy must be called from the server function of a Shiny app")
|
||||
}
|
||||
|
||||
|
||||
if (!is.null(session$ns) && nzchar(session$ns(NULL)) && substring(shinyId, 1, nchar(session$ns(""))) != session$ns("")) {
|
||||
shinyId <- session$ns(shinyId)
|
||||
}
|
||||
|
||||
|
||||
structure(
|
||||
list(
|
||||
session = session,
|
||||
|
@ -41,7 +43,7 @@ apexchartProxy <- function(shinyId, session = shiny::getDefaultReactiveDomain())
|
|||
#' @return A \code{apexchartProxy} \code{htmlwidget} object.
|
||||
#' @noRd
|
||||
.ax_proxy <- function(proxy, name, ...) {
|
||||
if (!"apexchart_Proxy" %in% class(proxy))
|
||||
if (!"apexchart_Proxy" %in% class(proxy))
|
||||
stop("This function must be used with a apexchartProxy object", call. = FALSE)
|
||||
proxy$session$sendCustomMessage(
|
||||
type = sprintf("update-apexchart-%s", name),
|
||||
|
@ -50,7 +52,7 @@ apexchartProxy <- function(shinyId, session = shiny::getDefaultReactiveDomain())
|
|||
proxy
|
||||
}
|
||||
.ax_proxy2 <- function(proxy, name, l) {
|
||||
if (!"apexchart_Proxy" %in% class(proxy))
|
||||
if (!"apexchart_Proxy" %in% class(proxy))
|
||||
stop("This function must be used with a apexchartProxy object", call. = FALSE)
|
||||
proxy$session$sendCustomMessage(
|
||||
type = sprintf("update-apexchart-%s", name),
|
||||
|
@ -62,9 +64,9 @@ apexchartProxy <- function(shinyId, session = shiny::getDefaultReactiveDomain())
|
|||
|
||||
|
||||
|
||||
#' @title Proxy for updating series.
|
||||
#'
|
||||
#' @description Allows you to update the series array overriding the existing one.
|
||||
#' @title Proxy for updating series.
|
||||
#'
|
||||
#' @description Allows you to update the series array overriding the existing one.
|
||||
#'
|
||||
#' @param proxy A \code{apexchartProxy} \code{htmlwidget} object.
|
||||
#' @param newSeries The series array to override the existing one.
|
||||
|
@ -73,20 +75,168 @@ apexchartProxy <- function(shinyId, session = shiny::getDefaultReactiveDomain())
|
|||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#' \dontrun{
|
||||
#'
|
||||
#'
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#'
|
||||
#'
|
||||
#' }
|
||||
#'
|
||||
#' library(shiny)
|
||||
#'
|
||||
#' ui <- fluidPage(
|
||||
#' fluidRow(
|
||||
#' column(
|
||||
#' width = 8, offset = 2,
|
||||
#' tags$h2("Real time chart"),
|
||||
#' apexchartOutput(outputId = "chart")
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#'
|
||||
#' server <- function(input, output, session) {
|
||||
#'
|
||||
#' rv <- reactiveValues()
|
||||
#' rv$df <- data.frame(
|
||||
#' date = Sys.Date() + 1:20,
|
||||
#' values = sample(10:90, 20, TRUE)
|
||||
#' )
|
||||
#'
|
||||
#' observe({
|
||||
#' invalidateLater(1000, session)
|
||||
#' df <- isolate(rv$df)
|
||||
#' # Append new line of data
|
||||
#' df <- rbind(
|
||||
#' df, data.frame(
|
||||
#' date = df$date[length(df$date)] + 1,
|
||||
#' values = sample(10:90, 1, TRUE)
|
||||
#' )
|
||||
#' )
|
||||
#' rv$df <- df
|
||||
#' })
|
||||
#'
|
||||
#' output$chart <- renderApexchart({
|
||||
#' # Generate chart once
|
||||
#' apex(isolate(rv$df), aes(date, values), "spline") %>%
|
||||
#' ax_xaxis(
|
||||
#' range = 10 * 24 * 60 * 60 * 1000
|
||||
#' # Fixed range for x-axis : 10 days
|
||||
#' # days*hours*minutes*seconds*milliseconds
|
||||
#' )
|
||||
#' })
|
||||
#'
|
||||
#' observe({
|
||||
#' # Update chart to add new data
|
||||
#' apexchartProxy("chart") %>%
|
||||
#' ax_proxy_series(
|
||||
#' parse_df(rv$df),
|
||||
#' T
|
||||
#' )
|
||||
#' })
|
||||
#'
|
||||
#' }
|
||||
#'
|
||||
#' shinyApp(ui, server)
|
||||
#' }
|
||||
#'
|
||||
ax_proxy_series <- function(proxy, newSeries, animate = TRUE) {
|
||||
.ax_proxy2(
|
||||
proxy = proxy,
|
||||
name = "series",
|
||||
l = list(newSeries = list(newSeries), animate = animate)
|
||||
proxy = proxy,
|
||||
name = "series",
|
||||
l = list(newSeries = newSeries, animate = animate)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' @title Proxy for updating options
|
||||
#'
|
||||
#' @description Allows you to update the configuration object.
|
||||
#'
|
||||
#' @param proxy A \code{apexchartProxy} \code{htmlwidget} object.
|
||||
#' @param options New options to set.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom htmlwidgets JSEvals
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' if (interactive()) {
|
||||
#' library(shiny)
|
||||
#'
|
||||
#' ui <- fluidPage(
|
||||
#' fluidRow(
|
||||
#' column(
|
||||
#' width = 8, offset = 2,
|
||||
#' tags$h2("Update options"),
|
||||
#' apexchartOutput(outputId = "chart"),
|
||||
#' checkboxInput(
|
||||
#' inputId = "show_label_xaxis",
|
||||
#' label = "Show x-axis labels"
|
||||
#' ),
|
||||
#' textInput(
|
||||
#' inputId = "yaxis_title",
|
||||
#' label = "Y-axis title"
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#' )
|
||||
#' server <- function(input, output, session) {
|
||||
#'
|
||||
#' output$chart <- renderApexchart({
|
||||
#' apexchart() %>%
|
||||
#' ax_chart(type = "bar") %>%
|
||||
#' ax_series(list(
|
||||
#' name = "Example",
|
||||
#' data = c(23, 43, 76, 31)
|
||||
#' )) %>%
|
||||
#' ax_xaxis(
|
||||
#' categories = c("Label A", "Label B",
|
||||
#' "Label C", "Label D")
|
||||
#' )
|
||||
#' })
|
||||
#'
|
||||
#' observe({
|
||||
#' apexchartProxy("chart") %>%
|
||||
#' ax_proxy_options(list(
|
||||
#' xaxis = list(
|
||||
#' labels = list(show = input$show_label_xaxis)
|
||||
#' ),
|
||||
#' yaxis = list(
|
||||
#' title = list(text = input$yaxis_title)
|
||||
#' )
|
||||
#' ))
|
||||
#' })
|
||||
#'
|
||||
#' }
|
||||
#'
|
||||
#' shinyApp(ui, server)
|
||||
#' }
|
||||
#'
|
||||
ax_proxy_options <- function(proxy, options) {
|
||||
.ax_proxy2(
|
||||
proxy = proxy,
|
||||
name = "options",
|
||||
l = list(options = options, evals = JSEvals(options))
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' @title Toggle series with proxy
|
||||
#'
|
||||
#' @description This method allows you to toggle the visibility of series programmatically.
|
||||
#' Useful when you have a custom legend.
|
||||
#'
|
||||
#' @param proxy A \code{apexchartProxy} \code{htmlwidget} object.
|
||||
#' @param series_name The series name which you want to toggle visibility for.
|
||||
#'
|
||||
#' @noRd
|
||||
#'
|
||||
#' @example examples/proxy-toggle.R
|
||||
ax_proxy_toggle_series <- function(proxy, series_name) {
|
||||
.ax_proxy2(
|
||||
proxy = proxy,
|
||||
name = "toggle-series",
|
||||
l = list(seriesName = list1(series_name))
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,271 @@
|
|||
|
||||
#' @title Retrieve click information in Shiny
|
||||
#'
|
||||
#' @description According to type of chart, different values are retrieved:
|
||||
#' * **bar and column:** retrieve category (x-axis).
|
||||
#' * **pie and donut:** retrieve label.
|
||||
#' * **time-series:** retrieve x-axis value, you have to display markers
|
||||
#' with size > 0 and set tooltip's options `intersect = TRUE` and `shared = FALSE`.
|
||||
#' * **scatter:** retrieve XY coordinates.
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param inputId The id that will be used server-side for retrieving click.
|
||||
#' @param multiple Allow multiple selection: \code{TRUE} or \code{FALSE} (default).
|
||||
#' @param effect_type Type of effect for selected element, default is to use lightly darken color.
|
||||
#' @param effect_value A larger value intensifies the select effect, accept value between 0 and 1.
|
||||
#' @param session The Shiny session.
|
||||
#'
|
||||
#' @note If x-axis is of type datetime, value retrieved is of class \code{POSIXct}.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny getDefaultReactiveDomain
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' library(apexcharter)
|
||||
#'
|
||||
#' # Not in Shiny but you can still click on bars
|
||||
#' data.frame(
|
||||
#' month = month.abb,
|
||||
#' value = sample(1:100, 12)
|
||||
#' ) %>%
|
||||
#' apex(aes(month, value)) %>%
|
||||
#' set_input_click("month_click", multiple = TRUE)
|
||||
#'
|
||||
#'
|
||||
#' # Interactive examples:
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#' run_demo_input("click")
|
||||
#'
|
||||
#' }
|
||||
set_input_click <- function(ax, inputId, multiple = FALSE,
|
||||
effect_type = c("darken", "lighten", "none"),
|
||||
effect_value = 0.35,
|
||||
session = shiny::getDefaultReactiveDomain()) {
|
||||
effect_type <- match.arg(effect_type)
|
||||
if (is.null(session))
|
||||
session <- list(ns = identity)
|
||||
ax <- ax_states(ax, active = list(
|
||||
allowMultipleDataPointsSelection = isTRUE(multiple),
|
||||
filter = list(
|
||||
type = effect_type,
|
||||
value = effect_value
|
||||
)
|
||||
))
|
||||
ax$x$shinyEvents$click <- list(
|
||||
inputId = session$ns(inputId)
|
||||
)
|
||||
ax
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#' Retrieve zoom information in Shiny
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param inputId The id that will be used server-side for retrieving zoom.
|
||||
#' @param session The Shiny session.
|
||||
#'
|
||||
#' @note If x-axis is of type datetime, value retrieved is of class \code{POSIXct}.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny getDefaultReactiveDomain
|
||||
#'
|
||||
#' @examples
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#' run_demo_input("zoom")
|
||||
#'
|
||||
#' }
|
||||
set_input_zoom <- function(ax, inputId,
|
||||
session = shiny::getDefaultReactiveDomain()) {
|
||||
if (is.null(session))
|
||||
session <- list(ns = identity)
|
||||
ax$x$shinyEvents$zoomed <- list(
|
||||
inputId = session$ns(inputId)
|
||||
)
|
||||
ax
|
||||
}
|
||||
|
||||
|
||||
#' Retrieve selection information in Shiny
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param inputId The id that will be used server-side for retrieving selection.
|
||||
#' @param type Allow selection either on x-axis, y-axis or on both axis.
|
||||
#' @param fill_color Background color of the selection rect which is drawn when user drags on the chart.
|
||||
#' @param fill_opacity Opacity of background color of the selection rectangle.
|
||||
#' @param stroke_width Border thickness of the selection rectangle.
|
||||
#' @param stroke_dasharray Creates dashes in borders of selection rectangle.
|
||||
#' Higher number creates more space between dashes in the border.
|
||||
#' @param stroke_color Colors of selection border.
|
||||
#' @param stroke_opacity Opacity of selection border.
|
||||
#' @param xmin,xmax Start value of x-axis. Both \code{min} and \code{max} must be provided.
|
||||
#' @param ymin,ymax Start value of y-axis. Both \code{min} and \code{max} must be provided.
|
||||
#' @param session The Shiny session.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @examples
|
||||
#'
|
||||
#' library(apexcharter)
|
||||
#' data("economics", package = "ggplot2")
|
||||
#'
|
||||
#' # Not in Shiny so no events
|
||||
#' # but you can still select an area on chart
|
||||
#' apex(economics, aes(date, psavert), type = "line") %>%
|
||||
#' set_input_selection("selection")
|
||||
#'
|
||||
#' # Default selection at start
|
||||
#' apex(economics, aes(date, psavert), type = "line") %>%
|
||||
#' set_input_selection(
|
||||
#' inputId = "selection",
|
||||
#' xmin = format_date("1980-01-01"),
|
||||
#' xmax = format_date("1985-01-01")
|
||||
#' )
|
||||
set_input_selection <- function(ax,
|
||||
inputId,
|
||||
type = c("x", "xy", "y"),
|
||||
fill_color = "#24292e",
|
||||
fill_opacity = 0.1,
|
||||
stroke_width = 1,
|
||||
stroke_dasharray = 3,
|
||||
stroke_color = "#24292e",
|
||||
stroke_opacity = 0.4,
|
||||
xmin = NULL,
|
||||
xmax = NULL,
|
||||
ymin = NULL,
|
||||
ymax = NULL,
|
||||
session = shiny::getDefaultReactiveDomain()) {
|
||||
type <- match.arg(type)
|
||||
if (is.null(session))
|
||||
session <- list(ns = identity)
|
||||
selection <- list(
|
||||
enabled = TRUE, type = type,
|
||||
fill = list(color = fill_color, opacity = fill_opacity),
|
||||
stroke = list(
|
||||
width = stroke_width, dashArray = stroke_dasharray,
|
||||
color = stroke_color, opacity = stroke_opacity
|
||||
)
|
||||
)
|
||||
if (!is.null(xmin) & !is.null(xmax)) {
|
||||
selection$xaxis <- list(min = xmin, max = xmax)
|
||||
}
|
||||
if (!is.null(ymin) & !is.null(ymax)) {
|
||||
selection$yaxis <- list(min = ymin, max = ymax)
|
||||
}
|
||||
ax <- ax_chart(
|
||||
ax = ax,
|
||||
selection = selection,
|
||||
toolbar = list(autoSelected = "selection")
|
||||
)
|
||||
ax$x$shinyEvents$selection <- list(
|
||||
inputId = session$ns(inputId),
|
||||
type = type
|
||||
)
|
||||
ax
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#' Retrieve chart's base64 dataURI.
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param inputId The id that will be used server-side for retrieving data.
|
||||
#' @param session The Shiny session.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @example examples/export-2.R
|
||||
set_input_export <- function(ax, inputId,
|
||||
session = shiny::getDefaultReactiveDomain()) { # nocov start
|
||||
if (is.null(session))
|
||||
session <- list(ns = identity)
|
||||
ax$x$shinyEvents$export <- list(
|
||||
inputId = session$ns(inputId)
|
||||
)
|
||||
ax
|
||||
} # nocov end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Demo --------------------------------------------------------------------
|
||||
|
||||
# nocov start
|
||||
|
||||
#' Run Shiny input events examples
|
||||
#'
|
||||
#' @param example Name of the example.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny shinyAppFile
|
||||
#'
|
||||
#' @examples
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#' run_demo_input("click")
|
||||
#' run_demo_input("zoom")
|
||||
#' run_demo_input("selection")
|
||||
#'
|
||||
#' }
|
||||
run_demo_input <- function(example = c("click", "zoom", "selection")) {
|
||||
example <- match.arg(example)
|
||||
shiny::shinyAppFile(
|
||||
appFile = system.file("examples/input", example, "app.R", package = "apexcharter"),
|
||||
options = list("display.mode" = "showcase")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#' Run Shiny synchronization example
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny shinyAppFile
|
||||
#'
|
||||
#' @examples
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#' run_demo_sync()
|
||||
#'
|
||||
#' }
|
||||
run_demo_sync <- function() {
|
||||
shiny::shinyAppFile(
|
||||
appFile = system.file("examples/sync", "app.R", package = "apexcharter"),
|
||||
options = list("display.mode" = "showcase")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
#' Run Shiny spark boxes example
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @importFrom shiny shinyAppFile
|
||||
#'
|
||||
#' @examples
|
||||
#' if (interactive()) {
|
||||
#'
|
||||
#' run_demo_sparkbox()
|
||||
#'
|
||||
#' }
|
||||
run_demo_sparkbox <- function() {
|
||||
shiny::shinyAppFile(
|
||||
appFile = system.file("examples/spark", "app.R", package = "apexcharter"),
|
||||
options = list("display.mode" = "showcase")
|
||||
)
|
||||
}
|
||||
|
||||
# nocov end
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#' Create a box with a sparkline
|
||||
#'
|
||||
#' @param data A \code{data.frame}-like object with at least two columns,
|
||||
#' first is mapped to x-axis, second to y-axis.
|
||||
#' @param title Title to display in the box.
|
||||
#' @param subtitle Subtitle to display in the box.
|
||||
#' @param color Color of the chart.
|
||||
#' @param background Background color of the box.
|
||||
#' @param type Type of chart, currently type supported are :
|
||||
#' \code{"area"} (default), \code{"line"}, \code{"spline"}, \code{"column"}.
|
||||
#' @param synchronize Give a common id to charts to synchronize them (tooltip and zoom).
|
||||
#' @param title_style,subtitle_style A \code{list} of named attributes to style
|
||||
#' the title / subtitle, possible values are \code{fontSize},
|
||||
#' \code{fontWeight}, \code{fontFamily}, \code{color}.
|
||||
#' @param width,height A numeric input in pixels.
|
||||
#' @param elementId Use an explicit element ID for the widget.
|
||||
#'
|
||||
#' @return An \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @export
|
||||
#'
|
||||
#' @note In Shiny use \code{sparkBoxOutput} / \code{renderSparkBox} to render boxes, see example.
|
||||
#' Boxes have CSS class \code{"apexcharter-spark-box"} if you need more styling.
|
||||
#'
|
||||
#' @importFrom htmlwidgets sizingPolicy
|
||||
#' @importFrom rlang sym
|
||||
#' @importFrom ggplot2 aes
|
||||
#'
|
||||
#' @example examples/spark_box.R
|
||||
spark_box <- function(data,
|
||||
title = NULL,
|
||||
subtitle = NULL,
|
||||
color = "#2E93fA",
|
||||
background = "#FFF",
|
||||
type = c("area", "line", "spline", "column"),
|
||||
synchronize = NULL,
|
||||
title_style = NULL,
|
||||
subtitle_style = NULL,
|
||||
width = NULL,
|
||||
height = NULL,
|
||||
elementId = NULL) {
|
||||
type <- match.arg(type)
|
||||
data <- as.data.frame(data)
|
||||
if (ncol(data) < 2)
|
||||
stop("'data' must have at least two columns!", call. = FALSE)
|
||||
x_var <- names(data)[1]
|
||||
y_var <- names(data)[2]
|
||||
spark <- apex(
|
||||
data = data,
|
||||
aes(x = !!sym(x_var), y = !!sym(y_var)),
|
||||
type = type,
|
||||
auto_update = config_update(update_options = TRUE)
|
||||
)
|
||||
spark <- ax_chart(
|
||||
ax = spark,
|
||||
sparkline = list(enabled = TRUE),
|
||||
group = synchronize
|
||||
)
|
||||
spark <- ax_yaxis(spark, show = FALSE)
|
||||
spark <- ax_colors(spark, color)
|
||||
if (!is.null(title)) {
|
||||
if (is.null(title_style))
|
||||
title_style <- list(fontSize = "24px")
|
||||
if (is.null(title_style$fontSize))
|
||||
title_style$fontSize <- "24px"
|
||||
spark <- ax_title(
|
||||
ax = spark,
|
||||
text = title,
|
||||
style = title_style
|
||||
)
|
||||
}
|
||||
if (!is.null(subtitle)) {
|
||||
if (is.null(subtitle_style))
|
||||
subtitle_style <- list(fontSize = "14px")
|
||||
if (is.null(subtitle_style$fontSize))
|
||||
subtitle_style$fontSize <- "14px"
|
||||
spark <- ax_subtitle(
|
||||
ax = spark,
|
||||
text = subtitle,
|
||||
style = subtitle_style
|
||||
)
|
||||
}
|
||||
spark$x$sparkbox <- list(
|
||||
color = color, background = background
|
||||
)
|
||||
spark$sizingPolicy <- htmlwidgets::sizingPolicy(
|
||||
defaultWidth = "100%",
|
||||
defaultHeight = "160px",
|
||||
viewer.defaultHeight = "160px",
|
||||
viewer.defaultWidth = "100%",
|
||||
viewer.fill = FALSE,
|
||||
knitr.figure = FALSE,
|
||||
knitr.defaultWidth = "100%",
|
||||
knitr.defaultHeight = "160px",
|
||||
browser.fill = FALSE,
|
||||
viewer.suppress = FALSE,
|
||||
browser.external = TRUE,
|
||||
padding = 15
|
||||
)
|
||||
return(spark)
|
||||
}
|
||||
|
||||
|
||||
#' @rdname apexcharter-shiny
|
||||
#' @export
|
||||
sparkBoxOutput <- function(outputId, width = "100%", height = "160px") { # nocov start
|
||||
htmlwidgets::shinyWidgetOutput(outputId, "apexcharter", width, height, package = "apexcharter")
|
||||
} # nocov end
|
||||
|
||||
#' @rdname apexcharter-shiny
|
||||
#' @export
|
||||
renderSparkBox <- function(expr, env = parent.frame(), quoted = FALSE) { # nocov start
|
||||
if (!quoted) { expr <- substitute(expr) } # force quoted
|
||||
htmlwidgets::shinyRenderWidget(expr, apexchartOutput, env, quoted = TRUE)
|
||||
} # nocov end
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
|
||||
#' Fixed tooltip
|
||||
#'
|
||||
#' @template ax-default
|
||||
#' @param position Predefined position: \code{"topLeft"}, \code{"topRight"},
|
||||
#' \code{"bottomLeft"} or \code{"bottomRight"}.
|
||||
#' @param offsetX Sets the left offset for the tooltip container in fixed position.
|
||||
#' @param offsetY Sets the top offset for the tooltip container in fixed position.
|
||||
#'
|
||||
#' @export
|
||||
#'
|
||||
#' @example examples/set_tooltip_fixed.R
|
||||
set_tooltip_fixed <- function(ax,
|
||||
position = c("topLeft", "topRight", "bottomLeft", "bottomRight"),
|
||||
offsetX = NULL,
|
||||
offsetY = NULL) {
|
||||
position <- match.arg(position)
|
||||
ax_tooltip(ax = ax, fixed = list(
|
||||
enabled = TRUE, position = position,
|
||||
offsetX = offsetX, offsetY = offsetY
|
||||
))
|
||||
}
|
111
R/utils.R
111
R/utils.R
|
@ -1,13 +1,18 @@
|
|||
|
||||
|
||||
# dropNulls
|
||||
dropNulls <- function(x) {
|
||||
x[!vapply(x, is.null, FUN.VALUE = logical(1))]
|
||||
null_or_empty <- function(x) {
|
||||
is.null(x) || length(x) == 0
|
||||
}
|
||||
|
||||
|
||||
`%||%` <- function(x, y) {
|
||||
if (!is.null(x)) x else y
|
||||
dropNullsOrEmpty <- function(x) {
|
||||
clss <- class(x)
|
||||
x <- x[!vapply(x, null_or_empty, FUN.VALUE = logical(1))]
|
||||
class(x) <- clss
|
||||
return(x)
|
||||
}
|
||||
|
||||
dropNulls <- function(x) {
|
||||
x[!vapply(x, is.null, FUN.VALUE = logical(1))]
|
||||
}
|
||||
|
||||
formatNoSci <- function(x) {
|
||||
|
@ -16,46 +21,118 @@ formatNoSci <- function(x) {
|
|||
}
|
||||
|
||||
|
||||
ununlist <- function(x) {
|
||||
if (is.null(x))
|
||||
return(x)
|
||||
n <- names(x)
|
||||
if (!is.null(n) && all(nzchar(n))) {
|
||||
lapply(x, ununlist)
|
||||
} else {
|
||||
unlist(x)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
to_posix <- function(x) {
|
||||
if (!is.null(x)) {
|
||||
x <- as.POSIXct(x/1000, origin = "1970-01-01", tz = "UTC")
|
||||
}
|
||||
x
|
||||
}
|
||||
|
||||
|
||||
to_hyphen <- function(x) {
|
||||
tolower(gsub("([A-Z])", "-\\1", x))
|
||||
}
|
||||
|
||||
make_styles <- function(styles) {
|
||||
styles <- dropNulls(styles)
|
||||
if (length(styles) < 1)
|
||||
return(NULL)
|
||||
styles <- sprintf("%s: %s;", to_hyphen(names(styles)), unlist(styles, use.names = FALSE))
|
||||
paste(styles, collapse = " ")
|
||||
}
|
||||
|
||||
|
||||
|
||||
#' Utility function to create ApexChart parameters JSON
|
||||
#'
|
||||
#' @param ax A \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @template ax-default
|
||||
#' @param name Slot's name to edit
|
||||
#' @param ... Arguments for the slot
|
||||
#'
|
||||
#' @return A \code{apexcharts} \code{htmlwidget} object.
|
||||
#'
|
||||
#' @importFrom utils modifyList
|
||||
#'
|
||||
#' @noRd
|
||||
.ax_opt <- function(ax, name, ...) {
|
||||
|
||||
|
||||
if (is.null(ax$x$ax_opts[[name]])) {
|
||||
ax$x$ax_opts[[name]] <- list(...)
|
||||
} else {
|
||||
ax$x$ax_opts[[name]] <- utils::modifyList(x = ax$x$ax_opts[[name]], val = list(...), keep.null = TRUE)
|
||||
ax$x$ax_opts[[name]] <- modifyList(
|
||||
x = ax$x$ax_opts[[name]],
|
||||
val = list(...),
|
||||
keep.null = TRUE
|
||||
)
|
||||
}
|
||||
|
||||
ax$x$ax_opts[[name]] <- dropNullsOrEmpty(ax$x$ax_opts[[name]])
|
||||
return(ax)
|
||||
}
|
||||
|
||||
#' Utility function to create ApexChart parameters JSON
|
||||
#'
|
||||
#' @param ax A \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @template ax-default
|
||||
#' @param name Slot's name to edit
|
||||
#' @param l List of arguments for the slot
|
||||
#'
|
||||
#' @return A \code{apexcharts} \code{htmlwidget} object.
|
||||
#' @importFrom utils modifyList
|
||||
#'
|
||||
#' @noRd
|
||||
.ax_opt2 <- function(ax, name, l) {
|
||||
|
||||
|
||||
if (is.null(ax$x$ax_opts[[name]])) {
|
||||
ax$x$ax_opts[[name]] <- l
|
||||
} else {
|
||||
ax$x$ax_opts[[name]] <- utils::modifyList(x = ax$x$ax_opts[[name]], val = l, keep.null = TRUE)
|
||||
ax$x$ax_opts[[name]] <- modifyList(
|
||||
x = ax$x$ax_opts[[name]],
|
||||
val = l,
|
||||
keep.null = TRUE
|
||||
)
|
||||
}
|
||||
|
||||
ax$x$ax_opts[[name]] <- dropNullsOrEmpty(ax$x$ax_opts[[name]])
|
||||
return(ax)
|
||||
}
|
||||
|
||||
# Get parameters from an \code{apexcharts} \code{htmlwidget} object.
|
||||
.get_ax_opt <- function(ax, name) {
|
||||
ax$x$ax_opts[[name]]
|
||||
}
|
||||
|
||||
|
||||
|
||||
# From vignette('knit_print', package = 'knitr')
|
||||
# and https://github.com/rstudio/htmltools/pull/108/files
|
||||
|
||||
register_s3_method <- function(pkg, generic, class, fun = NULL) { # nocov start
|
||||
stopifnot(is.character(pkg), length(pkg) == 1)
|
||||
stopifnot(is.character(generic), length(generic) == 1)
|
||||
stopifnot(is.character(class), length(class) == 1)
|
||||
|
||||
if (is.null(fun)) {
|
||||
fun <- get(paste0(generic, ".", class), envir = parent.frame())
|
||||
} else {
|
||||
stopifnot(is.function(fun))
|
||||
}
|
||||
|
||||
if (pkg %in% loadedNamespaces()) {
|
||||
registerS3method(generic, class, fun, envir = asNamespace(pkg))
|
||||
}
|
||||
|
||||
# Always register hook in case package is later unloaded & reloaded
|
||||
setHook(
|
||||
packageEvent(pkg, "onLoad"),
|
||||
function(...) {
|
||||
registerS3method(generic, class, fun, envir = asNamespace(pkg))
|
||||
}
|
||||
)
|
||||
} # nocov end
|
||||
|
|
71
README.md
71
README.md
|
@ -1,25 +1,28 @@
|
|||
# apexcharter
|
||||
|
||||
> Htmlwidget for [apexcharts.js](https://github.com/apexcharts/apexcharts.js) : A modern JavaScript charting library to build interactive charts and visualizations with simple API.
|
||||
> Htmlwidget for [apexcharts.js](https://github.com/apexcharts/apexcharts.js) : A modern JavaScript charting library to build interactive charts and visualizations with simple API. See the [online documentation](https://dreamrs.github.io/apexcharter/) for examples.
|
||||
|
||||
[![Travis build status](https://travis-ci.org/dreamRs/apexcharter.svg?branch=master)](https://travis-ci.org/dreamRs/apexcharter)
|
||||
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
|
||||
|
||||
:construction: Under development !! API will change :construction:
|
||||
|
||||
:warning: Use RStudio >= 1.2 to properly display charts
|
||||
|
||||
|
||||
Note: Once again, development is heavily inspired by amazing [highcharter](http://jkunst.com/highcharter/).
|
||||
<!-- badges: start -->
|
||||
[![CRAN status](https://www.r-pkg.org/badges/version/apexcharter)](https://CRAN.R-project.org/package=apexcharter)
|
||||
[![cran checks](https://badges.cranchecks.info/worst/apexcharter.svg)](https://cran.r-project.org/web/checks/check_results_apexcharter.html)
|
||||
[![Codecov test coverage](https://codecov.io/gh/dreamRs/apexcharter/branch/master/graph/badge.svg)](https://app.codecov.io/gh/dreamRs/apexcharter?branch=master)
|
||||
[![R-CMD-check](https://github.com/dreamRs/apexcharter/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dreamRs/apexcharter/actions/workflows/R-CMD-check.yaml)
|
||||
<!-- badges: end -->
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
You can install the development version from [GitHub](https://github.com/) with:
|
||||
Install from [CRAN](https://CRAN.R-project.org/package=apexcharter) with:
|
||||
|
||||
``` r
|
||||
# install.packages("devtools")
|
||||
devtools::install_github("dreamRs/apexcharter")
|
||||
```r
|
||||
install.packages("apexcharter")
|
||||
```
|
||||
|
||||
Or install the development version from [GitHub](https://github.com/dreamRs/apexcharter) with:
|
||||
|
||||
```r
|
||||
# install.packages("remotes")
|
||||
remotes::install_github("dreamRs/apexcharter")
|
||||
```
|
||||
|
||||
|
||||
|
@ -31,11 +34,8 @@ Use `apex` function to quickly create visualizations :
|
|||
|
||||
```r
|
||||
library(apexcharter)
|
||||
|
||||
data("mpg", package = "ggplot2")
|
||||
n_manufac <- dplyr::count(mpg, manufacturer)
|
||||
|
||||
apex(data = n_manufac, type = "bar", mapping = aes(x = manufacturer, y = n))
|
||||
apex(data = mpg, type = "bar", mapping = aes(manufacturer))
|
||||
```
|
||||
![](man/figures/apex-bar.png)
|
||||
|
||||
|
@ -57,7 +57,6 @@ All methods from ApexCharts are available with function like `ax_*` compatible w
|
|||
```r
|
||||
library(apexcharter)
|
||||
data(mpg, package = "ggplot2")
|
||||
n_manufac <- dplyr::count(mpg, manufacturer)
|
||||
|
||||
apexchart() %>%
|
||||
ax_chart(type = "bar") %>%
|
||||
|
@ -76,10 +75,10 @@ apexchart() %>%
|
|||
) %>%
|
||||
ax_series(list(
|
||||
name = "Count",
|
||||
data = n_manufac$n
|
||||
data = tapply(mpg$manufacturer, mpg$manufacturer, length)
|
||||
)) %>%
|
||||
ax_colors("#112446") %>%
|
||||
ax_xaxis(categories = n_manufac$manufacturer) %>%
|
||||
ax_xaxis(categories = unique(mpg$manufacturer)) %>%
|
||||
ax_title(text = "Number of models") %>%
|
||||
ax_subtitle(text = "Data from ggplot2")
|
||||
```
|
||||
|
@ -91,7 +90,7 @@ apexchart() %>%
|
|||
|
||||
Pass a list of parameters to the function:
|
||||
|
||||
``` r
|
||||
```r
|
||||
apexchart(ax_opts = list(
|
||||
chart = list(
|
||||
type = "line"
|
||||
|
@ -130,11 +129,35 @@ apexchart(ax_opts = list(
|
|||
yaxis = list(
|
||||
title = list(text = "Temperature"),
|
||||
labels = list(
|
||||
formatter = htmlwidgets::JS("function(value) {return value + '°C';}")
|
||||
formatter = htmlwidgets::JS("function(value) {return value + '\u00b0C';}")
|
||||
)
|
||||
)
|
||||
))
|
||||
```
|
||||
|
||||
![alt text](img/raw-lines.png)
|
||||
![](man/figures/raw-api.png)
|
||||
|
||||
|
||||
|
||||
## Development
|
||||
|
||||
This package use [{packer}](https://github.com/JohnCoene/packer) to manage JavaScript assets, see packer's [documentation](https://packer.john-coene.com/#/) for more.
|
||||
|
||||
Install nodes modules with:
|
||||
|
||||
```r
|
||||
packer::npm_install()
|
||||
```
|
||||
|
||||
Modify `srcjs/widgets/apexcharter.js`, then run:
|
||||
|
||||
```r
|
||||
packer::bundle()
|
||||
```
|
||||
|
||||
Re-install R package and try `apexcharter()` or `apex()` functions.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
14
_pkgdown.yml
14
_pkgdown.yml
|
@ -1,7 +1,17 @@
|
|||
url: https://dreamrs.github.io/apexcharter/
|
||||
|
||||
template:
|
||||
params:
|
||||
bootswatch: flatly
|
||||
bootstrap: 5
|
||||
bootswatch: zephyr
|
||||
bslib:
|
||||
base_font: {google: "Poppins"}
|
||||
primary: "#112446"
|
||||
navbar-dark-color: "#FFFFFF"
|
||||
secondary: "#DFDFDF"
|
||||
navbar-dark-active-color: "#DFDFDF"
|
||||
|
||||
navbar:
|
||||
bg: primary
|
||||
|
||||
authors:
|
||||
Victor Perrier:
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
comment: false
|
||||
|
||||
coverage:
|
||||
status:
|
||||
project:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: true
|
||||
patch:
|
||||
default:
|
||||
target: auto
|
||||
threshold: 1%
|
||||
informational: true
|
|
@ -0,0 +1,13 @@
|
|||
## Test environments
|
||||
* local Ubuntu 22.04 install, R 4.2.2
|
||||
* ubuntu 22.04, Windows 10, macOS (on GitHub Actions), R 4.2.2
|
||||
* win-builder (devel and release)
|
||||
|
||||
## R CMD check results
|
||||
|
||||
0 errors | 0 warnings | 0 note
|
||||
|
||||
Updated JavaScript dependencies and new features.
|
||||
Thank you!
|
||||
|
||||
Victor
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Title : Candlestick data
|
||||
# By : Victor
|
||||
# Date : 2020-06-13
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
library(jsonlite)
|
||||
|
||||
cdle <- read_json(path = "data-raw/candlestick.json")
|
||||
|
||||
cdle <- lapply(
|
||||
X = cdle,
|
||||
FUN = function(x) {
|
||||
data.frame(
|
||||
datetime = x$x,
|
||||
open = x$y[[1]],
|
||||
high = x$y[[2]],
|
||||
low = x$y[[3]],
|
||||
close = x$y[[4]],
|
||||
stringsAsFactors = FALSE
|
||||
)
|
||||
}
|
||||
)
|
||||
cdle <- do.call(rbind, cdle)
|
||||
cdle$datetime <- as.POSIXct(cdle$datetime, format = "%Y-%m-%dT%H:%M:%S", tz = "UTC")
|
||||
cdle
|
||||
|
||||
|
||||
apex(cdle, aes(x = datetime, open = open, close = close, low = low, high = high), type = "candlestick")
|
||||
|
||||
candles <- as.data.frame(cdle)
|
||||
|
||||
usethis::use_data(candles, overwrite = TRUE)
|
|
@ -0,0 +1 @@
|
|||
[{"x":"2018-10-05T22:30:00.000Z","y":[6629.81,6650.5,6623.04,6633.33]},{"x":"2018-10-05T23:00:00.000Z","y":[6632.01,6643.59,6620,6630.11]},{"x":"2018-10-05T23:30:00.000Z","y":[6630.71,6648.95,6623.34,6635.65]},{"x":"2018-10-06T00:00:00.000Z","y":[6635.65,6651,6629.67,6638.24]},{"x":"2018-10-06T00:30:00.000Z","y":[6638.24,6640,6620,6624.47]},{"x":"2018-10-06T01:00:00.000Z","y":[6624.53,6636.03,6621.68,6624.31]},{"x":"2018-10-06T01:30:00.000Z","y":[6624.61,6632.2,6617,6626.02]},{"x":"2018-10-06T02:00:00.000Z","y":[6627,6627.62,6584.22,6603.02]},{"x":"2018-10-06T02:30:00.000Z","y":[6605,6608.03,6598.95,6604.01]},{"x":"2018-10-06T03:00:00.000Z","y":[6604.5,6614.4,6602.26,6608.02]},{"x":"2018-10-06T03:30:00.000Z","y":[6608.02,6610.68,6601.99,6608.91]},{"x":"2018-10-06T04:00:00.000Z","y":[6608.91,6618.99,6608.01,6612]},{"x":"2018-10-06T04:30:00.000Z","y":[6612,6615.13,6605.09,6612]},{"x":"2018-10-06T05:00:00.000Z","y":[6612,6624.12,6608.43,6622.95]},{"x":"2018-10-06T05:30:00.000Z","y":[6623.91,6623.91,6615,6615.67]},{"x":"2018-10-06T06:00:00.000Z","y":[6618.69,6618.74,6610,6610.4]},{"x":"2018-10-06T06:30:00.000Z","y":[6611,6622.78,6610.4,6614.9]},{"x":"2018-10-06T07:00:00.000Z","y":[6614.9,6626.2,6613.33,6623.45]},{"x":"2018-10-06T07:30:00.000Z","y":[6623.48,6627,6618.38,6620.35]},{"x":"2018-10-06T08:00:00.000Z","y":[6619.43,6620.35,6610.05,6615.53]},{"x":"2018-10-06T08:30:00.000Z","y":[6615.53,6617.93,6610,6615.19]},{"x":"2018-10-06T09:00:00.000Z","y":[6615.19,6621.6,6608.2,6620]},{"x":"2018-10-06T09:30:00.000Z","y":[6619.54,6625.17,6614.15,6620]},{"x":"2018-10-06T10:00:00.000Z","y":[6620.33,6634.15,6617.24,6624.61]},{"x":"2018-10-06T10:30:00.000Z","y":[6625.95,6626,6611.66,6617.58]},{"x":"2018-10-06T11:00:00.000Z","y":[6619,6625.97,6595.27,6598.86]},{"x":"2018-10-06T11:30:00.000Z","y":[6598.86,6598.88,6570,6587.16]},{"x":"2018-10-06T12:00:00.000Z","y":[6588.86,6600,6580,6593.4]},{"x":"2018-10-06T12:30:00.000Z","y":[6593.99,6598.89,6585,6587.81]},{"x":"2018-10-06T13:00:00.000Z","y":[6587.81,6592.73,6567.14,6578]},{"x":"2018-10-06T13:30:00.000Z","y":[6578.35,6581.72,6567.39,6579]},{"x":"2018-10-06T14:00:00.000Z","y":[6579.38,6580.92,6566.77,6575.96]},{"x":"2018-10-06T14:30:00.000Z","y":[6575.96,6589,6571.77,6588.92]},{"x":"2018-10-06T15:00:00.000Z","y":[6588.92,6594,6577.55,6589.22]},{"x":"2018-10-06T15:30:00.000Z","y":[6589.3,6598.89,6589.1,6596.08]},{"x":"2018-10-06T16:00:00.000Z","y":[6597.5,6600,6588.39,6596.25]},{"x":"2018-10-06T16:30:00.000Z","y":[6598.03,6600,6588.73,6595.97]},{"x":"2018-10-06T17:00:00.000Z","y":[6595.97,6602.01,6588.17,6602]},{"x":"2018-10-06T17:30:00.000Z","y":[6602,6607,6596.51,6599.95]},{"x":"2018-10-06T18:00:00.000Z","y":[6600.63,6601.21,6590.39,6591.02]},{"x":"2018-10-06T18:30:00.000Z","y":[6591.02,6603.08,6591,6591]},{"x":"2018-10-06T19:00:00.000Z","y":[6591,6601.32,6585,6592]},{"x":"2018-10-06T19:30:00.000Z","y":[6593.13,6596.01,6590,6593.34]},{"x":"2018-10-06T20:00:00.000Z","y":[6593.34,6604.76,6582.63,6593.86]},{"x":"2018-10-06T20:30:00.000Z","y":[6593.86,6604.28,6586.57,6600.01]},{"x":"2018-10-06T21:00:00.000Z","y":[6601.81,6603.21,6592.78,6596.25]},{"x":"2018-10-06T21:30:00.000Z","y":[6596.25,6604.2,6590,6602.99]},{"x":"2018-10-06T22:00:00.000Z","y":[6602.99,6606,6584.99,6587.81]},{"x":"2018-10-06T22:30:00.000Z","y":[6587.81,6595,6583.27,6591.96]},{"x":"2018-10-06T23:00:00.000Z","y":[6591.97,6596.07,6585,6588.39]},{"x":"2018-10-06T23:30:00.000Z","y":[6587.6,6598.21,6587.6,6594.27]},{"x":"2018-10-07T00:00:00.000Z","y":[6596.44,6601,6590,6596.55]},{"x":"2018-10-07T00:30:00.000Z","y":[6598.91,6605,6596.61,6600.02]},{"x":"2018-10-07T01:00:00.000Z","y":[6600.55,6605,6589.14,6593.01]},{"x":"2018-10-07T01:30:00.000Z","y":[6593.15,6605,6592,6603.06]},{"x":"2018-10-07T02:00:00.000Z","y":[6603.07,6604.5,6599.09,6603.89]},{"x":"2018-10-07T02:30:00.000Z","y":[6604.44,6604.44,6600,6603.5]},{"x":"2018-10-07T03:00:00.000Z","y":[6603.5,6603.99,6597.5,6603.86]},{"x":"2018-10-07T03:30:00.000Z","y":[6603.85,6605,6600,6604.07]},{"x":"2018-10-07T04:00:00.000Z","y":[6604.98,6606,6604.07,6606]}]
|
|
@ -0,0 +1,119 @@
|
|||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Title : Paris climate
|
||||
# By : Victor
|
||||
# Date : 2020-07-24
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(rvest)
|
||||
library(data.table)
|
||||
library(janitor)
|
||||
|
||||
|
||||
|
||||
|
||||
# Data --------------------------------------------------------------------
|
||||
|
||||
tables_list <- read_html(x = "https://fr.wikipedia.org/wiki/Climat_de_Paris") %>%
|
||||
html_table(fill = TRUE)
|
||||
|
||||
|
||||
# Temperature
|
||||
temperature <- tables_list[[1]]
|
||||
setDT(temperature)
|
||||
setnames(temperature, make_clean_names)
|
||||
temperature <- temperature[periode == "1971-2000" & mois == "Température moyenne (°C)"]
|
||||
temperature[, periode := NULL]
|
||||
temperature[, annee := NULL]
|
||||
temperature[, mois := NULL]
|
||||
setnames(temperature, month.abb)
|
||||
|
||||
t_data <- melt(
|
||||
data = temperature,
|
||||
measure.vars = names(temperature),
|
||||
variable.name = "month",
|
||||
value.name = "temperature",
|
||||
variable.factor = FALSE
|
||||
)
|
||||
t_data[, temperature := type.convert(temperature, dec = ",")]
|
||||
t_data
|
||||
|
||||
|
||||
# Precipitation
|
||||
precipitation <- tables_list[[3]]
|
||||
setDT(precipitation)
|
||||
setnames(precipitation, make_clean_names)
|
||||
precipitation <- precipitation[periode == "1971-2000" & mois == "Précipitations (mm)"]
|
||||
precipitation[, periode := NULL]
|
||||
precipitation[, annee := NULL]
|
||||
precipitation[, mois := NULL]
|
||||
setnames(precipitation, month.abb)
|
||||
|
||||
p_data <- melt(
|
||||
data = precipitation,
|
||||
measure.vars = names(precipitation),
|
||||
variable.name = "month",
|
||||
value.name = "precipitation",
|
||||
variable.factor = FALSE
|
||||
)
|
||||
p_data[, precipitation := type.convert(precipitation, dec = ",")]
|
||||
p_data
|
||||
|
||||
|
||||
climate_paris <- merge(t_data, p_data, by = "month", sort = FALSE)
|
||||
climate_paris
|
||||
|
||||
|
||||
climate_paris <- as.data.frame(climate_paris)
|
||||
usethis::use_data(climate_paris, overwrite = TRUE)
|
||||
|
||||
|
||||
|
||||
# Test chart --------------------------------------------------------------
|
||||
|
||||
library(apexcharter)
|
||||
|
||||
ax <- apex(climate_paris, aes(month, precipitation), type = "column", serie_name = "Precipitation")
|
||||
ax$x$ax_opts$series <- c(
|
||||
ax$x$ax_opts$series,
|
||||
list(list(
|
||||
name = "Temperature",
|
||||
type = "line",
|
||||
data = parse_df(climate_paris[, list(month, temperature)], add_names = c("x", "y"))
|
||||
))
|
||||
)
|
||||
ax %>%
|
||||
ax_chart(type = "line") %>%
|
||||
ax_markers(size = c(6, 0)) %>%
|
||||
ax_stroke(width = c(0, 4)) %>%
|
||||
ax_yaxis(
|
||||
title = list(text = "Precipitation (in mm)")
|
||||
) %>%
|
||||
ax_yaxis2(
|
||||
opposite = TRUE,
|
||||
decimalsInFloat = 0,
|
||||
title = list(text = "Temperature (in degree celsius)")
|
||||
) %>%
|
||||
ax_dataLabels(
|
||||
enabled = TRUE, enabledOnSeries = list(1)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
apex(climate_paris, aes(month, precipitation), type = "column", serie_name = "Precipitation") %>%
|
||||
add_line(aes(month, temperature), serie_name = "Temperature")
|
||||
|
||||
|
||||
apex(climate_paris, aes(month, precipitation), type = "column", serie_name = "Precipitation") %>%
|
||||
add_line(aes(month, temperature), data = climate_paris, serie_name = "Temperature") %>%
|
||||
add_line(aes(month, temperature + 5), data = climate_paris, serie_name = "Temperature 2")
|
||||
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# eCO2mix data
|
||||
# https://www.rte-france.com/eco2mix
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(fasttime)
|
||||
|
||||
|
||||
complete <- function(data, vars, fill = list()) {
|
||||
data <- data[do.call(CJ, c(
|
||||
lapply(
|
||||
X = mget(vars),
|
||||
FUN = function(var) {
|
||||
if (inherits(var, "factor")) {
|
||||
if (anyNA(var)) {
|
||||
factor(c(levels(var), NA_character_), levels = levels(var), ordered = is.ordered(var))
|
||||
} else {
|
||||
factor(levels(var), levels = levels(var), ordered = is.ordered(var))
|
||||
}
|
||||
} else {
|
||||
unique(var)
|
||||
}
|
||||
}
|
||||
),
|
||||
list(sorted = FALSE)
|
||||
)), on = vars]
|
||||
if (length(fill) > 0 && all(nzchar(names(fill)))) {
|
||||
for (fillvar in names(fill)) {
|
||||
data[is.na(get(fillvar)), (fillvar) := fill[[fillvar]]]
|
||||
}
|
||||
}
|
||||
data[]
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Download data -----------------------------------------------------------
|
||||
|
||||
# Source: https://odre.opendatasoft.com/explore/dataset/eco2mix-national-cons-def/
|
||||
# and https://odre.opendatasoft.com/explore/dataset/eco2mix-national-tr
|
||||
|
||||
|
||||
# Read & transform data ---------------------------------------------------
|
||||
|
||||
# eco2mix <- fread(file = "data-raw/inputs/eco2mix-national-cons-def.csv")
|
||||
# eco2mix <- eco2mix[, c(5, 6, 9:17)]
|
||||
# setnames(eco2mix, c("datetime", "consumption", "fuel", "coal", "gas", "nuclear", "wind", "solar", "hydraulic", "pumping", "bioenergies"))
|
||||
|
||||
eco2mix_tr <- fread(file = "data-raw/inputs/eco2mix-national-tr.csv")
|
||||
eco2mix_tr <- eco2mix_tr[, c(5, 6, 9:17)]
|
||||
setnames(eco2mix_tr, c("datetime", "consumption", "fuel", "coal", "gas", "nuclear", "wind", "solar", "hydraulic", "pumping", "bioenergies"))
|
||||
|
||||
eco2mix <- copy(eco2mix_tr)
|
||||
# eco2mix <- rbind(eco2mix, eco2mix_tr)
|
||||
|
||||
eco2mix <- eco2mix[!is.na(consumption)]
|
||||
eco2mix[, consumption := NULL]
|
||||
# eco2mix[, date := as.Date(format(datetime, format = "%Y-%m-%d"))]
|
||||
# eco2mix[, datetime := NULL]
|
||||
# setcolorder(eco2mix, "date")
|
||||
eco2mix <- eco2mix[minute(datetime) != 15]
|
||||
eco2mix <- eco2mix[minute(datetime) != 45]
|
||||
eco2mix <- eco2mix[datetime >= (max(datetime) - 24*60*60*7)]
|
||||
eco2mix <- melt(
|
||||
data = eco2mix,
|
||||
id.vars = 1,
|
||||
variable.name = "source",
|
||||
value.name = "production",
|
||||
na.rm = TRUE,
|
||||
variable.factor = FALSE
|
||||
)
|
||||
eco2mix <- eco2mix[, list(production = round(mean(production))), by = list(datetime, source)]
|
||||
eco2mix[, source := factor(
|
||||
x = source,
|
||||
levels = c("pumping", "wind", "solar", "nuclear", "hydraulic", "gas", "coal", "fuel", "bioenergies"),
|
||||
ordered = TRUE
|
||||
)]
|
||||
eco2mix <- complete(eco2mix, c("datetime", "source"), list(production = 0))
|
||||
setorder(eco2mix, source, datetime)
|
||||
|
||||
eco2mix[]
|
||||
|
||||
|
||||
# Use data ----------------------------------------------------------------
|
||||
|
||||
setDF(eco2mix)
|
||||
usethis::use_data(eco2mix, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
apex(eco2mix[source == "consumption"], aes(date, production), type = "line")
|
||||
|
||||
# data("eco2mix", package = "apexcharter")
|
||||
apex(eco2mix, aes(datetime, production, fill = source), type = "area") %>%
|
||||
ax_chart(animations = list(enabled = FALSE), stacked = TRUE) %>%
|
||||
ax_stroke(width = 1) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_tooltip(x = list(format = "dd MMM, HH:mm")) %>%
|
||||
ax_yaxis(labels = list(formatter = format_num("~", suffix = "MW"))) %>%
|
||||
ax_colors_manual(
|
||||
list(
|
||||
"bioenergies" = "#156956",
|
||||
"fuel" = "#80549f",
|
||||
"coal" = "#a68832",
|
||||
"solar" = "#d66b0d",
|
||||
"gas" = "#f20809",
|
||||
"wind" = "#72cbb7",
|
||||
"hydraulic" = "#2672b0",
|
||||
"nuclear" = "#e4a701",
|
||||
"pumping" = "#0e4269"
|
||||
)
|
||||
) %>%
|
||||
ax_labs(
|
||||
title = "Electricity generation by sector in France",
|
||||
subtitle = "Data from \u00e9CO\u2082mix"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
## code to prepare `elec-data` dataset goes here
|
||||
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(lubridate)
|
||||
library(rte.data)
|
||||
library(apexcharter)
|
||||
|
||||
|
||||
|
||||
|
||||
# Consumption & forecast --------------------------------------------------
|
||||
|
||||
consumption <- get_consumption(
|
||||
resource = "short_term",
|
||||
type = c("REALISED", "D-1"),
|
||||
start_date = "2020-01-01",
|
||||
end_date = "2020-03-01"
|
||||
)
|
||||
|
||||
apex(consumption, aes(start_date, value, group = type), "line")
|
||||
|
||||
|
||||
consumption <- consumption[, list(value = round(sum(value) / 4000)), by = list(date = as_date(start_date), type)]
|
||||
consumption[type == "REALISED", type := "Realised"]
|
||||
consumption[type == "D-1", type := "Forecast D-1"]
|
||||
|
||||
apex(consumption, aes(date, value, group = type), "line")
|
||||
|
||||
consumption <- as.data.frame(consumption)
|
||||
usethis::use_data(consumption, overwrite = TRUE)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Actual generation -------------------------------------------------------
|
||||
|
||||
actual_generation <- get_actual_generation(
|
||||
resource = "actual_generations_per_production_type",
|
||||
start_date = "2017-06-12",
|
||||
end_date = "2017-06-13"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
|
||||
|
||||
# Package -----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(gapminder)
|
||||
|
||||
|
||||
|
||||
# Data --------------------------------------------------------------------
|
||||
|
||||
life_expec_long <- as.data.table(gapminder::gapminder)
|
||||
life_expec_long <- life_expec_long[year %in% c(1972, 2007), list(country, year, lifeExp)]
|
||||
|
||||
# life_expec <- life_expec[country %in% sample(unique(country), 10)]
|
||||
life_expec_long <- life_expec_long[country %in% c("Botswana", "Ghana", "Iran", "Liberia", "Malaysia", "Mexico",
|
||||
"Nigeria", "Pakistan", "Philippines", "Zambia")]
|
||||
life_expec_long[, country := as.character(country)]
|
||||
life_expec_long[, lifeExp := round(lifeExp, 1)]
|
||||
life_expec <- dcast(life_expec_long, country ~ year, value.var = "lifeExp")
|
||||
life_expec[, type := fifelse(`1972` > `2007`, "decreased", "increased")]
|
||||
|
||||
life_expec_long <- melt(data = life_expec, id.vars = c("country", "type"), variable.name = "year", value.name = "lifeExp")
|
||||
|
||||
|
||||
# Use data ----------------------------------------------------------------
|
||||
|
||||
setDF(life_expec)
|
||||
usethis::use_data(life_expec, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
setDF(life_expec_long)
|
||||
usethis::use_data(life_expec_long, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
|
||||
pkgload::load_all()
|
||||
|
||||
apex(life_expec, aes(country, x = `1972`, xend = `2007`), type = "dumbbell") %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(
|
||||
dumbbellColors = list(list("#3d85c6", "#fb6003"))
|
||||
)
|
||||
) %>%
|
||||
ax_colors("#BABABA") %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
|
||||
|
||||
|
||||
apex(life_expec, aes(country, x = `1972`, xend = `2007`, group = type), type = "dumbbell") %>%
|
||||
ax_xaxis(type = "category", categories = unique(life_expec$country)) %>%
|
||||
ax_plotOptions(
|
||||
bar = bar_opts(
|
||||
dumbbellColors = list(list("#3d85c6", "#fb6003"), list("#3d85c6", "#fb6003"))
|
||||
)
|
||||
) %>%
|
||||
ax_colors(c("#3d85c6", "#fb6003")) %>%
|
||||
ax_labs(
|
||||
title = "Life expectancy : 1972 vs. 2007",
|
||||
subtitle = "Data from Gapminder dataset",
|
||||
x = "Life expectancy at birth, in years"
|
||||
)
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# temperature data for France
|
||||
# https://data.enedis.fr/explore/dataset/donnees-de-temperature-et-de-pseudo-rayonnement
|
||||
#
|
||||
# ------------------------------------------------------------------------
|
||||
|
||||
|
||||
# Packages ----------------------------------------------------------------
|
||||
|
||||
library(data.table)
|
||||
library(fasttime)
|
||||
|
||||
|
||||
# Data --------------------------------------------------------------------
|
||||
|
||||
temperatures <- fread(file = "data-raw/inputs/donnees-de-temperature-et-de-pseudo-rayonnement.csv")
|
||||
temperatures <- temperatures[, c(6, 7, 8, 2)]
|
||||
setnames(temperatures, c("year", "month", "day", "temperature"))
|
||||
temperatures <- temperatures[year > 2017]
|
||||
temperatures <- temperatures[, list(temperature = round(mean(temperature, na.rm = TRUE), 1)), by = c("year", "month", "day")]
|
||||
temperatures <- dcast(data = temperatures, formula = month + day ~ year, value.var = "temperature")
|
||||
temperatures <- temperatures[!(month == 2 & day == 29)]
|
||||
|
||||
temperatures[, low := do.call(pmin, c(as.list(.SD), na.rm = TRUE)), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, high := do.call(pmax, c(as.list(.SD), na.rm = TRUE)), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, average := rowMeans(.SD, na.rm = TRUE), .SDcols = as.character(2018:2021)]
|
||||
temperatures[, (as.character(2018:2021)) := NULL]
|
||||
# setnames(temperatures, "2022", "temperature")
|
||||
|
||||
temperatures[, date := as.Date("2022-01-01") + (seq_len(.N) - 1)]
|
||||
temperatures[, (c("month", "day")) := NULL]
|
||||
setcolorder(temperatures, "date")
|
||||
|
||||
temperatures[]
|
||||
|
||||
|
||||
# Save --------------------------------------------------------------------
|
||||
|
||||
setDF(temperatures)
|
||||
usethis::use_data(temperatures, internal = FALSE, overwrite = TRUE, compress = "xz")
|
||||
|
||||
|
||||
|
||||
# Test example ------------------------------------------------------------
|
||||
|
||||
|
||||
pkgload::load_all()
|
||||
|
||||
apex(temperatures, aes(x = date, ymin = low, ymax = high), type = "rangeArea", serie_name = "Low/High (2018-2021)") %>%
|
||||
add_line(aes(date, `2023`)) %>%
|
||||
ax_chart(animations = list(enabled = FALSE)) %>%
|
||||
ax_yaxis(tickAmount = 7, labels = list(formatter = format_num("~", suffix = "°C"))) %>%
|
||||
ax_colors(c("#8485854D", "#FF0000")) %>%
|
||||
ax_stroke(width = c(1, 2)) %>%
|
||||
ax_fill(opacity = 1, type = "solid") %>%
|
||||
ax_labs(
|
||||
title = "Temperatures in 2023 with range from 2018 to 2021",
|
||||
subtitle = "Data from ENEDIS"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -163,6 +163,29 @@ unhcr_popstats <- merge(
|
|||
|
||||
|
||||
|
||||
|
||||
# Timeserie by continent --------------------------------------------------
|
||||
|
||||
unhcr_ts <- unhcr_popstats[!is.na(continent_origin), list(
|
||||
n = sum(value, na.rm = TRUE)
|
||||
), by = list(year, population_type, continent_origin)]
|
||||
|
||||
setorder(unhcr_ts, continent_origin, population_type, year)
|
||||
|
||||
|
||||
|
||||
unhcr_ts[, population_type := stringi::stri_trans_general(str = population_type, id = "ASCII-Latin")]
|
||||
unhcr_ts[, continent_origin := stringi::stri_trans_general(str = continent_origin, id = "ASCII-Latin")]
|
||||
|
||||
|
||||
unhcr_ts <- as.data.frame(unhcr_ts)
|
||||
|
||||
usethis::use_data(unhcr_ts, overwrite = TRUE)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Use data 2017 -----------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -174,12 +197,18 @@ unhcr_popstats[, country_origin := stringi::stri_trans_general(str = country_ori
|
|||
|
||||
|
||||
unhcr_popstats_2017 <- unhcr_popstats[year == 2017, -c("year")]
|
||||
|
||||
# head(unhcr_popstats_2017)
|
||||
|
||||
# utils::promptData(object = unhcr_popstats_2017, filename = "tmp.Rd")
|
||||
|
||||
unhcr_popstats_2017[, country_origin := stringi::stri_trans_general(str = country_origin, id = "ASCII-Latin")]
|
||||
unhcr_popstats_2017[, country_residence := stringi::stri_trans_general(str = country_residence, id = "ASCII-Latin")]
|
||||
unhcr_popstats_2017[, population_type := stringi::stri_trans_general(str = population_type, id = "ASCII-Latin")]
|
||||
unhcr_popstats_2017[, continent_residence := stringi::stri_trans_general(str = continent_residence, id = "ASCII-Latin")]
|
||||
unhcr_popstats_2017[, continent_origin := stringi::stri_trans_general(str = continent_origin, id = "ASCII-Latin")]
|
||||
|
||||
unhcr_popstats_2017 <- as.data.frame(unhcr_popstats_2017)
|
||||
head(unhcr_popstats_2017)
|
||||
|
||||
utils::promptData(object = unhcr_popstats_2017, filename = "tmp.Rd")
|
||||
|
||||
|
||||
usethis::use_data(unhcr_popstats_2017, overwrite = TRUE)
|
||||
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,120 +0,0 @@
|
|||
|
||||
|
||||
|
||||
# Parsing options ---------------------------------------------------------
|
||||
|
||||
cx <- V8::v8()
|
||||
cx$source(file = "inst/htmlwidgets/lib/apexcharts-1.0.4/Options.js")
|
||||
ApexOpts <- cx$get("Options")
|
||||
|
||||
names(ApexOpts)
|
||||
str(ApexOpts$chart, max.level = 1)
|
||||
str(ApexOpts$chart$animations, max.level = 1)
|
||||
|
||||
|
||||
|
||||
# Utils -------------------------------------------------------------------
|
||||
|
||||
make_fun <- function(opts, name, file = "") {
|
||||
args <- names(opts[[name]])
|
||||
if (is.null(args)) {
|
||||
args <- "..."
|
||||
} else {
|
||||
args <- sprintf("%s = NULL", args)
|
||||
args <- paste(args, collapse = ",\n")
|
||||
args <- paste0(args, ", ...")
|
||||
}
|
||||
body <- paste(
|
||||
"\nparams <- c(as.list(environment()), list(...))[-1]",
|
||||
paste0(".ax_opt2(ax, \"", name, "\", l = dropNulls(params))\n"),
|
||||
sep = "\n"
|
||||
)
|
||||
res <- paste0("ax_", name, " <- function(ax, ", args, ") {", body, "}\n\n\n")
|
||||
cat(res, file = file, append = TRUE)
|
||||
return(invisible(res))
|
||||
}
|
||||
|
||||
make_opts <- function(opts, name, file = "") {
|
||||
args <- names(opts[[name]])
|
||||
if (is.null(args)) {
|
||||
args <- "..."
|
||||
body <- "list(...)"
|
||||
} else {
|
||||
body <- sprintf("%s = %s", args, args)
|
||||
body <- paste(body, collapse = ",\n")
|
||||
body <- paste0("c(list(", body, "), list(...))")
|
||||
args <- sprintf("%s = NULL", args)
|
||||
args <- paste(args, collapse = ",\n")
|
||||
args <- paste0(args, ", ...")
|
||||
}
|
||||
body <- paste0("dropNulls(", body, ")")
|
||||
res <- paste0(name, "Opts", " <- function(", args, ") {", body, "}\n\n\n")
|
||||
cat(res, file = file, append = TRUE)
|
||||
return(invisible(res))
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
# chart -------------------------------------------------------------------
|
||||
|
||||
make_fun(ApexOpts, "chart")
|
||||
|
||||
|
||||
|
||||
# plotOptions -------------------------------------------------------------
|
||||
|
||||
make_fun(ApexOpts, "plotOptions")
|
||||
|
||||
|
||||
|
||||
|
||||
# ALL ---------------------------------------------------------------------
|
||||
|
||||
lapply(
|
||||
X = names(ApexOpts),
|
||||
FUN = make_fun, opts = ApexOpts, file = "R/apex-utils.R"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Options -----------------------------------------------------------------
|
||||
|
||||
# scroller
|
||||
str(ApexOpts$chart$scroller)
|
||||
|
||||
make_opts(ApexOpts$chart, "scroller")
|
||||
|
||||
# plotOptions -- bar
|
||||
make_opts(ApexOpts$plotOptions, "bar")
|
||||
|
||||
|
||||
|
||||
|
||||
### write funs
|
||||
|
||||
# chart
|
||||
str(ApexOpts$chart, max.level = 1)
|
||||
make_opts(ApexOpts$chart, "scroller", file = "R/apex-options.R")
|
||||
make_opts(ApexOpts$chart, "events", file = "R/apex-options.R")
|
||||
make_opts(ApexOpts$chart, "selection", file = "R/apex-options.R")
|
||||
|
||||
|
||||
# plotOptions
|
||||
str(ApexOpts$plotOptions, max.level = 1)
|
||||
make_opts(ApexOpts$plotOptions, "bar", file = "R/apex-options.R")
|
||||
make_opts(ApexOpts$plotOptions, "heatmap", file = "R/apex-options.R")
|
||||
make_opts(ApexOpts$plotOptions, "radialBar", file = "R/apex-options.R")
|
||||
make_opts(ApexOpts$plotOptions, "pie", file = "R/apex-options.R")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
|
||||
|
||||
# apexcharts.js raw api ---------------------------------------------------
|
||||
|
||||
|
||||
library(apexcharter)
|
||||
library(ggplot2) # for data
|
||||
library(dplyr)
|
||||
|
||||
|
||||
# bar ----
|
||||
|
||||
data(mpg)
|
||||
dat <- count(mpg, manufacturer)
|
||||
|
||||
apexchart(ax_opts = list(
|
||||
chart = list(type = "bar"),
|
||||
plotOptions = list(
|
||||
bar = list(
|
||||
horizontal = FALSE,
|
||||
endingShape = "flat",
|
||||
columnWidth = "70%",
|
||||
dataLabels = list(
|
||||
position = "top"
|
||||
)
|
||||
)
|
||||
),
|
||||
colors = list("#112446"),
|
||||
grid = list(
|
||||
show = TRUE,
|
||||
position = "front"
|
||||
),
|
||||
series = list(list(
|
||||
name = "Count",
|
||||
data = dat$n
|
||||
)),
|
||||
xaxis = list(categories = dat$manufacturer)
|
||||
))
|
||||
|
||||
|
||||
|
||||
# line ----
|
||||
|
||||
# recreating (mostly): https://apexcharts.com/javascript-chart-demos/line-charts/data-labels/
|
||||
|
||||
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 + '°C';}")
|
||||
)
|
||||
)
|
||||
))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,168 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>License • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="pkgdown.css" rel="stylesheet">
|
||||
<script src="pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="License" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-title-body">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="contents col-md-9">
|
||||
<div class="page-header">
|
||||
<h1>License</h1>
|
||||
</div>
|
||||
|
||||
<pre>R PACKAGE
|
||||
=========
|
||||
|
||||
YEAR: 2018
|
||||
COPYRIGHT HOLDER: dreamRs
|
||||
|
||||
|
||||
ApexCharts.js
|
||||
=============
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 ApexCharts
|
||||
|
||||
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.
|
||||
|
||||
</pre>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Articles • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Articles" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-article-index">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Articles</h1>
|
||||
</div>
|
||||
|
||||
<div class="section ">
|
||||
<h3>All vignettes</h3>
|
||||
<p class="section-desc"></p>
|
||||
|
||||
<ul>
|
||||
<li><a href="starting-with-apexcharts.html">Starting with ApexCharts</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -1,93 +0,0 @@
|
|||
HTMLWidgets.widget({
|
||||
|
||||
name: 'apexcharter',
|
||||
|
||||
type: 'output',
|
||||
|
||||
factory: function(el, width, height) {
|
||||
|
||||
var ax_opts;
|
||||
var apexchart = null;
|
||||
|
||||
return {
|
||||
|
||||
renderValue: function(x) {
|
||||
|
||||
|
||||
// Global options
|
||||
ax_opts = x.ax_opts;
|
||||
|
||||
// Sizing
|
||||
if (typeof ax_opts.chart === 'undefined') {
|
||||
ax_opts.chart = {};
|
||||
}
|
||||
ax_opts.chart.width = width;
|
||||
ax_opts.chart.height = height;
|
||||
|
||||
// Generate or update chart
|
||||
if (apexchart === null) {
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
} else {
|
||||
if (x.auto_update) {
|
||||
apexchart.updateSeries(ax_opts.series);
|
||||
} else {
|
||||
apexchart.destroy();
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
getChart: function(){
|
||||
return apexchart;
|
||||
},
|
||||
|
||||
resize: function(width, height) {
|
||||
apexchart.updateOptions({
|
||||
chart: {
|
||||
width: width,
|
||||
height: height
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// From Friss tuto (https://github.com/FrissAnalytics/shinyJsTutorials/blob/master/tutorials/tutorial_03.Rmd)
|
||||
function get_widget(id){
|
||||
|
||||
// Get the HTMLWidgets object
|
||||
var htmlWidgetsObj = HTMLWidgets.find("#" + id);
|
||||
|
||||
// Use the getChart method we created to get the underlying billboard chart
|
||||
var widgetObj ;
|
||||
|
||||
if (typeof htmlWidgetsObj != 'undefined') {
|
||||
widgetObj = htmlWidgetsObj.getChart();
|
||||
}
|
||||
|
||||
return(widgetObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (HTMLWidgets.shinyMode) {
|
||||
// data = load
|
||||
Shiny.addCustomMessageHandler('update-apexchart-series',
|
||||
function(obj) {
|
||||
var chart = get_widget(obj.id);
|
||||
if (typeof chart != 'undefined') {
|
||||
chart.updateSeries(obj.data.newSeries, obj.data.animate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
HTMLWidgets.widget({
|
||||
|
||||
name: 'apexcharter',
|
||||
|
||||
type: 'output',
|
||||
|
||||
factory: function(el, width, height) {
|
||||
|
||||
var ax_opts;
|
||||
var apexchart = null;
|
||||
|
||||
return {
|
||||
|
||||
renderValue: function(x) {
|
||||
|
||||
|
||||
// Global options
|
||||
ax_opts = x.ax_opts;
|
||||
|
||||
// Sizing
|
||||
if (typeof ax_opts.chart === 'undefined') {
|
||||
ax_opts.chart = {};
|
||||
}
|
||||
ax_opts.chart.width = width;
|
||||
ax_opts.chart.height = height;
|
||||
|
||||
// Generate or update chart
|
||||
if (apexchart === null) {
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
} else {
|
||||
if (x.auto_update) {
|
||||
apexchart.updateSeries(ax_opts.series);
|
||||
} else {
|
||||
apexchart.destroy();
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
getChart: function(){
|
||||
return apexchart;
|
||||
},
|
||||
|
||||
resize: function(width, height) {
|
||||
apexchart.updateOptions({
|
||||
chart: {
|
||||
width: width,
|
||||
height: height
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// From Friss tuto (https://github.com/FrissAnalytics/shinyJsTutorials/blob/master/tutorials/tutorial_03.Rmd)
|
||||
function get_widget(id){
|
||||
|
||||
// Get the HTMLWidgets object
|
||||
var htmlWidgetsObj = HTMLWidgets.find("#" + id);
|
||||
|
||||
// Use the getChart method we created to get the underlying billboard chart
|
||||
var widgetObj ;
|
||||
|
||||
if (typeof htmlWidgetsObj != 'undefined') {
|
||||
widgetObj = htmlWidgetsObj.getChart();
|
||||
}
|
||||
|
||||
return(widgetObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (HTMLWidgets.shinyMode) {
|
||||
// data = load
|
||||
Shiny.addCustomMessageHandler('update-apexchart-series',
|
||||
function(obj) {
|
||||
var chart = get_widget(obj.id);
|
||||
if (typeof chart != 'undefined') {
|
||||
chart.updateSeries(obj.data.newSeries, obj.data.animate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
HTMLWidgets.widget({
|
||||
|
||||
name: 'apexcharter',
|
||||
|
||||
type: 'output',
|
||||
|
||||
factory: function(el, width, height) {
|
||||
|
||||
var ax_opts;
|
||||
var apexchart = null;
|
||||
|
||||
return {
|
||||
|
||||
renderValue: function(x) {
|
||||
|
||||
|
||||
// Global options
|
||||
ax_opts = x.ax_opts;
|
||||
|
||||
// Sizing
|
||||
if (typeof ax_opts.chart === 'undefined') {
|
||||
ax_opts.chart = {};
|
||||
}
|
||||
ax_opts.chart.width = width;
|
||||
ax_opts.chart.height = height;
|
||||
|
||||
// Generate or update chart
|
||||
if (apexchart === null) {
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
} else {
|
||||
if (x.auto_update) {
|
||||
apexchart.updateSeries(ax_opts.series);
|
||||
} else {
|
||||
apexchart.destroy();
|
||||
apexchart = new ApexCharts(document.querySelector("#" + el.id), ax_opts);
|
||||
apexchart.render();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
getChart: function(){
|
||||
return apexchart;
|
||||
},
|
||||
|
||||
resize: function(width, height) {
|
||||
apexchart.updateOptions({
|
||||
chart: {
|
||||
width: width,
|
||||
height: height
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
// From Friss tuto (https://github.com/FrissAnalytics/shinyJsTutorials/blob/master/tutorials/tutorial_03.Rmd)
|
||||
function get_widget(id){
|
||||
|
||||
// Get the HTMLWidgets object
|
||||
var htmlWidgetsObj = HTMLWidgets.find("#" + id);
|
||||
|
||||
// Use the getChart method we created to get the underlying billboard chart
|
||||
var widgetObj ;
|
||||
|
||||
if (typeof htmlWidgetsObj != 'undefined') {
|
||||
widgetObj = htmlWidgetsObj.getChart();
|
||||
}
|
||||
|
||||
return(widgetObj);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (HTMLWidgets.shinyMode) {
|
||||
// data = load
|
||||
Shiny.addCustomMessageHandler('update-apexchart-series',
|
||||
function(obj) {
|
||||
var chart = get_widget(obj.id);
|
||||
if (typeof chart != 'undefined') {
|
||||
chart.updateSeries(obj.data.newSeries, obj.data.animate);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
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
|
@ -1,839 +0,0 @@
|
|||
(function() {
|
||||
// If window.HTMLWidgets is already defined, then use it; otherwise create a
|
||||
// new object. This allows preceding code to set options that affect the
|
||||
// initialization process (though none currently exist).
|
||||
window.HTMLWidgets = window.HTMLWidgets || {};
|
||||
|
||||
// See if we're running in a viewer pane. If not, we're in a web browser.
|
||||
var viewerMode = window.HTMLWidgets.viewerMode =
|
||||
/\bviewer_pane=1\b/.test(window.location);
|
||||
|
||||
// See if we're running in Shiny mode. If not, it's a static document.
|
||||
// Note that static widgets can appear in both Shiny and static modes, but
|
||||
// obviously, Shiny widgets can only appear in Shiny apps/documents.
|
||||
var shinyMode = window.HTMLWidgets.shinyMode =
|
||||
typeof(window.Shiny) !== "undefined" && !!window.Shiny.outputBindings;
|
||||
|
||||
// We can't count on jQuery being available, so we implement our own
|
||||
// version if necessary.
|
||||
function querySelectorAll(scope, selector) {
|
||||
if (typeof(jQuery) !== "undefined" && scope instanceof jQuery) {
|
||||
return scope.find(selector);
|
||||
}
|
||||
if (scope.querySelectorAll) {
|
||||
return scope.querySelectorAll(selector);
|
||||
}
|
||||
}
|
||||
|
||||
function asArray(value) {
|
||||
if (value === null)
|
||||
return [];
|
||||
if ($.isArray(value))
|
||||
return value;
|
||||
return [value];
|
||||
}
|
||||
|
||||
// Implement jQuery's extend
|
||||
function extend(target /*, ... */) {
|
||||
if (arguments.length == 1) {
|
||||
return target;
|
||||
}
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
for (var prop in source) {
|
||||
if (source.hasOwnProperty(prop)) {
|
||||
target[prop] = source[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// IE8 doesn't support Array.forEach.
|
||||
function forEach(values, callback, thisArg) {
|
||||
if (values.forEach) {
|
||||
values.forEach(callback, thisArg);
|
||||
} else {
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
callback.call(thisArg, values[i], i, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Replaces the specified method with the return value of funcSource.
|
||||
//
|
||||
// Note that funcSource should not BE the new method, it should be a function
|
||||
// that RETURNS the new method. funcSource receives a single argument that is
|
||||
// the overridden method, it can be called from the new method. The overridden
|
||||
// method can be called like a regular function, it has the target permanently
|
||||
// bound to it so "this" will work correctly.
|
||||
function overrideMethod(target, methodName, funcSource) {
|
||||
var superFunc = target[methodName] || function() {};
|
||||
var superFuncBound = function() {
|
||||
return superFunc.apply(target, arguments);
|
||||
};
|
||||
target[methodName] = funcSource(superFuncBound);
|
||||
}
|
||||
|
||||
// Add a method to delegator that, when invoked, calls
|
||||
// delegatee.methodName. If there is no such method on
|
||||
// the delegatee, but there was one on delegator before
|
||||
// delegateMethod was called, then the original version
|
||||
// is invoked instead.
|
||||
// For example:
|
||||
//
|
||||
// var a = {
|
||||
// method1: function() { console.log('a1'); }
|
||||
// method2: function() { console.log('a2'); }
|
||||
// };
|
||||
// var b = {
|
||||
// method1: function() { console.log('b1'); }
|
||||
// };
|
||||
// delegateMethod(a, b, "method1");
|
||||
// delegateMethod(a, b, "method2");
|
||||
// a.method1();
|
||||
// a.method2();
|
||||
//
|
||||
// The output would be "b1", "a2".
|
||||
function delegateMethod(delegator, delegatee, methodName) {
|
||||
var inherited = delegator[methodName];
|
||||
delegator[methodName] = function() {
|
||||
var target = delegatee;
|
||||
var method = delegatee[methodName];
|
||||
|
||||
// The method doesn't exist on the delegatee. Instead,
|
||||
// call the method on the delegator, if it exists.
|
||||
if (!method) {
|
||||
target = delegator;
|
||||
method = inherited;
|
||||
}
|
||||
|
||||
if (method) {
|
||||
return method.apply(target, arguments);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Implement a vague facsimilie of jQuery's data method
|
||||
function elementData(el, name, value) {
|
||||
if (arguments.length == 2) {
|
||||
return el["htmlwidget_data_" + name];
|
||||
} else if (arguments.length == 3) {
|
||||
el["htmlwidget_data_" + name] = value;
|
||||
return el;
|
||||
} else {
|
||||
throw new Error("Wrong number of arguments for elementData: " +
|
||||
arguments.length);
|
||||
}
|
||||
}
|
||||
|
||||
// http://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex
|
||||
function escapeRegExp(str) {
|
||||
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
||||
}
|
||||
|
||||
function hasClass(el, className) {
|
||||
var re = new RegExp("\\b" + escapeRegExp(className) + "\\b");
|
||||
return re.test(el.className);
|
||||
}
|
||||
|
||||
// elements - array (or array-like object) of HTML elements
|
||||
// className - class name to test for
|
||||
// include - if true, only return elements with given className;
|
||||
// if false, only return elements *without* given className
|
||||
function filterByClass(elements, className, include) {
|
||||
var results = [];
|
||||
for (var i = 0; i < elements.length; i++) {
|
||||
if (hasClass(elements[i], className) == include)
|
||||
results.push(elements[i]);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
function on(obj, eventName, func) {
|
||||
if (obj.addEventListener) {
|
||||
obj.addEventListener(eventName, func, false);
|
||||
} else if (obj.attachEvent) {
|
||||
obj.attachEvent(eventName, func);
|
||||
}
|
||||
}
|
||||
|
||||
function off(obj, eventName, func) {
|
||||
if (obj.removeEventListener)
|
||||
obj.removeEventListener(eventName, func, false);
|
||||
else if (obj.detachEvent) {
|
||||
obj.detachEvent(eventName, func);
|
||||
}
|
||||
}
|
||||
|
||||
// Translate array of values to top/right/bottom/left, as usual with
|
||||
// the "padding" CSS property
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/padding
|
||||
function unpackPadding(value) {
|
||||
if (typeof(value) === "number")
|
||||
value = [value];
|
||||
if (value.length === 1) {
|
||||
return {top: value[0], right: value[0], bottom: value[0], left: value[0]};
|
||||
}
|
||||
if (value.length === 2) {
|
||||
return {top: value[0], right: value[1], bottom: value[0], left: value[1]};
|
||||
}
|
||||
if (value.length === 3) {
|
||||
return {top: value[0], right: value[1], bottom: value[2], left: value[1]};
|
||||
}
|
||||
if (value.length === 4) {
|
||||
return {top: value[0], right: value[1], bottom: value[2], left: value[3]};
|
||||
}
|
||||
}
|
||||
|
||||
// Convert an unpacked padding object to a CSS value
|
||||
function paddingToCss(paddingObj) {
|
||||
return paddingObj.top + "px " + paddingObj.right + "px " + paddingObj.bottom + "px " + paddingObj.left + "px";
|
||||
}
|
||||
|
||||
// Makes a number suitable for CSS
|
||||
function px(x) {
|
||||
if (typeof(x) === "number")
|
||||
return x + "px";
|
||||
else
|
||||
return x;
|
||||
}
|
||||
|
||||
// Retrieves runtime widget sizing information for an element.
|
||||
// The return value is either null, or an object with fill, padding,
|
||||
// defaultWidth, defaultHeight fields.
|
||||
function sizingPolicy(el) {
|
||||
var sizingEl = document.querySelector("script[data-for='" + el.id + "'][type='application/htmlwidget-sizing']");
|
||||
if (!sizingEl)
|
||||
return null;
|
||||
var sp = JSON.parse(sizingEl.textContent || sizingEl.text || "{}");
|
||||
if (viewerMode) {
|
||||
return sp.viewer;
|
||||
} else {
|
||||
return sp.browser;
|
||||
}
|
||||
}
|
||||
|
||||
// @param tasks Array of strings (or falsy value, in which case no-op).
|
||||
// Each element must be a valid JavaScript expression that yields a
|
||||
// function. Or, can be an array of objects with "code" and "data"
|
||||
// properties; in this case, the "code" property should be a string
|
||||
// of JS that's an expr that yields a function, and "data" should be
|
||||
// an object that will be added as an additional argument when that
|
||||
// function is called.
|
||||
// @param target The object that will be "this" for each function
|
||||
// execution.
|
||||
// @param args Array of arguments to be passed to the functions. (The
|
||||
// same arguments will be passed to all functions.)
|
||||
function evalAndRun(tasks, target, args) {
|
||||
if (tasks) {
|
||||
forEach(tasks, function(task) {
|
||||
var theseArgs = args;
|
||||
if (typeof(task) === "object") {
|
||||
theseArgs = theseArgs.concat([task.data]);
|
||||
task = task.code;
|
||||
}
|
||||
var taskFunc = eval("(" + task + ")");
|
||||
if (typeof(taskFunc) !== "function") {
|
||||
throw new Error("Task must be a function! Source:\n" + task);
|
||||
}
|
||||
taskFunc.apply(target, theseArgs);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initSizing(el) {
|
||||
var sizing = sizingPolicy(el);
|
||||
if (!sizing)
|
||||
return;
|
||||
|
||||
var cel = document.getElementById("htmlwidget_container");
|
||||
if (!cel)
|
||||
return;
|
||||
|
||||
if (typeof(sizing.padding) !== "undefined") {
|
||||
document.body.style.margin = "0";
|
||||
document.body.style.padding = paddingToCss(unpackPadding(sizing.padding));
|
||||
}
|
||||
|
||||
if (sizing.fill) {
|
||||
document.body.style.overflow = "hidden";
|
||||
document.body.style.width = "100%";
|
||||
document.body.style.height = "100%";
|
||||
document.documentElement.style.width = "100%";
|
||||
document.documentElement.style.height = "100%";
|
||||
if (cel) {
|
||||
cel.style.position = "absolute";
|
||||
var pad = unpackPadding(sizing.padding);
|
||||
cel.style.top = pad.top + "px";
|
||||
cel.style.right = pad.right + "px";
|
||||
cel.style.bottom = pad.bottom + "px";
|
||||
cel.style.left = pad.left + "px";
|
||||
el.style.width = "100%";
|
||||
el.style.height = "100%";
|
||||
}
|
||||
|
||||
return {
|
||||
getWidth: function() { return cel.offsetWidth; },
|
||||
getHeight: function() { return cel.offsetHeight; }
|
||||
};
|
||||
|
||||
} else {
|
||||
el.style.width = px(sizing.width);
|
||||
el.style.height = px(sizing.height);
|
||||
|
||||
return {
|
||||
getWidth: function() { return el.offsetWidth; },
|
||||
getHeight: function() { return el.offsetHeight; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Default implementations for methods
|
||||
var defaults = {
|
||||
find: function(scope) {
|
||||
return querySelectorAll(scope, "." + this.name);
|
||||
},
|
||||
renderError: function(el, err) {
|
||||
var $el = $(el);
|
||||
|
||||
this.clearError(el);
|
||||
|
||||
// Add all these error classes, as Shiny does
|
||||
var errClass = "shiny-output-error";
|
||||
if (err.type !== null) {
|
||||
// use the classes of the error condition as CSS class names
|
||||
errClass = errClass + " " + $.map(asArray(err.type), function(type) {
|
||||
return errClass + "-" + type;
|
||||
}).join(" ");
|
||||
}
|
||||
errClass = errClass + " htmlwidgets-error";
|
||||
|
||||
// Is el inline or block? If inline or inline-block, just display:none it
|
||||
// and add an inline error.
|
||||
var display = $el.css("display");
|
||||
$el.data("restore-display-mode", display);
|
||||
|
||||
if (display === "inline" || display === "inline-block") {
|
||||
$el.hide();
|
||||
if (err.message !== "") {
|
||||
var errorSpan = $("<span>").addClass(errClass);
|
||||
errorSpan.text(err.message);
|
||||
$el.after(errorSpan);
|
||||
}
|
||||
} else if (display === "block") {
|
||||
// If block, add an error just after the el, set visibility:none on the
|
||||
// el, and position the error to be on top of the el.
|
||||
// Mark it with a unique ID and CSS class so we can remove it later.
|
||||
$el.css("visibility", "hidden");
|
||||
if (err.message !== "") {
|
||||
var errorDiv = $("<div>").addClass(errClass).css("position", "absolute")
|
||||
.css("top", el.offsetTop)
|
||||
.css("left", el.offsetLeft)
|
||||
// setting width can push out the page size, forcing otherwise
|
||||
// unnecessary scrollbars to appear and making it impossible for
|
||||
// the element to shrink; so use max-width instead
|
||||
.css("maxWidth", el.offsetWidth)
|
||||
.css("height", el.offsetHeight);
|
||||
errorDiv.text(err.message);
|
||||
$el.after(errorDiv);
|
||||
|
||||
// Really dumb way to keep the size/position of the error in sync with
|
||||
// the parent element as the window is resized or whatever.
|
||||
var intId = setInterval(function() {
|
||||
if (!errorDiv[0].parentElement) {
|
||||
clearInterval(intId);
|
||||
return;
|
||||
}
|
||||
errorDiv
|
||||
.css("top", el.offsetTop)
|
||||
.css("left", el.offsetLeft)
|
||||
.css("maxWidth", el.offsetWidth)
|
||||
.css("height", el.offsetHeight);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
},
|
||||
clearError: function(el) {
|
||||
var $el = $(el);
|
||||
var display = $el.data("restore-display-mode");
|
||||
$el.data("restore-display-mode", null);
|
||||
|
||||
if (display === "inline" || display === "inline-block") {
|
||||
if (display)
|
||||
$el.css("display", display);
|
||||
$(el.nextSibling).filter(".htmlwidgets-error").remove();
|
||||
} else if (display === "block"){
|
||||
$el.css("visibility", "inherit");
|
||||
$(el.nextSibling).filter(".htmlwidgets-error").remove();
|
||||
}
|
||||
},
|
||||
sizing: {}
|
||||
};
|
||||
|
||||
// Called by widget bindings to register a new type of widget. The definition
|
||||
// object can contain the following properties:
|
||||
// - name (required) - A string indicating the binding name, which will be
|
||||
// used by default as the CSS classname to look for.
|
||||
// - initialize (optional) - A function(el) that will be called once per
|
||||
// widget element; if a value is returned, it will be passed as the third
|
||||
// value to renderValue.
|
||||
// - renderValue (required) - A function(el, data, initValue) that will be
|
||||
// called with data. Static contexts will cause this to be called once per
|
||||
// element; Shiny apps will cause this to be called multiple times per
|
||||
// element, as the data changes.
|
||||
window.HTMLWidgets.widget = function(definition) {
|
||||
if (!definition.name) {
|
||||
throw new Error("Widget must have a name");
|
||||
}
|
||||
if (!definition.type) {
|
||||
throw new Error("Widget must have a type");
|
||||
}
|
||||
// Currently we only support output widgets
|
||||
if (definition.type !== "output") {
|
||||
throw new Error("Unrecognized widget type '" + definition.type + "'");
|
||||
}
|
||||
// TODO: Verify that .name is a valid CSS classname
|
||||
|
||||
// Support new-style instance-bound definitions. Old-style class-bound
|
||||
// definitions have one widget "object" per widget per type/class of
|
||||
// widget; the renderValue and resize methods on such widget objects
|
||||
// take el and instance arguments, because the widget object can't
|
||||
// store them. New-style instance-bound definitions have one widget
|
||||
// object per widget instance; the definition that's passed in doesn't
|
||||
// provide renderValue or resize methods at all, just the single method
|
||||
// factory(el, width, height)
|
||||
// which returns an object that has renderValue(x) and resize(w, h).
|
||||
// This enables a far more natural programming style for the widget
|
||||
// author, who can store per-instance state using either OO-style
|
||||
// instance fields or functional-style closure variables (I guess this
|
||||
// is in contrast to what can only be called C-style pseudo-OO which is
|
||||
// what we required before).
|
||||
if (definition.factory) {
|
||||
definition = createLegacyDefinitionAdapter(definition);
|
||||
}
|
||||
|
||||
if (!definition.renderValue) {
|
||||
throw new Error("Widget must have a renderValue function");
|
||||
}
|
||||
|
||||
// For static rendering (non-Shiny), use a simple widget registration
|
||||
// scheme. We also use this scheme for Shiny apps/documents that also
|
||||
// contain static widgets.
|
||||
window.HTMLWidgets.widgets = window.HTMLWidgets.widgets || [];
|
||||
// Merge defaults into the definition; don't mutate the original definition.
|
||||
var staticBinding = extend({}, defaults, definition);
|
||||
overrideMethod(staticBinding, "find", function(superfunc) {
|
||||
return function(scope) {
|
||||
var results = superfunc(scope);
|
||||
// Filter out Shiny outputs, we only want the static kind
|
||||
return filterByClass(results, "html-widget-output", false);
|
||||
};
|
||||
});
|
||||
window.HTMLWidgets.widgets.push(staticBinding);
|
||||
|
||||
if (shinyMode) {
|
||||
// Shiny is running. Register the definition with an output binding.
|
||||
// The definition itself will not be the output binding, instead
|
||||
// we will make an output binding object that delegates to the
|
||||
// definition. This is because we foolishly used the same method
|
||||
// name (renderValue) for htmlwidgets definition and Shiny bindings
|
||||
// but they actually have quite different semantics (the Shiny
|
||||
// bindings receive data that includes lots of metadata that it
|
||||
// strips off before calling htmlwidgets renderValue). We can't
|
||||
// just ignore the difference because in some widgets it's helpful
|
||||
// to call this.renderValue() from inside of resize(), and if
|
||||
// we're not delegating, then that call will go to the Shiny
|
||||
// version instead of the htmlwidgets version.
|
||||
|
||||
// Merge defaults with definition, without mutating either.
|
||||
var bindingDef = extend({}, defaults, definition);
|
||||
|
||||
// This object will be our actual Shiny binding.
|
||||
var shinyBinding = new Shiny.OutputBinding();
|
||||
|
||||
// With a few exceptions, we'll want to simply use the bindingDef's
|
||||
// version of methods if they are available, otherwise fall back to
|
||||
// Shiny's defaults. NOTE: If Shiny's output bindings gain additional
|
||||
// methods in the future, and we want them to be overrideable by
|
||||
// HTMLWidget binding definitions, then we'll need to add them to this
|
||||
// list.
|
||||
delegateMethod(shinyBinding, bindingDef, "getId");
|
||||
delegateMethod(shinyBinding, bindingDef, "onValueChange");
|
||||
delegateMethod(shinyBinding, bindingDef, "onValueError");
|
||||
delegateMethod(shinyBinding, bindingDef, "renderError");
|
||||
delegateMethod(shinyBinding, bindingDef, "clearError");
|
||||
delegateMethod(shinyBinding, bindingDef, "showProgress");
|
||||
|
||||
// The find, renderValue, and resize are handled differently, because we
|
||||
// want to actually decorate the behavior of the bindingDef methods.
|
||||
|
||||
shinyBinding.find = function(scope) {
|
||||
var results = bindingDef.find(scope);
|
||||
|
||||
// Only return elements that are Shiny outputs, not static ones
|
||||
var dynamicResults = results.filter(".html-widget-output");
|
||||
|
||||
// It's possible that whatever caused Shiny to think there might be
|
||||
// new dynamic outputs, also caused there to be new static outputs.
|
||||
// Since there might be lots of different htmlwidgets bindings, we
|
||||
// schedule execution for later--no need to staticRender multiple
|
||||
// times.
|
||||
if (results.length !== dynamicResults.length)
|
||||
scheduleStaticRender();
|
||||
|
||||
return dynamicResults;
|
||||
};
|
||||
|
||||
// Wrap renderValue to handle initialization, which unfortunately isn't
|
||||
// supported natively by Shiny at the time of this writing.
|
||||
|
||||
shinyBinding.renderValue = function(el, data) {
|
||||
Shiny.renderDependencies(data.deps);
|
||||
// Resolve strings marked as javascript literals to objects
|
||||
if (!(data.evals instanceof Array)) data.evals = [data.evals];
|
||||
for (var i = 0; data.evals && i < data.evals.length; i++) {
|
||||
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[i]);
|
||||
}
|
||||
if (!bindingDef.renderOnNullValue) {
|
||||
if (data.x === null) {
|
||||
el.style.visibility = "hidden";
|
||||
return;
|
||||
} else {
|
||||
el.style.visibility = "inherit";
|
||||
}
|
||||
}
|
||||
if (!elementData(el, "initialized")) {
|
||||
initSizing(el);
|
||||
|
||||
elementData(el, "initialized", true);
|
||||
if (bindingDef.initialize) {
|
||||
var result = bindingDef.initialize(el, el.offsetWidth,
|
||||
el.offsetHeight);
|
||||
elementData(el, "init_result", result);
|
||||
}
|
||||
}
|
||||
bindingDef.renderValue(el, data.x, elementData(el, "init_result"));
|
||||
evalAndRun(data.jsHooks.render, elementData(el, "init_result"), [el, data.x]);
|
||||
};
|
||||
|
||||
// Only override resize if bindingDef implements it
|
||||
if (bindingDef.resize) {
|
||||
shinyBinding.resize = function(el, width, height) {
|
||||
// Shiny can call resize before initialize/renderValue have been
|
||||
// called, which doesn't make sense for widgets.
|
||||
if (elementData(el, "initialized")) {
|
||||
bindingDef.resize(el, width, height, elementData(el, "init_result"));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Shiny.outputBindings.register(shinyBinding, bindingDef.name);
|
||||
}
|
||||
};
|
||||
|
||||
var scheduleStaticRenderTimerId = null;
|
||||
function scheduleStaticRender() {
|
||||
if (!scheduleStaticRenderTimerId) {
|
||||
scheduleStaticRenderTimerId = setTimeout(function() {
|
||||
scheduleStaticRenderTimerId = null;
|
||||
window.HTMLWidgets.staticRender();
|
||||
}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Render static widgets after the document finishes loading
|
||||
// Statically render all elements that are of this widget's class
|
||||
window.HTMLWidgets.staticRender = function() {
|
||||
var bindings = window.HTMLWidgets.widgets || [];
|
||||
forEach(bindings, function(binding) {
|
||||
var matches = binding.find(document.documentElement);
|
||||
forEach(matches, function(el) {
|
||||
var sizeObj = initSizing(el, binding);
|
||||
|
||||
if (hasClass(el, "html-widget-static-bound"))
|
||||
return;
|
||||
el.className = el.className + " html-widget-static-bound";
|
||||
|
||||
var initResult;
|
||||
if (binding.initialize) {
|
||||
initResult = binding.initialize(el,
|
||||
sizeObj ? sizeObj.getWidth() : el.offsetWidth,
|
||||
sizeObj ? sizeObj.getHeight() : el.offsetHeight
|
||||
);
|
||||
elementData(el, "init_result", initResult);
|
||||
}
|
||||
|
||||
if (binding.resize) {
|
||||
var lastSize = {
|
||||
w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
|
||||
h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
|
||||
};
|
||||
var resizeHandler = function(e) {
|
||||
var size = {
|
||||
w: sizeObj ? sizeObj.getWidth() : el.offsetWidth,
|
||||
h: sizeObj ? sizeObj.getHeight() : el.offsetHeight
|
||||
};
|
||||
if (size.w === 0 && size.h === 0)
|
||||
return;
|
||||
if (size.w === lastSize.w && size.h === lastSize.h)
|
||||
return;
|
||||
lastSize = size;
|
||||
binding.resize(el, size.w, size.h, initResult);
|
||||
};
|
||||
|
||||
on(window, "resize", resizeHandler);
|
||||
|
||||
// This is needed for cases where we're running in a Shiny
|
||||
// app, but the widget itself is not a Shiny output, but
|
||||
// rather a simple static widget. One example of this is
|
||||
// an rmarkdown document that has runtime:shiny and widget
|
||||
// that isn't in a render function. Shiny only knows to
|
||||
// call resize handlers for Shiny outputs, not for static
|
||||
// widgets, so we do it ourselves.
|
||||
if (window.jQuery) {
|
||||
window.jQuery(document).on(
|
||||
"shown.htmlwidgets shown.bs.tab.htmlwidgets shown.bs.collapse.htmlwidgets",
|
||||
resizeHandler
|
||||
);
|
||||
window.jQuery(document).on(
|
||||
"hidden.htmlwidgets hidden.bs.tab.htmlwidgets hidden.bs.collapse.htmlwidgets",
|
||||
resizeHandler
|
||||
);
|
||||
}
|
||||
|
||||
// This is needed for the specific case of ioslides, which
|
||||
// flips slides between display:none and display:block.
|
||||
// Ideally we would not have to have ioslide-specific code
|
||||
// here, but rather have ioslides raise a generic event,
|
||||
// but the rmarkdown package just went to CRAN so the
|
||||
// window to getting that fixed may be long.
|
||||
if (window.addEventListener) {
|
||||
// It's OK to limit this to window.addEventListener
|
||||
// browsers because ioslides itself only supports
|
||||
// such browsers.
|
||||
on(document, "slideenter", resizeHandler);
|
||||
on(document, "slideleave", resizeHandler);
|
||||
}
|
||||
}
|
||||
|
||||
var scriptData = document.querySelector("script[data-for='" + el.id + "'][type='application/json']");
|
||||
if (scriptData) {
|
||||
var data = JSON.parse(scriptData.textContent || scriptData.text);
|
||||
// Resolve strings marked as javascript literals to objects
|
||||
if (!(data.evals instanceof Array)) data.evals = [data.evals];
|
||||
for (var k = 0; data.evals && k < data.evals.length; k++) {
|
||||
window.HTMLWidgets.evaluateStringMember(data.x, data.evals[k]);
|
||||
}
|
||||
binding.renderValue(el, data.x, initResult);
|
||||
evalAndRun(data.jsHooks.render, initResult, [el, data.x]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
invokePostRenderHandlers();
|
||||
}
|
||||
|
||||
// Wait until after the document has loaded to render the widgets.
|
||||
if (document.addEventListener) {
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.removeEventListener("DOMContentLoaded", arguments.callee, false);
|
||||
window.HTMLWidgets.staticRender();
|
||||
}, false);
|
||||
} else if (document.attachEvent) {
|
||||
document.attachEvent("onreadystatechange", function() {
|
||||
if (document.readyState === "complete") {
|
||||
document.detachEvent("onreadystatechange", arguments.callee);
|
||||
window.HTMLWidgets.staticRender();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
window.HTMLWidgets.getAttachmentUrl = function(depname, key) {
|
||||
// If no key, default to the first item
|
||||
if (typeof(key) === "undefined")
|
||||
key = 1;
|
||||
|
||||
var link = document.getElementById(depname + "-" + key + "-attachment");
|
||||
if (!link) {
|
||||
throw new Error("Attachment " + depname + "/" + key + " not found in document");
|
||||
}
|
||||
return link.getAttribute("href");
|
||||
};
|
||||
|
||||
window.HTMLWidgets.dataframeToD3 = function(df) {
|
||||
var names = [];
|
||||
var length;
|
||||
for (var name in df) {
|
||||
if (df.hasOwnProperty(name))
|
||||
names.push(name);
|
||||
if (typeof(df[name]) !== "object" || typeof(df[name].length) === "undefined") {
|
||||
throw new Error("All fields must be arrays");
|
||||
} else if (typeof(length) !== "undefined" && length !== df[name].length) {
|
||||
throw new Error("All fields must be arrays of the same length");
|
||||
}
|
||||
length = df[name].length;
|
||||
}
|
||||
var results = [];
|
||||
var item;
|
||||
for (var row = 0; row < length; row++) {
|
||||
item = {};
|
||||
for (var col = 0; col < names.length; col++) {
|
||||
item[names[col]] = df[names[col]][row];
|
||||
}
|
||||
results.push(item);
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
window.HTMLWidgets.transposeArray2D = function(array) {
|
||||
if (array.length === 0) return array;
|
||||
var newArray = array[0].map(function(col, i) {
|
||||
return array.map(function(row) {
|
||||
return row[i]
|
||||
})
|
||||
});
|
||||
return newArray;
|
||||
};
|
||||
// Split value at splitChar, but allow splitChar to be escaped
|
||||
// using escapeChar. Any other characters escaped by escapeChar
|
||||
// will be included as usual (including escapeChar itself).
|
||||
function splitWithEscape(value, splitChar, escapeChar) {
|
||||
var results = [];
|
||||
var escapeMode = false;
|
||||
var currentResult = "";
|
||||
for (var pos = 0; pos < value.length; pos++) {
|
||||
if (!escapeMode) {
|
||||
if (value[pos] === splitChar) {
|
||||
results.push(currentResult);
|
||||
currentResult = "";
|
||||
} else if (value[pos] === escapeChar) {
|
||||
escapeMode = true;
|
||||
} else {
|
||||
currentResult += value[pos];
|
||||
}
|
||||
} else {
|
||||
currentResult += value[pos];
|
||||
escapeMode = false;
|
||||
}
|
||||
}
|
||||
if (currentResult !== "") {
|
||||
results.push(currentResult);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
// Function authored by Yihui/JJ Allaire
|
||||
window.HTMLWidgets.evaluateStringMember = function(o, member) {
|
||||
var parts = splitWithEscape(member, '.', '\\');
|
||||
for (var i = 0, l = parts.length; i < l; i++) {
|
||||
var part = parts[i];
|
||||
// part may be a character or 'numeric' member name
|
||||
if (o !== null && typeof o === "object" && part in o) {
|
||||
if (i == (l - 1)) { // if we are at the end of the line then evalulate
|
||||
if (typeof o[part] === "string")
|
||||
o[part] = eval("(" + o[part] + ")");
|
||||
} else { // otherwise continue to next embedded object
|
||||
o = o[part];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Retrieve the HTMLWidget instance (i.e. the return value of an
|
||||
// HTMLWidget binding's initialize() or factory() function)
|
||||
// associated with an element, or null if none.
|
||||
window.HTMLWidgets.getInstance = function(el) {
|
||||
return elementData(el, "init_result");
|
||||
};
|
||||
|
||||
// Finds the first element in the scope that matches the selector,
|
||||
// and returns the HTMLWidget instance (i.e. the return value of
|
||||
// an HTMLWidget binding's initialize() or factory() function)
|
||||
// associated with that element, if any. If no element matches the
|
||||
// selector, or the first matching element has no HTMLWidget
|
||||
// instance associated with it, then null is returned.
|
||||
//
|
||||
// The scope argument is optional, and defaults to window.document.
|
||||
window.HTMLWidgets.find = function(scope, selector) {
|
||||
if (arguments.length == 1) {
|
||||
selector = scope;
|
||||
scope = document;
|
||||
}
|
||||
|
||||
var el = scope.querySelector(selector);
|
||||
if (el === null) {
|
||||
return null;
|
||||
} else {
|
||||
return window.HTMLWidgets.getInstance(el);
|
||||
}
|
||||
};
|
||||
|
||||
// Finds all elements in the scope that match the selector, and
|
||||
// returns the HTMLWidget instances (i.e. the return values of
|
||||
// an HTMLWidget binding's initialize() or factory() function)
|
||||
// associated with the elements, in an array. If elements that
|
||||
// match the selector don't have an associated HTMLWidget
|
||||
// instance, the returned array will contain nulls.
|
||||
//
|
||||
// The scope argument is optional, and defaults to window.document.
|
||||
window.HTMLWidgets.findAll = function(scope, selector) {
|
||||
if (arguments.length == 1) {
|
||||
selector = scope;
|
||||
scope = document;
|
||||
}
|
||||
|
||||
var nodes = scope.querySelectorAll(selector);
|
||||
var results = [];
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
results.push(window.HTMLWidgets.getInstance(nodes[i]));
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
var postRenderHandlers = [];
|
||||
function invokePostRenderHandlers() {
|
||||
while (postRenderHandlers.length) {
|
||||
var handler = postRenderHandlers.shift();
|
||||
if (handler) {
|
||||
handler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Register the given callback function to be invoked after the
|
||||
// next time static widgets are rendered.
|
||||
window.HTMLWidgets.addPostRenderHandler = function(callback) {
|
||||
postRenderHandlers.push(callback);
|
||||
};
|
||||
|
||||
// Takes a new-style instance-bound definition, and returns an
|
||||
// old-style class-bound definition. This saves us from having
|
||||
// to rewrite all the logic in this file to accomodate both
|
||||
// types of definitions.
|
||||
function createLegacyDefinitionAdapter(defn) {
|
||||
var result = {
|
||||
name: defn.name,
|
||||
type: defn.type,
|
||||
initialize: function(el, width, height) {
|
||||
return defn.factory(el, width, height);
|
||||
},
|
||||
renderValue: function(el, x, instance) {
|
||||
return instance.renderValue(x);
|
||||
},
|
||||
resize: function(el, width, height, instance) {
|
||||
return instance.resize(width, height);
|
||||
}
|
||||
};
|
||||
|
||||
if (defn.find)
|
||||
result.find = defn.find;
|
||||
if (defn.renderError)
|
||||
result.renderError = defn.renderError;
|
||||
if (defn.clearError)
|
||||
result.clearError = defn.clearError;
|
||||
|
||||
return result;
|
||||
}
|
||||
})();
|
||||
|
|
@ -1,149 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Authors • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="pkgdown.css" rel="stylesheet">
|
||||
<script src="pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Authors" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-authors">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="contents col-md-9">
|
||||
<div class="page-header">
|
||||
<h1>Authors</h1>
|
||||
</div>
|
||||
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<p><strong><a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a></strong>. Author, maintainer.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong><a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a></strong>. Author.
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Juned Chhipa</strong>. Copyright holder.
|
||||
<br /><small>apexcharts.js library</small></p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -1,85 +0,0 @@
|
|||
$(function() {
|
||||
|
||||
// register a handler to move the focus to the search bar
|
||||
// upon pressing shift + "/" (i.e. "?")
|
||||
$(document).on('keydown', function(e) {
|
||||
if (e.shiftKey && e.keyCode == 191) {
|
||||
e.preventDefault();
|
||||
$("#search-input").focus();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
// do keyword highlighting
|
||||
/* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */
|
||||
var mark = function() {
|
||||
|
||||
var referrer = document.URL ;
|
||||
var paramKey = "q" ;
|
||||
|
||||
if (referrer.indexOf("?") !== -1) {
|
||||
var qs = referrer.substr(referrer.indexOf('?') + 1);
|
||||
var qs_noanchor = qs.split('#')[0];
|
||||
var qsa = qs_noanchor.split('&');
|
||||
var keyword = "";
|
||||
|
||||
for (var i = 0; i < qsa.length; i++) {
|
||||
var currentParam = qsa[i].split('=');
|
||||
|
||||
if (currentParam.length !== 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (currentParam[0] == paramKey) {
|
||||
keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20"));
|
||||
}
|
||||
}
|
||||
|
||||
if (keyword !== "") {
|
||||
$(".contents").unmark({
|
||||
done: function() {
|
||||
$(".contents").mark(keyword);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
mark();
|
||||
});
|
||||
});
|
||||
|
||||
/* Search term highlighting ------------------------------*/
|
||||
|
||||
function matchedWords(hit) {
|
||||
var words = [];
|
||||
|
||||
var hierarchy = hit._highlightResult.hierarchy;
|
||||
// loop to fetch from lvl0, lvl1, etc.
|
||||
for (var idx in hierarchy) {
|
||||
words = words.concat(hierarchy[idx].matchedWords);
|
||||
}
|
||||
|
||||
var content = hit._highlightResult.content;
|
||||
if (content) {
|
||||
words = words.concat(content.matchedWords);
|
||||
}
|
||||
|
||||
// return unique words
|
||||
var words_uniq = [...new Set(words)];
|
||||
return words_uniq;
|
||||
}
|
||||
|
||||
function updateHitURL(hit) {
|
||||
|
||||
var words = matchedWords(hit);
|
||||
var url = "";
|
||||
|
||||
if (hit.anchor) {
|
||||
url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor;
|
||||
} else {
|
||||
url = hit.url + '?q=' + escape(words.join(" "));
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
242
docs/index.html
242
docs/index.html
|
@ -1,242 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- Generated by pkgdown: do not edit by hand --><html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Create Interactive Chart with the JavaScript 'ApexCharts' Library • apexcharter</title>
|
||||
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
|
||||
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
|
||||
<script src="pkgdown.js"></script><meta property="og:title" content="Create Interactive Chart with the JavaScript 'ApexCharts' Library">
|
||||
<meta property="og:description" content="Provides an 'htmlwidgets' interface to 'apexcharts.js'.">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="container template-home">
|
||||
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<!--/.nav-collapse -->
|
||||
</div>
|
||||
<!--/.container -->
|
||||
</div>
|
||||
<!--/.navbar -->
|
||||
|
||||
|
||||
</header><div class="row">
|
||||
<div class="contents col-md-9">
|
||||
<div id="apexcharter" class="section level1">
|
||||
<div class="page-header"><h1 class="hasAnchor">
|
||||
<a href="#apexcharter" class="anchor"></a>apexcharter</h1></div>
|
||||
<blockquote>
|
||||
<p>Htmlwidget for <a href="https://github.com/apexcharts/apexcharts.js">apexcharts.js</a> : A modern JavaScript charting library to build interactive charts and visualizations with simple API.</p>
|
||||
</blockquote>
|
||||
<p><a href="https://travis-ci.org/dreamRs/apexcharter"><img src="https://travis-ci.org/dreamRs/apexcharter.svg?branch=master" alt="Travis build status"></a> <a href="https://www.repostatus.org/#wip"><img src="https://www.repostatus.org/badges/latest/wip.svg" alt="Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public."></a></p>
|
||||
<p><span class="emoji" data-emoji="construction">🚧</span> Under development !! API will change <span class="emoji" data-emoji="construction">🚧</span></p>
|
||||
<p><span class="emoji" data-emoji="warning">⚠️</span> Use RStudio >= 1.2 to properly display charts</p>
|
||||
<p>Note: Once again, development is heavily inspired by amazing <a href="http://jkunst.com/highcharter/">highcharter</a>.</p>
|
||||
<div id="installation" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#installation" class="anchor"></a>Installation</h2>
|
||||
<p>You can install the development version from <a href="https://github.com/">GitHub</a> with:</p>
|
||||
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb1-1" title="1"><span class="co"># install.packages("devtools")</span></a>
|
||||
<a class="sourceLine" id="cb1-2" title="2">devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"dreamRs/apexcharter"</span>)</a></code></pre></div>
|
||||
</div>
|
||||
<div id="quick-charts" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#quick-charts" class="anchor"></a>Quick Charts</h2>
|
||||
<p>Use <code>apex</code> function to quickly create visualizations :</p>
|
||||
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb2-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(apexcharter)</a>
|
||||
<a class="sourceLine" id="cb2-2" title="2"></a>
|
||||
<a class="sourceLine" id="cb2-3" title="3"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(<span class="st">"mpg"</span>, <span class="dt">package =</span> <span class="st">"ggplot2"</span>)</a>
|
||||
<a class="sourceLine" id="cb2-4" title="4">n_manufac <-<span class="st"> </span>dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/tally.html">count</a></span>(mpg, manufacturer)</a>
|
||||
<a class="sourceLine" id="cb2-5" title="5"></a>
|
||||
<a class="sourceLine" id="cb2-6" title="6"><span class="kw"><a href="reference/apex.html">apex</a></span>(<span class="dt">data =</span> n_manufac, <span class="dt">type =</span> <span class="st">"bar"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> manufacturer, <span class="dt">y =</span> n))</a></code></pre></div>
|
||||
<p><img src="reference/figures/apex-bar.png"></p>
|
||||
<p>With datetime:</p>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb3-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(<span class="st">"economics"</span>, <span class="dt">package =</span> <span class="st">"ggplot2"</span>)</a>
|
||||
<a class="sourceLine" id="cb3-2" title="2"><span class="kw"><a href="reference/apex.html">apex</a></span>(<span class="dt">data =</span> economics, <span class="dt">type =</span> <span class="st">"line"</span>, <span class="dt">mapping =</span> <span class="kw"><a href="reference/apexcharter-exports.html">aes</a></span>(<span class="dt">x =</span> date, <span class="dt">y =</span> uempmed)) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb3-3" title="3"><span class="st"> </span><span class="kw"><a href="reference/ax_stroke.html">ax_stroke</a></span>(<span class="dt">width =</span> <span class="dv">1</span>)</a></code></pre></div>
|
||||
<p><img src="reference/figures/apex-line.png"></p>
|
||||
</div>
|
||||
<div id="full-api" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#full-api" class="anchor"></a>Full API</h2>
|
||||
<p>All methods from ApexCharts are available with function like <code>ax_*</code> compatible with pipe from <code>magrittr</code> :</p>
|
||||
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb4-1" title="1"><span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(apexcharter)</a>
|
||||
<a class="sourceLine" id="cb4-2" title="2"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/data">data</a></span>(mpg, <span class="dt">package =</span> <span class="st">"ggplot2"</span>)</a>
|
||||
<a class="sourceLine" id="cb4-3" title="3">n_manufac <-<span class="st"> </span>dplyr<span class="op">::</span><span class="kw"><a href="https://dplyr.tidyverse.org/reference/tally.html">count</a></span>(mpg, manufacturer)</a>
|
||||
<a class="sourceLine" id="cb4-4" title="4"></a>
|
||||
<a class="sourceLine" id="cb4-5" title="5"><span class="kw"><a href="reference/apexchart.html">apexchart</a></span>() <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-6" title="6"><span class="st"> </span><span class="kw"><a href="reference/ax_chart.html">ax_chart</a></span>(<span class="dt">type =</span> <span class="st">"bar"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-7" title="7"><span class="st"> </span><span class="kw"><a href="reference/ax_plotOptions.html">ax_plotOptions</a></span>(<span class="dt">bar =</span> <span class="kw"><a href="reference/bar_opts.html">bar_opts</a></span>(</a>
|
||||
<a class="sourceLine" id="cb4-8" title="8"> <span class="dt">horizontal =</span> <span class="ot">FALSE</span>,</a>
|
||||
<a class="sourceLine" id="cb4-9" title="9"> <span class="dt">endingShape =</span> <span class="st">"flat"</span>,</a>
|
||||
<a class="sourceLine" id="cb4-10" title="10"> <span class="dt">columnWidth =</span> <span class="st">"70%"</span>,</a>
|
||||
<a class="sourceLine" id="cb4-11" title="11"> <span class="dt">dataLabels =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb4-12" title="12"> <span class="dt">position =</span> <span class="st">"top"</span></a>
|
||||
<a class="sourceLine" id="cb4-13" title="13"> ))</a>
|
||||
<a class="sourceLine" id="cb4-14" title="14"> ) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-15" title="15"><span class="st"> </span><span class="kw"><a href="reference/ax_grid.html">ax_grid</a></span>(</a>
|
||||
<a class="sourceLine" id="cb4-16" title="16"> <span class="dt">show =</span> <span class="ot">TRUE</span>,</a>
|
||||
<a class="sourceLine" id="cb4-17" title="17"> <span class="dt">position =</span> <span class="st">"front"</span>,</a>
|
||||
<a class="sourceLine" id="cb4-18" title="18"> <span class="dt">borderColor =</span> <span class="st">"#FFF"</span></a>
|
||||
<a class="sourceLine" id="cb4-19" title="19"> ) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-20" title="20"><span class="st"> </span><span class="kw"><a href="reference/ax-series.html">ax_series</a></span>(<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb4-21" title="21"> <span class="dt">name =</span> <span class="st">"Count"</span>,</a>
|
||||
<a class="sourceLine" id="cb4-22" title="22"> <span class="dt">data =</span> n_manufac<span class="op">$</span>n</a>
|
||||
<a class="sourceLine" id="cb4-23" title="23"> )) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-24" title="24"><span class="st"> </span><span class="kw"><a href="reference/ax_colors.html">ax_colors</a></span>(<span class="st">"#112446"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-25" title="25"><span class="st"> </span><span class="kw"><a href="reference/ax_xaxis.html">ax_xaxis</a></span>(<span class="dt">categories =</span> n_manufac<span class="op">$</span>manufacturer) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-26" title="26"><span class="st"> </span><span class="kw"><a href="reference/ax_title.html">ax_title</a></span>(<span class="dt">text =</span> <span class="st">"Number of models"</span>) <span class="op">%>%</span><span class="st"> </span></a>
|
||||
<a class="sourceLine" id="cb4-27" title="27"><span class="st"> </span><span class="kw"><a href="reference/ax_subtitle.html">ax_subtitle</a></span>(<span class="dt">text =</span> <span class="st">"Data from ggplot2"</span>)</a></code></pre></div>
|
||||
<p><img src="reference/figures/apexcharter-full-bar.png"></p>
|
||||
</div>
|
||||
<div id="raw-api" class="section level2">
|
||||
<h2 class="hasAnchor">
|
||||
<a href="#raw-api" class="anchor"></a>Raw API</h2>
|
||||
<p>Pass a list of parameters to the function:</p>
|
||||
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><a class="sourceLine" id="cb5-1" title="1"><span class="kw"><a href="reference/apexchart.html">apexchart</a></span>(<span class="dt">ax_opts =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-2" title="2"> <span class="dt">chart =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-3" title="3"> <span class="dt">type =</span> <span class="st">"line"</span></a>
|
||||
<a class="sourceLine" id="cb5-4" title="4"> ),</a>
|
||||
<a class="sourceLine" id="cb5-5" title="5"> <span class="dt">stroke =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-6" title="6"> <span class="dt">curve =</span> <span class="st">"smooth"</span></a>
|
||||
<a class="sourceLine" id="cb5-7" title="7"> ),</a>
|
||||
<a class="sourceLine" id="cb5-8" title="8"> <span class="dt">grid =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-9" title="9"> <span class="dt">borderColor =</span> <span class="st">"#e7e7e7"</span>,</a>
|
||||
<a class="sourceLine" id="cb5-10" title="10"> <span class="dt">row =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-11" title="11"> <span class="dt">colors =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="st">"#f3f3f3"</span>, <span class="st">"transparent"</span>),</a>
|
||||
<a class="sourceLine" id="cb5-12" title="12"> <span class="dt">opacity =</span> <span class="fl">0.5</span></a>
|
||||
<a class="sourceLine" id="cb5-13" title="13"> )</a>
|
||||
<a class="sourceLine" id="cb5-14" title="14"> ),</a>
|
||||
<a class="sourceLine" id="cb5-15" title="15"> <span class="dt">dataLabels =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-16" title="16"> <span class="dt">enabled =</span> <span class="ot">TRUE</span></a>
|
||||
<a class="sourceLine" id="cb5-17" title="17"> ),</a>
|
||||
<a class="sourceLine" id="cb5-18" title="18"> <span class="dt">markers =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">style =</span> <span class="st">"inverted"</span>, <span class="dt">size =</span> <span class="dv">6</span>),</a>
|
||||
<a class="sourceLine" id="cb5-19" title="19"> <span class="dt">series =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-20" title="20"> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-21" title="21"> <span class="dt">name =</span> <span class="st">"High"</span>,</a>
|
||||
<a class="sourceLine" id="cb5-22" title="22"> <span class="dt">data =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">28</span>, <span class="dv">29</span>, <span class="dv">33</span>, <span class="dv">36</span>, <span class="dv">32</span>, <span class="dv">32</span>, <span class="dv">33</span>)</a>
|
||||
<a class="sourceLine" id="cb5-23" title="23"> ),</a>
|
||||
<a class="sourceLine" id="cb5-24" title="24"> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-25" title="25"> <span class="dt">name =</span> <span class="st">"Low"</span>,</a>
|
||||
<a class="sourceLine" id="cb5-26" title="26"> <span class="dt">data =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/c">c</a></span>(<span class="dv">12</span>, <span class="dv">11</span>, <span class="dv">14</span>, <span class="dv">18</span>, <span class="dv">17</span>, <span class="dv">13</span>, <span class="dv">13</span>)</a>
|
||||
<a class="sourceLine" id="cb5-27" title="27"> )</a>
|
||||
<a class="sourceLine" id="cb5-28" title="28"> ),</a>
|
||||
<a class="sourceLine" id="cb5-29" title="29"> <span class="dt">title =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-30" title="30"> <span class="dt">text =</span> <span class="st">"Average High & Low Temperature"</span>,</a>
|
||||
<a class="sourceLine" id="cb5-31" title="31"> <span class="dt">align =</span> <span class="st">"left"</span></a>
|
||||
<a class="sourceLine" id="cb5-32" title="32"> ),</a>
|
||||
<a class="sourceLine" id="cb5-33" title="33"> <span class="dt">xaxis =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-34" title="34"> <span class="dt">categories =</span> month.abb[<span class="dv">1</span><span class="op">:</span><span class="dv">7</span>]</a>
|
||||
<a class="sourceLine" id="cb5-35" title="35"> ),</a>
|
||||
<a class="sourceLine" id="cb5-36" title="36"> <span class="dt">yaxis =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-37" title="37"> <span class="dt">title =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(<span class="dt">text =</span> <span class="st">"Temperature"</span>),</a>
|
||||
<a class="sourceLine" id="cb5-38" title="38"> <span class="dt">labels =</span> <span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/list">list</a></span>(</a>
|
||||
<a class="sourceLine" id="cb5-39" title="39"> <span class="dt">formatter =</span> htmlwidgets<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/htmlwidgets/topics/JS">JS</a></span>(<span class="st">"function(value) {return value + '°C';}"</span>)</a>
|
||||
<a class="sourceLine" id="cb5-40" title="40"> )</a>
|
||||
<a class="sourceLine" id="cb5-41" title="41"> )</a>
|
||||
<a class="sourceLine" id="cb5-42" title="42">))</a></code></pre></div>
|
||||
<p><img src="img/raw-lines.png" alt="alt text"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<div class="links">
|
||||
<h2>Links</h2>
|
||||
<ul class="list-unstyled">
|
||||
<li>Browse source code at <br><a href="https://github.com/dreamRs/apexcharter">https://github.com/dreamRs/apexcharter</a>
|
||||
</li>
|
||||
<li>Report a bug at <br><a href="https://github.com/dreamRs/apexcharter/issues">https://github.com/dreamRs/apexcharter/issues</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="license">
|
||||
<h2>License</h2>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<a href="https://opensource.org/licenses/mit-license.php">MIT</a> + file <a href="LICENSE-text.html">LICENSE</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="developers">
|
||||
<h2>Developers</h2>
|
||||
<ul class="list-unstyled">
|
||||
<li>
|
||||
<a href="https://twitter.com/_pvictorr"><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"> Victor Perrier</a> <br><small class="roles"> Author, maintainer </small> </li>
|
||||
<li>
|
||||
<a href="https://twitter.com/_mfaan"><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg"> Fanny Meyer</a> <br><small class="roles"> Author </small> </li>
|
||||
<li><a href="authors.html">All authors...</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer><div class="copyright">
|
||||
<p>Developed by <a href="https://twitter.com/_pvictorr"><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"> Victor Perrier</a>, <a href="https://twitter.com/_mfaan"><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg"> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{fill:#75AADB;}
|
||||
</style>
|
||||
<path class="st0" d="M4,11.3h1.3v1.3H4c-2,0-4-2.3-4-4.7s2.1-4.7,4-4.7h5.3c1.9,0,4,2.3,4,4.7c0,1.9-1.2,3.6-2.7,4.3v-1.5
|
||||
C11.4,10.2,12,9.1,12,8c0-1.7-1.4-3.3-2.7-3.3H4C2.7,4.7,1.3,6.3,1.3,8S2.7,11.3,4,11.3z M16,7.3h-1.3v1.3H16c1.3,0,2.7,1.6,2.7,3.3
|
||||
s-1.4,3.3-2.7,3.3h-5.3C9.4,15.3,8,13.7,8,12c0-1.1,0.6-2.2,1.3-2.8V7.7C7.9,8.4,6.7,10.1,6.7,12c0,2.4,2.1,4.7,4,4.7H16
|
||||
c1.9,0,4-2.3,4-4.7S18,7.3,16,7.3z"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 810 B |
236
docs/pkgdown.css
236
docs/pkgdown.css
|
@ -1,236 +0,0 @@
|
|||
/* Sticky footer */
|
||||
|
||||
/**
|
||||
* Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
|
||||
* Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css
|
||||
*
|
||||
* .Site -> body > .container
|
||||
* .Site-content -> body > .container .row
|
||||
* .footer -> footer
|
||||
*
|
||||
* Key idea seems to be to ensure that .container and __all its parents__
|
||||
* have height set to 100%
|
||||
*
|
||||
*/
|
||||
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body > .container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
body > .container .row {
|
||||
flex: 1 0 auto;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 45px;
|
||||
padding: 35px 0 36px;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
color: #666;
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
footer p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
footer div {
|
||||
flex: 1;
|
||||
}
|
||||
footer .pkgdown {
|
||||
text-align: right;
|
||||
}
|
||||
footer p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
img.icon {
|
||||
float: right;
|
||||
}
|
||||
|
||||
img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Fix bug in bootstrap (only seen in firefox) */
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Typographic tweaking ---------------------------------*/
|
||||
|
||||
.contents .page-header {
|
||||
margin-top: calc(-60px + 1em);
|
||||
}
|
||||
|
||||
/* Section anchors ---------------------------------*/
|
||||
|
||||
a.anchor {
|
||||
margin-left: -30px;
|
||||
display:inline-block;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
visibility: hidden;
|
||||
|
||||
background-image: url(./link.svg);
|
||||
background-repeat: no-repeat;
|
||||
background-size: 20px 20px;
|
||||
background-position: center center;
|
||||
}
|
||||
|
||||
.hasAnchor:hover a.anchor {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.hasAnchor:hover a.anchor {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Fixes for fixed navbar --------------------------*/
|
||||
|
||||
.contents h1, .contents h2, .contents h3, .contents h4 {
|
||||
padding-top: 60px;
|
||||
margin-top: -40px;
|
||||
}
|
||||
|
||||
/* Static header placement on mobile devices */
|
||||
@media (max-width: 767px) {
|
||||
.navbar-fixed-top {
|
||||
position: absolute;
|
||||
}
|
||||
.navbar {
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Sidebar --------------------------*/
|
||||
|
||||
#sidebar {
|
||||
margin-top: 30px;
|
||||
}
|
||||
#sidebar h2 {
|
||||
font-size: 1.5em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
#sidebar h2:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#sidebar .list-unstyled li {
|
||||
margin-bottom: 0.5em;
|
||||
}
|
||||
|
||||
.orcid {
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Reference index & topics ----------------------------------------------- */
|
||||
|
||||
.ref-index th {font-weight: normal;}
|
||||
|
||||
.ref-index td {vertical-align: top;}
|
||||
.ref-index .icon {width: 40px;}
|
||||
.ref-index .alias {width: 40%;}
|
||||
.ref-index-icons .alias {width: calc(40% - 40px);}
|
||||
.ref-index .title {width: 60%;}
|
||||
|
||||
.ref-arguments th {text-align: right; padding-right: 10px;}
|
||||
.ref-arguments th, .ref-arguments td {vertical-align: top;}
|
||||
.ref-arguments .name {width: 20%;}
|
||||
.ref-arguments .desc {width: 80%;}
|
||||
|
||||
/* Nice scrolling for wide elements --------------------------------------- */
|
||||
|
||||
table {
|
||||
display: block;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/* Syntax highlighting ---------------------------------------------------- */
|
||||
|
||||
pre {
|
||||
word-wrap: normal;
|
||||
word-break: normal;
|
||||
border: 1px solid #eee;
|
||||
}
|
||||
|
||||
pre, code {
|
||||
background-color: #f8f8f8;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
pre code {
|
||||
overflow: auto;
|
||||
word-wrap: normal;
|
||||
white-space: pre;
|
||||
}
|
||||
|
||||
pre .img {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
pre .img img {
|
||||
background-color: #fff;
|
||||
display: block;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
code a, pre a {
|
||||
color: #375f84;
|
||||
}
|
||||
|
||||
a.sourceLine:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.fl {color: #1514b5;}
|
||||
.fu {color: #000000;} /* function */
|
||||
.ch,.st {color: #036a07;} /* string */
|
||||
.kw {color: #264D66;} /* keyword */
|
||||
.co {color: #888888;} /* comment */
|
||||
|
||||
.message { color: black; font-weight: bolder;}
|
||||
.error { color: orange; font-weight: bolder;}
|
||||
.warning { color: #6A0366; font-weight: bolder;}
|
||||
|
||||
/* Clipboard --------------------------*/
|
||||
|
||||
.hasCopyButton {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.btn-copy-ex {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.hasCopyButton:hover button.btn-copy-ex {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* mark.js ----------------------------*/
|
||||
|
||||
mark {
|
||||
background-color: rgba(255, 255, 51, 0.5);
|
||||
border-bottom: 2px solid rgba(255, 153, 51, 0.3);
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
/* vertical spacing after htmlwidgets */
|
||||
.html-widget {
|
||||
margin-bottom: 10px;
|
||||
}
|
115
docs/pkgdown.js
115
docs/pkgdown.js
|
@ -1,115 +0,0 @@
|
|||
/* http://gregfranko.com/blog/jquery-best-practices/ */
|
||||
(function($) {
|
||||
$(function() {
|
||||
|
||||
$("#sidebar")
|
||||
.stick_in_parent({offset_top: 40})
|
||||
.on('sticky_kit:bottom', function(e) {
|
||||
$(this).parent().css('position', 'static');
|
||||
})
|
||||
.on('sticky_kit:unbottom', function(e) {
|
||||
$(this).parent().css('position', 'relative');
|
||||
});
|
||||
|
||||
$('body').scrollspy({
|
||||
target: '#sidebar',
|
||||
offset: 60
|
||||
});
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
|
||||
var cur_path = paths(location.pathname);
|
||||
var links = $("#navbar ul li a");
|
||||
var max_length = -1;
|
||||
var pos = -1;
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
if (links[i].getAttribute("href") === "#")
|
||||
continue;
|
||||
// Ignore external links
|
||||
if (links[i].host !== location.host)
|
||||
continue;
|
||||
|
||||
var nav_path = paths(links[i].pathname);
|
||||
|
||||
var length = prefix_length(nav_path, cur_path);
|
||||
if (length > max_length) {
|
||||
max_length = length;
|
||||
pos = i;
|
||||
}
|
||||
}
|
||||
|
||||
// Add class to parent <li>, and enclosing <li> if in dropdown
|
||||
if (pos >= 0) {
|
||||
var menu_anchor = $(links[pos]);
|
||||
menu_anchor.parent().addClass("active");
|
||||
menu_anchor.closest("li.dropdown").addClass("active");
|
||||
}
|
||||
});
|
||||
|
||||
function paths(pathname) {
|
||||
var pieces = pathname.split("/");
|
||||
pieces.shift(); // always starts with /
|
||||
|
||||
var end = pieces[pieces.length - 1];
|
||||
if (end === "index.html" || end === "")
|
||||
pieces.pop();
|
||||
return(pieces);
|
||||
}
|
||||
|
||||
// Returns -1 if not found
|
||||
function prefix_length(needle, haystack) {
|
||||
if (needle.length > haystack.length)
|
||||
return(-1);
|
||||
|
||||
// Special case for length-0 haystack, since for loop won't run
|
||||
if (haystack.length === 0) {
|
||||
return(needle.length === 0 ? 0 : -1);
|
||||
}
|
||||
|
||||
for (var i = 0; i < haystack.length; i++) {
|
||||
if (needle[i] != haystack[i])
|
||||
return(i);
|
||||
}
|
||||
|
||||
return(haystack.length);
|
||||
}
|
||||
|
||||
/* Clipboard --------------------------*/
|
||||
|
||||
function changeTooltipMessage(element, msg) {
|
||||
var tooltipOriginalTitle=element.getAttribute('data-original-title');
|
||||
element.setAttribute('data-original-title', msg);
|
||||
$(element).tooltip('show');
|
||||
element.setAttribute('data-original-title', tooltipOriginalTitle);
|
||||
}
|
||||
|
||||
if(ClipboardJS.isSupported()) {
|
||||
$(document).ready(function() {
|
||||
var copyButton = "<button type='button' class='btn btn-primary btn-copy-ex' type = 'submit' title='Copy to clipboard' aria-label='Copy to clipboard' data-toggle='tooltip' data-placement='left auto' data-trigger='hover' data-clipboard-copy><i class='fa fa-copy'></i></button>";
|
||||
|
||||
$(".examples, div.sourceCode").addClass("hasCopyButton");
|
||||
|
||||
// Insert copy buttons:
|
||||
$(copyButton).prependTo(".hasCopyButton");
|
||||
|
||||
// Initialize tooltips:
|
||||
$('.btn-copy-ex').tooltip({container: 'body'});
|
||||
|
||||
// Initialize clipboard:
|
||||
var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', {
|
||||
text: function(trigger) {
|
||||
return trigger.parentNode.textContent;
|
||||
}
|
||||
});
|
||||
|
||||
clipboardBtnCopies.on('success', function(e) {
|
||||
changeTooltipMessage(e.trigger, 'Copied!');
|
||||
e.clearSelection();
|
||||
});
|
||||
|
||||
clipboardBtnCopies.on('error', function() {
|
||||
changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy');
|
||||
});
|
||||
});
|
||||
}
|
||||
})(window.jQuery || window.$)
|
|
@ -1,6 +0,0 @@
|
|||
pandoc: '2.6'
|
||||
pkgdown: 1.3.0
|
||||
pkgdown_sha: ~
|
||||
articles:
|
||||
starting-with-apexcharts: starting-with-apexcharts.html
|
||||
|
|
@ -1,192 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Quick Apex Chart — apex • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Quick Apex Chart — apex" />
|
||||
|
||||
<meta property="og:description" content="Quick Apex Chart" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Quick Apex Chart</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex.R'><code>R/apex.R</code></a></small>
|
||||
<div class="hidden name"><code>apex.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Quick Apex Chart</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>apex</span>(<span class='no'>data</span>, <span class='no'>mapping</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"column"</span>, <span class='no'>...</span>, <span class='kw'>auto_update</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>,
|
||||
<span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>height</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>elementId</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>data</th>
|
||||
<td><p>Default dataset to use for chart. If not already a <code>data.frame</code>, it will be coerced to with <code>as.data.frame</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>mapping</th>
|
||||
<td><p>Default list of aesthetic mappings to use for chart</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
<td><p>Specify the chart type. Available Options: <code>"column"</code>, <code>"bar"</code>, <code>"line"</code>,
|
||||
<code>"area"</code>, <code>"spline"</code>, <code>"pie"</code>, <code>"donut"</code>, <code>"radialBar"</code>, <code>"radar"</code>, <code>"scatter"</code>, <code>"heatmap"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Other arguments passed on to methods. Not currently used.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>auto_update</th>
|
||||
<td><p>In Shiny application, update existing chart rather than generating new one.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>width</th>
|
||||
<td><p>A numeric input in pixels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>height</th>
|
||||
<td><p>A numeric input in pixels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>elementId</th>
|
||||
<td><p>Use an explicit element ID for the widget.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,199 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Create a apexcharts.js widget — apexchart • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Create a apexcharts.js widget — apexchart" />
|
||||
|
||||
<meta property="og:description" content="Create a apexcharts.js widget" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Create a apexcharts.js widget</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apexcharter.R'><code>R/apexcharter.R</code></a></small>
|
||||
<div class="hidden name"><code>apexchart.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Create a apexcharts.js widget</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>apexchart</span>(<span class='kw'>ax_opts</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(), <span class='kw'>auto_update</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>, <span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>height</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>elementId</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax_opts</th>
|
||||
<td><p>A <code>list</code> in JSON format with chart parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>auto_update</th>
|
||||
<td><p>In Shiny application, update existing chart rather than generating new one.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>width</th>
|
||||
<td><p>A numeric input in pixels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>height</th>
|
||||
<td><p>A numeric input in pixels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>elementId</th>
|
||||
<td><p>Use an explicit element ID for the widget.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><div class='input'>
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/library'>library</a></span>(<span class='no'>apexcharter</span>)
|
||||
|
||||
<span class='fu'>apexchart</span>(<span class='kw'>ax_opts</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(
|
||||
<span class='kw'>chart</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(<span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"bar"</span>),
|
||||
<span class='kw'>series</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(
|
||||
<span class='kw'>name</span> <span class='kw'>=</span> <span class='st'>"Example"</span>,
|
||||
<span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/sample'>sample</a></span>(<span class='fl'>1</span>:<span class='fl'>100</span>, <span class='fl'>5</span>)
|
||||
)),
|
||||
<span class='kw'>xaxis</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(<span class='kw'>categories</span> <span class='kw'>=</span> <span class='no'>LETTERS</span>[<span class='fl'>1</span>:<span class='fl'>5</span>])
|
||||
))</div></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,169 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Proxy for <code>apexchart</code> — apexchartProxy • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Proxy for <code>apexchart</code> — apexchartProxy" />
|
||||
|
||||
<meta property="og:description" content="Allow to update a chart in Shiny application." />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Proxy for <code>apexchart</code></h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/proxy.R'><code>R/proxy.R</code></a></small>
|
||||
<div class="hidden name"><code>apexchartProxy.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Allow to update a chart in Shiny application.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>apexchartProxy</span>(<span class='no'>shinyId</span>, <span class='kw'>session</span> <span class='kw'>=</span> <span class='kw pkg'>shiny</span><span class='kw ns'>::</span><span class='fu'><a href='https://www.rdocumentation.org/packages/shiny/topics/domains'>getDefaultReactiveDomain</a></span>())</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>shinyId</th>
|
||||
<td><p>single-element character vector indicating the output ID of the
|
||||
chart to modify (if invoked from a Shiny module, the namespace will be added
|
||||
automatically)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>session</th>
|
||||
<td><p>the Shiny session object to which the chart belongs; usually the
|
||||
default value will suffice</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,155 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>apexcharter exported operators and S3 methods — apexcharter-exports • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="apexcharter exported operators and S3 methods — apexcharter-exports" />
|
||||
|
||||
<meta property="og:description" content="The following functions are imported and then re-exported
|
||||
from the apexcharter package to avoid listing the magrittr
|
||||
as Depends of apexcharter" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>apexcharter exported operators and S3 methods</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apexcharter-package.R'><code>R/apexcharter-package.R</code></a></small>
|
||||
<div class="hidden name"><code>apexcharter-exports.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>The following functions are imported and then re-exported
|
||||
from the apexcharter package to avoid listing the magrittr
|
||||
as Depends of apexcharter</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>An <code>htmlwidget</code> interface to the
|
||||
ApexCharts javascript chart library — apexcharter-package • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="An <code>htmlwidget</code> interface to the
|
||||
ApexCharts javascript chart library — apexcharter-package" />
|
||||
|
||||
<meta property="og:description" content="This package allow you to use ApexCharts.js (https://apexcharts.com/),
|
||||
to create interactive and modern SVG charts." />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>An <code>htmlwidget</code> interface to the
|
||||
ApexCharts javascript chart library</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apexcharter-package.R'><code>R/apexcharter-package.R</code></a></small>
|
||||
<div class="hidden name"><code>apexcharter-package.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>This package allow you to use ApexCharts.js (<a href='https://apexcharts.com/'>https://apexcharts.com/</a>),
|
||||
to create interactive and modern SVG charts.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
</ul>
|
||||
|
||||
<h2>Author</h2>
|
||||
<p>Victor Perrier (@dreamRs_fr)</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Shiny bindings for apexcharter — apexcharter-shiny • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Shiny bindings for apexcharter — apexcharter-shiny" />
|
||||
|
||||
<meta property="og:description" content="Output and render functions for using apexcharter within Shiny
|
||||
applications and interactive Rmd documents." />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Shiny bindings for apexcharter</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apexcharter.R'><code>R/apexcharter.R</code></a></small>
|
||||
<div class="hidden name"><code>apexcharter-shiny.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Output and render functions for using apexcharter within Shiny
|
||||
applications and interactive Rmd documents.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>apexchartOutput</span>(<span class='no'>outputId</span>, <span class='kw'>width</span> <span class='kw'>=</span> <span class='st'>"100%"</span>, <span class='kw'>height</span> <span class='kw'>=</span> <span class='st'>"400px"</span>)
|
||||
|
||||
<span class='fu'>renderApexchart</span>(<span class='no'>expr</span>, <span class='kw'>env</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/sys.parent'>parent.frame</a></span>(), <span class='kw'>quoted</span> <span class='kw'>=</span> <span class='fl'>FALSE</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>outputId</th>
|
||||
<td><p>output variable to read from</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>width, height</th>
|
||||
<td><p>Must be a valid CSS unit (like <code>'100%'</code>,
|
||||
<code>'400px'</code>, <code>'auto'</code>) or a number, which will be coerced to a
|
||||
string and have <code>'px'</code> appended.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>expr</th>
|
||||
<td><p>An expression that generates a apexcharter</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>env</th>
|
||||
<td><p>The environment in which to evaluate <code>expr</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>quoted</th>
|
||||
<td><p>Is <code>expr</code> a quoted expression (with <code><a href='https://www.rdocumentation.org/packages/base/topics/substitute'>quote()</a></code>)? This
|
||||
is useful if you want to save an expression in a variable.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,201 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Add data to a chart — ax-series • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Add data to a chart — ax-series" />
|
||||
|
||||
<meta property="og:description" content="Add data to a chart" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Add data to a chart</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax-series.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Add data to a chart</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_series</span>(<span class='no'>ax</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ax_series2</span>(<span class='no'>ax</span>, <span class='no'>l</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Lists containing data to plot, typically list with two items: <code>name</code> and <code>data</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>l</th>
|
||||
<td><p>A list.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><div class='input'>
|
||||
<span class='co'># One serie</span>
|
||||
<span class='fu'><a href='apexchart.html'>apexchart</a></span>() <span class='kw'>%>%</span>
|
||||
<span class='fu'>ax_series</span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(
|
||||
<span class='kw'>name</span> <span class='kw'>=</span> <span class='st'>"rnorm"</span>,
|
||||
<span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/Normal'>rnorm</a></span>(<span class='fl'>10</span>)
|
||||
))
|
||||
|
||||
<span class='co'># Two series</span>
|
||||
<span class='fu'><a href='apexchart.html'>apexchart</a></span>() <span class='kw'>%>%</span>
|
||||
<span class='fu'>ax_series</span>(
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(
|
||||
<span class='kw'>name</span> <span class='kw'>=</span> <span class='st'>"rnorm 1"</span>,
|
||||
<span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/Normal'>rnorm</a></span>(<span class='fl'>10</span>)
|
||||
),
|
||||
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/list'>list</a></span>(
|
||||
<span class='kw'>name</span> <span class='kw'>=</span> <span class='st'>"rnorm 2"</span>,
|
||||
<span class='kw'>data</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/Normal'>rnorm</a></span>(<span class='fl'>10</span>)
|
||||
)
|
||||
)</div></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,195 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Annotations properties — ax_annotations • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Annotations properties — ax_annotations" />
|
||||
|
||||
<meta property="og:description" content="Annotations properties" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Annotations properties</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_annotations.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Annotations properties</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_annotations</span>(<span class='no'>ax</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>yaxis</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>xaxis</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>points</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>position</th>
|
||||
<td><p>Whether to put the annotations behind the charts or in front of it. Available Options: <code>"front"</code> or <code>"back"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>yaxis</th>
|
||||
<td><p>List of lists.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>xaxis</th>
|
||||
<td><p>List of lists.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>points</th>
|
||||
<td><p>List of lists.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/annotations/'>https://apexcharts.com/docs/options/annotations/</a>.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,241 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Chart parameters — ax_chart • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Chart parameters — ax_chart" />
|
||||
|
||||
<meta property="og:description" content="Chart parameters" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Chart parameters</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_chart.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Chart parameters</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_chart</span>(<span class='no'>ax</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>stacked</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>stackType</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>animations</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>background</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>foreColor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>dropShadow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>events</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>selection</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>sparkline</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>toolbar</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>zoom</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>height</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
<td><p>Specify the chart type. Available Options: <code>"bar"</code>, <code>"column"</code>, <code>"line"</code>,
|
||||
<code>"pie"</code>, <code>"donut"</code>, <code>"radialBar"</code>, <code>"scatter"</code>, <code>"bubble"</code>, <code>"heatmap"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>stacked</th>
|
||||
<td><p>Logical. Enables stacked option for axis charts.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>stackType</th>
|
||||
<td><p>When stacked, should the stacking be percentage based or normal stacking. Available options: <code>"normal"</code> or <code>"100%"</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>animations</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>background</th>
|
||||
<td><p>Background color for the chart area. If you want to set background with css, use <code>.apexcharts-canvas</code> to set it.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>foreColor</th>
|
||||
<td><p>Sets the text color for the chart. Defaults to <code>#373d3f</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>dropShadow</th>
|
||||
<td><p>A list of parameters. See <a href='https://apexcharts.com/docs/options/chart/dropshadow/'>https://apexcharts.com/docs/options/chart/dropshadow/</a>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>events</th>
|
||||
<td><p>See <code><a href='events_opts.html'>events_opts</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Sets the left offset for chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Sets the top offset for chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>selection</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>sparkline</th>
|
||||
<td><p>List. Sparkline hides all the elements of the charts other than the primary paths. Helps to visualize data in small areas. .</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>toolbar</th>
|
||||
<td><p>A list of parameters. See <a href='https://apexcharts.com/docs/options/chart/toolbar/'>https://apexcharts.com/docs/options/chart/toolbar/</a>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>zoom</th>
|
||||
<td><p>A list of parameters. See <a href='https://apexcharts.com/docs/options/chart/zoom/'>https://apexcharts.com/docs/options/chart/zoom/</a>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>width</th>
|
||||
<td><p>Width of the chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>height</th>
|
||||
<td><p>Height of the chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Colors — ax_colors • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Colors — ax_colors" />
|
||||
|
||||
<meta property="og:description" content="Colors" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Colors</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_colors.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Colors</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_colors</span>(<span class='no'>ax</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Colors for the chart’s series. When all colors are used, it starts from the beginning.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/colors/'>https://apexcharts.com/docs/options/colors/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,209 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Labels on data — ax_dataLabels • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Labels on data — ax_dataLabels" />
|
||||
|
||||
<meta property="og:description" content="Labels on data" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Labels on data</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_dataLabels.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Labels on data</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_dataLabels</span>(<span class='no'>ax</span>, <span class='kw'>enabled</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>textAnchor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>style</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>dropShadow</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>formatter</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>enabled</th>
|
||||
<td><p>To determine whether to show dataLabels or not.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>textAnchor</th>
|
||||
<td><p>The alignment of text relative to dataLabel’s drawing position.
|
||||
Accepted values <code>"start"</code>, <code>"middle"</code> or <code>"end"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Sets the left offset for dataLabels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Sets the top offset for dataLabels.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>style</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>dropShadow</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>formatter</th>
|
||||
<td><p>The formatter function takes in a single value and allows you to format the value before displaying</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/datalabels/'>https://apexcharts.com/docs/options/datalabels/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,204 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Fill property — ax_fill • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Fill property — ax_fill" />
|
||||
|
||||
<meta property="og:description" content="Fill property" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Fill property</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_fill.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Fill property</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_fill</span>(<span class='no'>ax</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>colors</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>opacity</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>gradient</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>image</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>pattern</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>type</th>
|
||||
<td><p>Whether to fill the paths with solid colors or gradient.
|
||||
Available options: <code>"solid"</code>, <code>"gradient"</code>, <code>"pattern"</code> or <code>"image"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>colors</th>
|
||||
<td><p>Colors to fill the svg paths..</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>opacity</th>
|
||||
<td><p>Opacity of the fill attribute.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>gradient</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>image</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>pattern</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/fill/'>https://apexcharts.com/docs/options/fill/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,216 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Add grids on chart — ax_grid • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Add grids on chart — ax_grid" />
|
||||
|
||||
<meta property="og:description" content="Add grids on chart" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Add grids on chart</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_grid.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Add grids on chart</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_grid</span>(<span class='no'>ax</span>, <span class='kw'>show</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>borderColor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>strokeDashArray</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>xaxis</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>yaxis</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>row</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>column</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>padding</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>show</th>
|
||||
<td><p>Logical. To show or hide grid area (including xaxis / yaxis)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>borderColor</th>
|
||||
<td><p>Colors of grid borders / lines.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>strokeDashArray</th>
|
||||
<td><p>Creates dashes in borders of svg path. Higher number creates more space between dashes in the border.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>position</th>
|
||||
<td><p>Whether to place grid behind chart paths of in front. Available options for position: <code>"front"</code> or <code>"back"</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>xaxis</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>yaxis</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>row</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>column</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>padding</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/grid/'>https://apexcharts.com/docs/options/grid/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Alternative axis labels — ax_labels • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Alternative axis labels — ax_labels" />
|
||||
|
||||
<meta property="og:description" content="Alternative axis labels" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Alternative axis labels</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_labels.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Alternative axis labels</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_labels</span>(<span class='no'>ax</span>, <span class='no'>...</span>)
|
||||
|
||||
<span class='fu'>ax_labels2</span>(<span class='no'>ax</span>, <span class='no'>labels</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Vector. In Axis Charts (line / column), labels can be set instead of setting xaxis categories
|
||||
option. While, in pie/donut charts, each label corresponds to value in series array.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>labels</th>
|
||||
<td><p>A vector to use as labels.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/labels/'>https://apexcharts.com/docs/options/labels/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,194 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Modify axis, legend, and chart labels — ax_labs • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Modify axis, legend, and chart labels — ax_labs" />
|
||||
|
||||
<meta property="og:description" content="Modify axis, legend, and chart labels" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Modify axis, legend, and chart labels</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/labs.R'><code>R/labs.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_labs.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Modify axis, legend, and chart labels</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_labs</span>(<span class='no'>ax</span>, <span class='kw'>title</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>subtitle</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>x</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='kw'>NULL</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>title</th>
|
||||
<td><p>Text for the title.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>subtitle</th>
|
||||
<td><p>Text for the subtitle.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>Text for the x-axis label.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>y</th>
|
||||
<td><p>Text for the y-axis label.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><div class='input'><span class='no'>meteo_paris</span> <span class='kw'><-</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/data.frame'>data.frame</a></span>(
|
||||
<span class='kw'>month</span> <span class='kw'>=</span> <span class='no'>month.name</span>,
|
||||
<span class='kw'>tmax</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>7</span>, <span class='fl'>8</span>, <span class='fl'>12</span>, <span class='fl'>15</span>, <span class='fl'>19</span>, <span class='fl'>23</span>, <span class='fl'>25</span>, <span class='fl'>25</span>, <span class='fl'>21</span>, <span class='fl'>16</span>, <span class='fl'>11</span>, <span class='fl'>8</span>),
|
||||
<span class='kw'>tmin</span> <span class='kw'>=</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/c'>c</a></span>(<span class='fl'>3</span>, <span class='fl'>3</span>, <span class='fl'>5</span>, <span class='fl'>7</span>, <span class='fl'>11</span>, <span class='fl'>14</span>, <span class='fl'>16</span>, <span class='fl'>16</span>, <span class='fl'>13</span>, <span class='fl'>10</span>, <span class='fl'>6</span>, <span class='fl'>3</span>)
|
||||
)
|
||||
|
||||
<span class='fu'><a href='apex.html'>apex</a></span>(<span class='no'>meteo_paris</span>, <span class='kw'>type</span> <span class='kw'>=</span> <span class='st'>"column"</span>, <span class='fu'><a href='apexcharter-exports.html'>aes</a></span>(<span class='kw'>x</span> <span class='kw'>=</span> <span class='no'>month</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='no'>tmin</span>)) <span class='kw'>%>%</span>
|
||||
<span class='fu'>ax_labs</span>(
|
||||
<span class='kw'>title</span> <span class='kw'>=</span> <span class='st'>"Average minimal temperature in Paris"</span>,
|
||||
<span class='kw'>subtitle</span> <span class='kw'>=</span> <span class='st'>"Data from NOAA"</span>,
|
||||
<span class='kw'>x</span> <span class='kw'>=</span> <span class='st'>"Month"</span>,
|
||||
<span class='kw'>y</span> <span class='kw'>=</span> <span class='st'>"Temperature (°C)"</span>
|
||||
)</div></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,251 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Legend properties — ax_legend • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Legend properties — ax_legend" />
|
||||
|
||||
<meta property="og:description" content="Legend properties" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Legend properties</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_legend.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Legend properties</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_legend</span>(<span class='no'>ax</span>, <span class='kw'>show</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>position</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>horizontalAlign</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>verticalAlign</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>fontSize</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>textAnchor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>formatter</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>labels</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>markers</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>itemMargin</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>containerMargin</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>onItemClick</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>onItemHover</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>floating</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>show</th>
|
||||
<td><p>Logical. Whether to show or hide the legend container.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>position</th>
|
||||
<td><p>Available position options for legend: <code>"top"</code>, <code>"right"</code>, <code>"bottom"</code>, <code>"left"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>horizontalAlign</th>
|
||||
<td><p>Available options for horizontal alignment: <code>"right"</code>, <code>"center"</code>, <code>"left"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>verticalAlign</th>
|
||||
<td><p>Available options for vertical alignment: <code>"top"</code>, <code>"middle"</code>, <code>"bottom"</code></p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fontSize</th>
|
||||
<td><p>Sets the fontSize of legend text elements</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>textAnchor</th>
|
||||
<td><p>The alignment of text relative to legend’s drawing position</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Sets the top offset for legend container.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Sets the left offset for legend container.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>formatter</th>
|
||||
<td><p>JS function. A custom formatter function to append additional text to the legend series names.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>labels</th>
|
||||
<td><p>List with two items <code>"foreColor"</code> (Custom text color for legend labels)
|
||||
and <code>"useSeriesColors"</code> (Logical, whether to use primary colors or not)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>markers</th>
|
||||
<td><p>List.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>itemMargin</th>
|
||||
<td><p>List with two items <code>"horizontal"</code> (Horizontal margin for individual legend item)
|
||||
and <code>"vertical"</code> (Vertical margin for individual legend item).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>containerMargin</th>
|
||||
<td><p>List with two items <code>"top"</code> (Top margin for the whole legend container)
|
||||
and <code>"left"</code> (Left margin for the whole legend container).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>onItemClick</th>
|
||||
<td><p>List with item <code>"toggleDataSeries"</code>, logical,
|
||||
when clicked on legend item, it will toggle the visibility of the series in chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>onItemHover</th>
|
||||
<td><p>List with item <code>"highlightDataSeries"</code>, logical,
|
||||
when hovered on legend item, it will highlight the paths of the hovered series in chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>floating</th>
|
||||
<td><p>Logical. The floating option will take out the legend from the chart area and make it float above the chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/legend/'>https://apexcharts.com/docs/options/legend/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,225 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Markers properties — ax_markers • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Markers properties — ax_markers" />
|
||||
|
||||
<meta property="og:description" content="Markers properties" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Markers properties</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_markers.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Markers properties</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_markers</span>(<span class='no'>ax</span>, <span class='kw'>size</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>colors</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>strokeColor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>strokeWidth</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>strokeOpacity</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>fillOpacity</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>shape</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>radius</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>hover</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>size</th>
|
||||
<td><p>Numeric. Size of the marker point.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>colors</th>
|
||||
<td><p>Sets the fill color(s) of the marker point.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>strokeColor</th>
|
||||
<td><p>Stroke Color of the marker.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>strokeWidth</th>
|
||||
<td><p>Stroke Size of the marker.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>strokeOpacity</th>
|
||||
<td><p>Opacity of the border around marker.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fillOpacity</th>
|
||||
<td><p>Opacity of the marker fill color.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>shape</th>
|
||||
<td><p>Shape of the marker. Available Options for shape: <code>"square"</code> or <code>"circle"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>radius</th>
|
||||
<td><p>Numeric. Radius of the marker (applies to square shape)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Numeric. Sets the left offset of the marker.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Numeric. Sets the top offset of the marker.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>hover</th>
|
||||
<td><p>List with item <code>size</code> (Size of the marker when it is active).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/markers/'>https://apexcharts.com/docs/options/markers/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,189 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Specific options for chart — ax_plotOptions • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Specific options for chart — ax_plotOptions" />
|
||||
|
||||
<meta property="og:description" content="Specific options for chart" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Specific options for chart</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_plotOptions.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Specific options for chart</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_plotOptions</span>(<span class='no'>ax</span>, <span class='kw'>bar</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>heatmap</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>radialBar</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>pie</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>bar</th>
|
||||
<td><p>See <code><a href='bar_opts.html'>bar_opts</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>heatmap</th>
|
||||
<td><p>See <code><a href='heatmap_opts.html'>heatmap_opts</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>radialBar</th>
|
||||
<td><p>See <code><a href='radialBar_opts.html'>radialBar_opts</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>pie</th>
|
||||
<td><p>See <code><a href='pie_opts.html'>pie_opts</a></code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Proxy for updating series. — ax_proxy_series • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Proxy for updating series. — ax_proxy_series" />
|
||||
|
||||
<meta property="og:description" content="Allows you to update the series array overriding the existing one." />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Proxy for updating series.</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/proxy.R'><code>R/proxy.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_proxy_series.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Allows you to update the series array overriding the existing one.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_proxy_series</span>(<span class='no'>proxy</span>, <span class='no'>newSeries</span>, <span class='kw'>animate</span> <span class='kw'>=</span> <span class='fl'>TRUE</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>proxy</th>
|
||||
<td><p>A <code>apexchartProxy</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>newSeries</th>
|
||||
<td><p>The series array to override the existing one.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>animate</th>
|
||||
<td><p>Should the chart animate on re-rendering.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
|
||||
<pre class="examples"><span class='co'># NOT RUN {</span>
|
||||
<span class='kw'>if</span> (<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/interactive'>interactive</a></span>()) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
<span class='co'># }</span></pre>
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#examples">Examples</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,178 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Responsive options — ax_responsive • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Responsive options — ax_responsive" />
|
||||
|
||||
<meta property="og:description" content="Responsive options" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Responsive options</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_responsive.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Responsive options</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_responsive</span>(<span class='no'>ax</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/responsive/'>https://apexcharts.com/docs/options/responsive/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Charts' states — ax_states • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Charts' states — ax_states" />
|
||||
|
||||
<meta property="og:description" content="Charts' states" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Charts' states</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_states.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Charts' states</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_states</span>(<span class='no'>ax</span>, <span class='kw'>normal</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>hover</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>active</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>normal</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>hover</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>active</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/states/'>https://apexcharts.com/docs/options/states/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,208 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Stroke properties — ax_stroke • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Stroke properties — ax_stroke" />
|
||||
|
||||
<meta property="og:description" content="Stroke properties" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Stroke properties</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_stroke.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Stroke properties</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_stroke</span>(<span class='no'>ax</span>, <span class='kw'>show</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>curve</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>lineCap</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>width</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>colors</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>dashArray</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>show</th>
|
||||
<td><p>Logical. To show or hide path-stroke / line</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>curve</th>
|
||||
<td><p>In line / area charts, whether to draw smooth lines or straight lines.
|
||||
Available Options: <code>"smooth"</code> (connects the points in a curve fashion. Also known as spline)
|
||||
and <code>"straight"</code> (connect the points in straight lines.).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>lineCap</th>
|
||||
<td><p>For setting the starting and ending points of stroke. Available Options:
|
||||
<code>"butt"</code> (ends the stroke with a 90-degree angle), <code>"square"</code>
|
||||
(similar to butt except that it extends the stroke beyond the length of the path)
|
||||
and <code>"round"</code> (ends the path-stroke with a radius that smooths out the start and end points)</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>width</th>
|
||||
<td><p>Sets the width of border for svg path.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>colors</th>
|
||||
<td><p>Colors to fill the border for paths.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>dashArray</th>
|
||||
<td><p>Creates dashes in borders of svg path. Higher number creates more space between dashes in the border.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/stroke/'>https://apexcharts.com/docs/options/stroke/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,208 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Chart's subtitle — ax_subtitle • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Chart's subtitle — ax_subtitle" />
|
||||
|
||||
<meta property="og:description" content="Chart's subtitle" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Chart's subtitle</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_subtitle.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Chart's subtitle</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_subtitle</span>(<span class='no'>ax</span>, <span class='kw'>text</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>align</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>margin</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>floating</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>style</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>text</th>
|
||||
<td><p>Text to display as a subtitle of chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>align</th>
|
||||
<td><p>Alignment of subtitle relative to chart area. Possible Options: <code>"left"</code>, <code>"center"</code> and <code>"right"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>margin</th>
|
||||
<td><p>Numeric. Vertical spacing around the subtitle text.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Numeric. Sets the left offset for subtitle text.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Numeric. Sets the top offset for subtitle text</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>floating</th>
|
||||
<td><p>Logical. The floating option will take out the subtitle text from the chart area and make it float on top of the chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>style</th>
|
||||
<td><p>List with two items: <code>fontSize</code> (Font Size of the subtitle text) and <code>color</code> (Fore color of the subtitle text).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/subtitle/'>https://apexcharts.com/docs/options/subtitle/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Theme for charts — ax_theme • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Theme for charts — ax_theme" />
|
||||
|
||||
<meta property="og:description" content="Theme for charts" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Theme for charts</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_theme.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Theme for charts</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_theme</span>(<span class='no'>ax</span>, <span class='kw'>palette</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>monochrome</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>palette</th>
|
||||
<td><p>Character. Available palettes: <code>"palette1"</code> to <code>"palette10"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>monochrome</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/theme/'>https://apexcharts.com/docs/options/theme/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,208 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Chart's title — ax_title • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Chart's title — ax_title" />
|
||||
|
||||
<meta property="og:description" content="Chart's title" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Chart's title</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_title.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Chart's title</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_title</span>(<span class='no'>ax</span>, <span class='kw'>text</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>align</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>margin</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>offsetX</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>offsetY</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>floating</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>style</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>text</th>
|
||||
<td><p>Text to display as a title of chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>align</th>
|
||||
<td><p>Alignment of subtitle relative to chart area. Possible Options: <code>"left"</code>, <code>"center"</code> and <code>"right"</code>.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>margin</th>
|
||||
<td><p>Numeric. Vertical spacing around the title text.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetX</th>
|
||||
<td><p>Numeric. Sets the left offset for subtitle text.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>offsetY</th>
|
||||
<td><p>Numeric. Sets the top offset for subtitle text</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>floating</th>
|
||||
<td><p>Logical. The floating option will take out the subtitle text from the chart area and make it float on top of the chart.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>style</th>
|
||||
<td><p>List with two items: <code>fontSize</code> (Font Size of the title text) and <code>color</code> (Fore color of the title text).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/title/'>https://apexcharts.com/docs/options/title/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,242 +0,0 @@
|
|||
<!-- Generated by pkgdown: do not edit by hand -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<title>Tooltip options — ax_tooltip • apexcharter</title>
|
||||
|
||||
<!-- jquery -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/flatly/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Font Awesome icons -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
|
||||
|
||||
<!-- clipboard.js -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- sticky kit -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- pkgdown -->
|
||||
<link href="../pkgdown.css" rel="stylesheet">
|
||||
<script src="../pkgdown.js"></script>
|
||||
|
||||
|
||||
|
||||
<meta property="og:title" content="Tooltip options — ax_tooltip" />
|
||||
|
||||
<meta property="og:description" content="Tooltip options" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
|
||||
|
||||
|
||||
<!-- mathjax -->
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script>
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container template-reference-topic">
|
||||
<header>
|
||||
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<span class="navbar-brand">
|
||||
<a class="navbar-link" href="../index.html">apexcharter</a>
|
||||
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3.920</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="navbar" class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="../index.html">
|
||||
<span class="fa fa-home fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="../reference/index.html">Reference</a>
|
||||
</li>
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
|
||||
Articles
|
||||
|
||||
<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li>
|
||||
<a href="../articles/starting-with-apexcharts.html">Starting with ApexCharts</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="https://github.com/dreamRs/apexcharter">
|
||||
<span class="fa fa-github fa-lg"></span>
|
||||
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div><!--/.nav-collapse -->
|
||||
</div><!--/.container -->
|
||||
</div><!--/.navbar -->
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-9 contents">
|
||||
<div class="page-header">
|
||||
<h1>Tooltip options</h1>
|
||||
<small class="dont-index">Source: <a href='https://github.com/dreamRs/apexcharter/blob/master/R/apex-utils.R'><code>R/apex-utils.R</code></a></small>
|
||||
<div class="hidden name"><code>ax_tooltip.Rd</code></div>
|
||||
</div>
|
||||
|
||||
<div class="ref-description">
|
||||
|
||||
<p>Tooltip options</p>
|
||||
|
||||
</div>
|
||||
|
||||
<pre class="usage"><span class='fu'>ax_tooltip</span>(<span class='no'>ax</span>, <span class='kw'>enabled</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>shared</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>followCursor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>intersect</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>inverseOrder</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>custom</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>fillSeriesColor</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>onDatasetHover</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>theme</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>x</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>y</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>z</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>marker</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>items</span> <span class='kw'>=</span> <span class='kw'>NULL</span>,
|
||||
<span class='kw'>fixed</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='no'>...</span>)</pre>
|
||||
|
||||
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
|
||||
<table class="ref-arguments">
|
||||
<colgroup><col class="name" /><col class="desc" /></colgroup>
|
||||
<tr>
|
||||
<th>ax</th>
|
||||
<td><p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>enabled</th>
|
||||
<td><p>Logical. Show tooltip when user hovers over chart area.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>shared</th>
|
||||
<td><p>Logical. When having multiple series, show a shared tooltip.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>followCursor</th>
|
||||
<td><p>Logical. Follow user’s cursor position instead of putting tooltip on actual data points.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>intersect</th>
|
||||
<td><p>Logical. Show tooltip only when user hovers exactly over datapoint.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>inverseOrder</th>
|
||||
<td><p>Logical. In multiple series, when having shared tooltip, inverse the order of series (for better comparison in stacked charts).</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>custom</th>
|
||||
<td><p>JS function. Draw a custom html tooltip instead of the default one based on the values provided in the function arguments.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fillSeriesColor</th>
|
||||
<td><p>Logical. When enabled, fill the tooltip background with the corresponding series color.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>onDatasetHover</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>theme</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>x</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>y</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>z</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>marker</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>items</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>fixed</th>
|
||||
<td><p>A list of parameters.</p></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>...</th>
|
||||
<td><p>Additional parameters.</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h2 class="hasAnchor" id="value"><a class="anchor" href="#value"></a>Value</h2>
|
||||
|
||||
<p>A <code>apexcharts</code> <code>htmlwidget</code> object.</p>
|
||||
|
||||
<h2 class="hasAnchor" id="note"><a class="anchor" href="#note"></a>Note</h2>
|
||||
|
||||
<p>See <a href='https://apexcharts.com/docs/options/tooltip/'>https://apexcharts.com/docs/options/tooltip/</a></p>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
|
||||
<h2>Contents</h2>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><a href="#arguments">Arguments</a></li>
|
||||
|
||||
<li><a href="#value">Value</a></li>
|
||||
|
||||
<li><a href="#note">Note</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<div class="copyright">
|
||||
<p>Developed by <a href='https://twitter.com/_pvictorr'><img src="https://pbs.twimg.com/profile_images/844237339404722177/E1U61aM8_normal.jpg"/> Victor Perrier</a>, <a href='https://twitter.com/_mfaan'><img src="https://pbs.twimg.com/profile_images/912313931326218240/o1-wvA18_normal.jpg" /> Fanny Meyer</a>.</p>
|
||||
</div>
|
||||
|
||||
<div class="pkgdown">
|
||||
<p>Site built with <a href="https://pkgdown.r-lib.org/">pkgdown</a> 1.3.0.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue