Skip to content

Commit

Permalink
order
Browse files Browse the repository at this point in the history
  • Loading branch information
jbkunst committed Nov 13, 2016
1 parent fb71140 commit 3151f5d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 52 deletions.
51 changes: 2 additions & 49 deletions R/api-hc-extras.R
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ hc_drilldown <- function(hc, ...) {
#' @param ... Arguments defined in \url{http://api.highcharts.com/highstock#scrollbar}.
#'
#' @export
hc_scrollbar <- function(hc, ...) {
hc_scrollbar <- function(hc, ...) {

.hc_opt(hc, "scrollbar", ...)

Expand Down Expand Up @@ -246,7 +246,7 @@ hc_annotationsOptions <- function(hc, ...) {

}

#' Adding annotations to highcharts objects
#' Adding panes
#'
#' Applies only to polar charts and angular gauges. This configuration object
#' holds general options for the combined X and Y axes set. Each xAxis or
Expand Down Expand Up @@ -276,50 +276,3 @@ hc_motion <- function(hc, ...) {
.hc_opt(hc, "motion", ...)

}

#' Setting elementId
#'
#' Function to modify the \code{id} for the container.
#'
#' @param hc A \code{highchart} \code{htmlwidget} object.
#' @param id A string
#'
#' @examples
#'
#' hchart(rnorm(10)) %>%
#' hc_elementId("newid")
#'
#' @export
hc_elementId <- function(hc, id = NULL) {

assertthat::assert_that(is.highchart(hc))

hc$elementId <- as.character(id)

hc
}

#' Changing the size of a \code{highchart} object
#'
#' @param hc A \code{highchart} \code{htmlwidget} object.
#' @param width A numeric input in pixels.
#' @param height A numeric input in pixels.
#'
#' @examples
#'
#' hc_size(hcts(rnorm(100)), 400, 200)
#'
#' @export
hc_size <- function(hc, width = NULL, height = NULL) {

assertthat::assert_that(is.highchart(hc))

if(!is.null(width))
hc$width <- width

if(!is.null(height))
hc$height <- height

hc

}
49 changes: 49 additions & 0 deletions R/api-hc-helpers.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
#' Setting elementId
#'
#' Function to modify the \code{id} for the container.
#'
#' @param hc A \code{highchart} \code{htmlwidget} object.
#' @param id A string
#'
#' @examples
#'
#' hchart(rnorm(10)) %>%
#' hc_elementId("newid")
#'
#' @export
hc_elementId <- function(hc, id = NULL) {

assertthat::assert_that(is.highchart(hc))

hc$elementId <- as.character(id)

hc
}

#' Changing the size of a \code{highchart} object
#'
#' @param hc A \code{highchart} \code{htmlwidget} object.
#' @param width A numeric input in pixels.
#' @param height A numeric input in pixels.
#'
#' @examples
#'
#' hc_size(hcts(rnorm(100)), 400, 200)
#'
#' @export
hc_size <- function(hc, width = NULL, height = NULL) {

assertthat::assert_that(is.highchart(hc))

if(!is.null(width))
hc$width <- width

if(!is.null(height))
hc$height <- height

hc

}

.hc_tooltip_table <- function(hc, ...) {
# http://stackoverflow.com/a/22327749/829971
hc %>%
Expand Down Expand Up @@ -36,3 +83,5 @@
}"))

}


Binary file added devscripts/summary_hchart_hc_add_series.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion man/hc_elementId.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/hc_pane.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/hc_size.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3151f5d

Please sign in to comment.