Title: | JavaScript Charts Tool |
---|---|
Description: | Provides an R interface for using 'AmCharts' Library. Based on 'htmlwidgets', it provides a global architecture to generate 'JavaScript' source code for charts. Most of classes in the library have their equivalent in R with S4 classes; for those classes, not all properties have been referenced but can easily be added in the constructors. Complex properties (e.g. 'JavaScript' object) can be passed as named list. See examples at <https://datastorm-open.github.io/introduction_ramcharts/> and <https://www.amcharts.com/> for more information about the library. The package includes the free version of 'AmCharts' Library. Its only limitation is a small link to the web site displayed on your charts. If you enjoy this library, do not hesitate to refer to this page <https://www.amcharts.com/online-store/> to purchase a licence, and thus support its creators and get a period of Priority Support. See also <https://www.amcharts.com/about/> for more information about 'AmCharts' company. |
Authors: | Benoit Thieurmel [aut, cre], Antanas Marcelionis [aut, cph] ('AmCharts' library in th directory htmlwidgets/lib/amcharts, refer to https://www.amcharts.com/) |
Maintainer: | Benoit Thieurmel <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.1.16 |
Built: | 2025-01-13 09:55:50 UTC |
Source: | https://github.com/datastorm-open/ramcharts |
Add the 'animate' dependency to an htmlwidget. You can only manipulate the htmlwidget if you call the method 'plot' with an rAmChart.
add_animate_dependency(widget)
add_animate_dependency(widget)
widget |
An htmlwidget. |
Return an updated htmlwidget with the dependency.
Add the 'dataloader' dependency to an htmlwidget. You can only manipulate the htmlwidget if you call the method 'plot' with an rAmChart.
add_dataloader_dependency(widget)
add_dataloader_dependency(widget)
widget |
An htmlwidget |
Return the updated htmlwidget.
Add the 'export' dependency to an htmlwidget. You can only manipulate the htmlwidget if you call the method 'plot' with an rAmChart.
add_export_dependency(widget)
add_export_dependency(widget)
widget |
An htmlwidget. |
Return the updated widget with the 'export' dependency.
Add the 'responsive' dependency to an htmlwidget. You can only manipulate the htmlwidget if you call the method 'plot' with an rAmChart.
add_responsive_dependency(widget)
add_responsive_dependency(widget)
widget |
An htmlwidget. |
Return an updated htmlwidget with the dependency.
Add the 'theme' dependency to an htmlwidget. You can only manipulate the htmlwidget if you call the method 'plot' with an rAmChart.
add_theme_dependency( widget, theme_js = c("light.js", "patterns.js", "dark.js", "chalk.js") )
add_theme_dependency( widget, theme_js = c("light.js", "patterns.js", "dark.js", "chalk.js") )
widget |
An htmlwidget. |
theme_js |
A character indicating the JS file dependency. |
Return the updated htmlwidget.
## Not run: library(pipeR) amPlot(1:10, theme = "dark") %>>% plot() %>>% add_theme_dependency("light.js") ## End(Not run)
## Not run: library(pipeR) amPlot(1:10, theme = "dark") %>>% plot() %>>% add_theme_dependency("light.js") ## End(Not run)
Update an object of inherited class AxisBase.
## S4 method for signature 'AxisBase,GuideOrMissing' addGuide(.Object, guide = NULL, ...)
## S4 method for signature 'AxisBase,GuideOrMissing' addGuide(.Object, guide = NULL, ...)
.Object |
children class of AxisBase. |
guide |
(optional) Guide. |
... |
properties of Guide
Argument for method |
(possibly updated) .Object of class AxisBase.
addGuide(.Object = valueAxis(), fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) # equivalent to: guide_obj <- guide(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) addGuide(.Object = valueAxis(), guide = guide_obj)
addGuide(.Object = valueAxis(), fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) # equivalent to: guide_obj <- guide(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) addGuide(.Object = valueAxis(), guide = guide_obj)
Methods for inherited classes.
addListener(.Object, name, expression) ## S4 method for signature 'AmObject,character,character' addListener(.Object, name, expression) resetProperties(.Object, ...) ## S4 method for signature 'AmObject' resetProperties(.Object, ...) setProperties(.Object, list_prop, ...) ## S4 method for signature 'AmObject' setProperties(.Object, list_prop, ...)
addListener(.Object, name, expression) ## S4 method for signature 'AmObject,character,character' addListener(.Object, name, expression) resetProperties(.Object, ...) ## S4 method for signature 'AmObject' resetProperties(.Object, ...) setProperties(.Object, list_prop, ...) ## S4 method for signature 'AmObject' setProperties(.Object, list_prop, ...)
.Object |
|
name |
|
expression |
|
... |
other properties |
list_prop |
(Optional) |
Former properties will be overwritten.
Former properties will be overwritten.
The updated object.
addListener(.Object = amPieChart(), name = "clickSlice" , expression = "function(event){ alert('ok !'); }") addListener(.Object = amLegend(), name = "select", expression = paste0("function onSelect (properties) {", "alert('selected nodes: ' + properties.nodes);", "}")) library(pipeR) amPlot(runif(10)) %>>% resetProperties("categoryAxis") %>>% print(withDetail = FALSE) library(pipeR) # either you can set a list ls <- list(categoryAxis = list(gridPosition = "start"), fontSize = 15) amSerialChart() %>>% setProperties(list = ls) %>>% print() # or you can set one or more properties amPieChart() %>>% setProperties(handDrawn = TRUE, fontSize = 15) %>>% print() # overwrite a property amPieChart() %>>% setProperties(fontSize = 15) %>>% setProperties(fontSize = 12) %>>% print() # Carefull if you try to set a property which is a slot... # in that case, use the setter methods 'setXX' or 'addXX' which check the validity ## Not run: amPieChart() %>>% setProperties(type = "serial") %>>% print() ## End(Not run) amPieChart() %>>% setExport()
addListener(.Object = amPieChart(), name = "clickSlice" , expression = "function(event){ alert('ok !'); }") addListener(.Object = amLegend(), name = "select", expression = paste0("function onSelect (properties) {", "alert('selected nodes: ' + properties.nodes);", "}")) library(pipeR) amPlot(runif(10)) %>>% resetProperties("categoryAxis") %>>% print(withDetail = FALSE) library(pipeR) # either you can set a list ls <- list(categoryAxis = list(gridPosition = "start"), fontSize = 15) amSerialChart() %>>% setProperties(list = ls) %>>% print() # or you can set one or more properties amPieChart() %>>% setProperties(handDrawn = TRUE, fontSize = 15) %>>% print() # overwrite a property amPieChart() %>>% setProperties(fontSize = 15) %>>% setProperties(fontSize = 12) %>>% print() # Carefull if you try to set a property which is a slot... # in that case, use the setter methods 'setXX' or 'addXX' which check the validity ## Not run: amPieChart() %>>% setProperties(type = "serial") %>>% print() ## End(Not run) amPieChart() %>>% setExport()
amAngularGauge computes a gauge of the given value.
amAngularGauge( x, start = 0, end = 100, step = 20, bands = data.frame(start = numeric(), end = numeric(), color = character(), width = numeric(), stringsAsFactors = FALSE), text = "", textSize = 25, secondAxe = FALSE, start2 = 0, end2 = 100, step2 = 20, bands2 = data.frame(start = numeric(), end = numeric(), color = character(), stringsAsFactors = FALSE), ... )
amAngularGauge( x, start = 0, end = 100, step = 20, bands = data.frame(start = numeric(), end = numeric(), color = character(), width = numeric(), stringsAsFactors = FALSE), text = "", textSize = 25, secondAxe = FALSE, start2 = 0, end2 = 100, step2 = 20, bands2 = data.frame(start = numeric(), end = numeric(), color = character(), stringsAsFactors = FALSE), ... )
x |
|
start |
|
end |
|
step |
|
bands |
|
text |
|
textSize |
|
secondAxe |
|
start2 |
|
end2 |
|
step2 |
|
bands2 |
|
... |
see amOptions for more options. |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
amAngularGauge(10)
amAngularGauge(10)
Creates the balloons (tooltips) of the chart. It follows the mouse cursor when you roll-over the data items. The framework generates the instances automatically, you just have to adjust the appearance to your needs.
Run api("AmBalloon")
for more information and all avalaible properties.
adjustBorderColor
logical
.
If TRUE, border color will be changed when user rolls-over the slice, graph,
etc, instead of background color.
color
character
.
Balloon text color.
cornerRadius
numeric
.
Balloon corner radius.
fillColor
character
.
Balloon background color. It is usually defined by the chart itself. If
"adjustBorderColor" is set to TRUE, the balloon background color will be
equal to "fillColor".
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
Inherited from AmObject.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
Inherited from AmObject.
value
numeric
.
Inherited from AmObject.
amBarplot computes a bar chart of the given values.
amBarplot( x, y, data, xlab = "", ylab = "", ylim = NULL, groups_color = NULL, horiz = FALSE, stack_type = c("none", "regular", "100"), layered = FALSE, show_values = FALSE, depth = 0, dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
amBarplot( x, y, data, xlab = "", ylab = "", ylim = NULL, groups_color = NULL, horiz = FALSE, stack_type = c("none", "regular", "100"), layered = FALSE, show_values = FALSE, depth = 0, dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
x |
|
y |
|
data |
|
xlab |
|
ylab |
|
ylim |
limits for the y axis. |
groups_color |
|
horiz |
|
stack_type |
|
layered |
|
show_values |
|
depth |
|
dataDateFormat |
|
minPeriod |
Specifies the shortest period of your data. This should be set only if dataDateFormat is not 'NULL'. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. It's also possible to supply a number for increments, i.e. '15mm' which will instruct the chart that your data is supplied in 15 minute increments. |
... |
see amOptions for more options. |
Notice about labels: if the chart has many columns, several labels might be hidden. It depends on the width of the conatainer where the chart is displayed. Zoom on the chart to see if the chart can contain all labels. If not, use the parameter labelRotation. You can also add a cursor to your chart...
An object of class AmChart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
# Data data(data_bar) data(data_gbar) amBarplot(x = "country", y = "visits", data = data_bar, main = "example") ## Not run: # Other examples available which can be time consuming depending on your configuration. # fixed value axis amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, ylim = c(0, 26)) amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "100") # Test with label rotation amBarplot(x = "country", y = "visits", data = data_bar, labelRotation = -45) # Horizontal bar amBarplot(x = "country", y = "visits", data = data_bar, horiz = TRUE, labelRotation = -45) # 3D bar amBarplot(x = "country", y = "visits", data = data_bar, depth = 15, labelRotation = -45) # Display values amBarplot(x = "country", y = "visits", data = data_bar, show_values = TRUE, labelRotation = -45) # Grouped columns amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar) # Parse dates # Default label: first day of each year amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY") # Default label: first day of each month amBarplot(x = "month", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "MM/YYYY", minPeriod = "MM") amBarplot(x = "day", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "DD/MM/YYYY") # Change groups colors amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, groups_color = c("#87cefa", "#c7158")) # Regular stacked bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "regular") # 100% stacked bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "100") # Layered bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, layered = TRUE) # Data with row names dataset <- data.frame(get(x = "USArrests", pos = "package:datasets")) amBarplot(y = c("Murder", "Assault", "UrbanPop", "Rape"), data = dataset, stack_type = "regular") # Round values amBarplot(x = "year", y = c("in", "ex"), data = data_gbar, precision = 0) ## End(Not run)
# Data data(data_bar) data(data_gbar) amBarplot(x = "country", y = "visits", data = data_bar, main = "example") ## Not run: # Other examples available which can be time consuming depending on your configuration. # fixed value axis amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, ylim = c(0, 26)) amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "100") # Test with label rotation amBarplot(x = "country", y = "visits", data = data_bar, labelRotation = -45) # Horizontal bar amBarplot(x = "country", y = "visits", data = data_bar, horiz = TRUE, labelRotation = -45) # 3D bar amBarplot(x = "country", y = "visits", data = data_bar, depth = 15, labelRotation = -45) # Display values amBarplot(x = "country", y = "visits", data = data_bar, show_values = TRUE, labelRotation = -45) # Grouped columns amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar) # Parse dates # Default label: first day of each year amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY") # Default label: first day of each month amBarplot(x = "month", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "MM/YYYY", minPeriod = "MM") amBarplot(x = "day", y = c("income", "expenses"), data = data_gbar, dataDateFormat = "DD/MM/YYYY") # Change groups colors amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, groups_color = c("#87cefa", "#c7158")) # Regular stacked bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "regular") # 100% stacked bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, stack_type = "100") # Layered bars amBarplot(x = "year", y = c("income", "expenses"), data = data_gbar, layered = TRUE) # Data with row names dataset <- data.frame(get(x = "USArrests", pos = "package:datasets")) amBarplot(y = c("Murder", "Assault", "UrbanPop", "Rape"), data = dataset, stack_type = "regular") # Round values amBarplot(x = "year", y = c("in", "ex"), data = data_gbar, precision = 0) ## End(Not run)
amBoxplot computes a boxplot of the given data values. Can be a vector, a data.frame, or a matrix.
amBoxplot(object, ...) ## Default S3 method: amBoxplot( object, xlab = NULL, ylab = NULL, ylim = NULL, names = NULL, col = "#1e90ff", horiz = FALSE, ... ) ## S3 method for class 'data.frame' amBoxplot( object, id = NULL, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... ) ## S3 method for class 'matrix' amBoxplot( object, use.cols = TRUE, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... ) ## S3 method for class 'formula' amBoxplot( object, data = NULL, id = NULL, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... )
amBoxplot(object, ...) ## Default S3 method: amBoxplot( object, xlab = NULL, ylab = NULL, ylim = NULL, names = NULL, col = "#1e90ff", horiz = FALSE, ... ) ## S3 method for class 'data.frame' amBoxplot( object, id = NULL, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... ) ## S3 method for class 'matrix' amBoxplot( object, use.cols = TRUE, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... ) ## S3 method for class 'formula' amBoxplot( object, data = NULL, id = NULL, xlab = NULL, ylab = NULL, ylim = NULL, col = NULL, horiz = FALSE, ... )
object |
a vector, data.frame, a matrix, or a formula. |
... |
see amOptions for more options. |
xlab , ylab
|
|
ylim |
|
names |
|
col |
|
horiz |
|
id |
|
use.cols |
|
data |
|
An object of class AmChart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: # 'numeric' (default) amBoxplot(rnorm(100)) # 'formula' amBoxplot(count ~ spray, data = InsectSprays) # 'formula', two group data <- InsectSprays data$group <- c("H", "F") amBoxplot(count ~ spray + group, data = data, col = c("purple", "darkblue")) # 'matrix' x <- matrix(nrow = 10, ncol = 5, rnorm(50)) amBoxplot(x) # 'data.frame' amBoxplot(iris[, 1:4]) ## End(Not run) # Other examples available which can be time consuming depending on your configuration. ## Not run: don <- data.frame(a = 1:10, b = 1:5) amBoxplot(don, ylim = c(0,15)) ## End(Not run) ## Not run: # --- matrix x <- matrix(nrow = 10, ncol = 5, rnorm(50)) amBoxplot(x) # on columns colnames(x) <- LETTERS[1:5] amBoxplot(x) # with names amBoxplot(x, use.cols = FALSE, col = c("blue", "red")) # Parameter for amOptions amBoxplot(x, export = TRUE, exportFormat = "SVG") ## End(Not run) ## Not run: # --- Formula (obj <- amBoxplot(count ~ spray, data = InsectSprays)) # Adding parameters amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50), xlab = "spray", col = c("darkblue", "gray")) # Transpose amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50), xlab = "spray", horiz = FALSE) # Using a custom colum to identify outliers InsectSprays$id <- paste0("ID : ", 1:nrow(InsectSprays)) amBoxplot(count ~ spray, data = InsectSprays, id = "id") # Parameter for amOptions amBoxplot(count ~ spray, data = InsectSprays, main = "amcharts") ## End(Not run)
## Not run: # 'numeric' (default) amBoxplot(rnorm(100)) # 'formula' amBoxplot(count ~ spray, data = InsectSprays) # 'formula', two group data <- InsectSprays data$group <- c("H", "F") amBoxplot(count ~ spray + group, data = data, col = c("purple", "darkblue")) # 'matrix' x <- matrix(nrow = 10, ncol = 5, rnorm(50)) amBoxplot(x) # 'data.frame' amBoxplot(iris[, 1:4]) ## End(Not run) # Other examples available which can be time consuming depending on your configuration. ## Not run: don <- data.frame(a = 1:10, b = 1:5) amBoxplot(don, ylim = c(0,15)) ## End(Not run) ## Not run: # --- matrix x <- matrix(nrow = 10, ncol = 5, rnorm(50)) amBoxplot(x) # on columns colnames(x) <- LETTERS[1:5] amBoxplot(x) # with names amBoxplot(x, use.cols = FALSE, col = c("blue", "red")) # Parameter for amOptions amBoxplot(x, export = TRUE, exportFormat = "SVG") ## End(Not run) ## Not run: # --- Formula (obj <- amBoxplot(count ~ spray, data = InsectSprays)) # Adding parameters amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50), xlab = "spray", col = c("darkblue", "gray")) # Transpose amBoxplot(count ~ spray, data = InsectSprays, ylim = c(0,50), xlab = "spray", horiz = FALSE) # Using a custom colum to identify outliers InsectSprays$id <- paste0("ID : ", 1:nrow(InsectSprays)) amBoxplot(count ~ spray, data = InsectSprays, id = "id") # Parameter for amOptions amBoxplot(count ~ spray, data = InsectSprays, main = "amcharts") ## End(Not run)
amBullet computes a bullet chart of the given value.
amBullet( value, min = 0, max = 100, val_color = "#000000", limit = 85, limit_color = "#000000", steps = TRUE, label = "", horiz = TRUE, rates, ... )
amBullet( value, min = 0, max = 100, val_color = "#000000", limit = 85, limit_color = "#000000", steps = TRUE, label = "", horiz = TRUE, rates, ... )
value |
|
min |
|
max |
|
val_color |
|
limit |
|
limit_color |
|
steps |
|
label |
|
horiz |
|
rates |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
amBullet(value = 65) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Remove steps for background amBullet(value = 65, steps = FALSE) # Tune the colors with name or HTML code amBullet(value = 65, val_color = "purple", limit_color = "#3c8dbc") # Change the orientation amBullet(value = 65, steps = FALSE, horiz = FALSE) # Add text amBullet(value = 65, label = "Evaluation") # Change min and max values amBullet(value = 65, min = 20, max = 90) ## End(Not run)
amBullet(value = 65) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Remove steps for background amBullet(value = 65, steps = FALSE) # Tune the colors with name or HTML code amBullet(value = 65, val_color = "purple", limit_color = "#3c8dbc") # Change the orientation amBullet(value = 65, steps = FALSE, horiz = FALSE) # Add text amBullet(value = 65, label = "Evaluation") # Change min and max values amBullet(value = 65, min = 20, max = 90) ## End(Not run)
amCandlestick computes a candlestick chart of the given value.
amCandlestick( data, xlab = "", ylab = "", horiz = FALSE, positiveColor = "#7f8da9", negativeColor = "#db4c3c", names = c("low", "open", "close", "high"), dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
amCandlestick( data, xlab = "", ylab = "", horiz = FALSE, positiveColor = "#7f8da9", negativeColor = "#db4c3c", names = c("low", "open", "close", "high"), dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
data |
|
xlab |
|
ylab |
|
horiz |
|
positiveColor |
|
negativeColor |
|
names |
|
dataDateFormat |
|
minPeriod |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data("data_candleStick2") amCandlestick(data = data_candleStick2) ## Not run: # Change colors amCandlestick(data = data_candleStick2, positiveColor = "black", negativeColor = "green") # Naming the axes amCandlestick(data = data_candleStick2, xlab = "categories", ylab = "values") # Rotate the labels for x axis amCandlestick(data = data_candleStick2, labelRotation = 90) # Change names amCandlestick(data = data_candleStick2, names = c("min", "begin", "end", "max")) # Horizontal chart : amCandlestick(data = data_candleStick2, horiz = TRUE) # Parse date amCandlestick(data = data_candleStick2, dataDateFormat = "YYYY-MM-DD") # Datas over months data_candleStick2$category <- c("2015-01-01", "2015-02-01", "2015-03-01", "2015-04-01", "2015-05-01", "2015-06-01", "2015-07-01", "2015-08-01", "2015-09-01", "2015-10-01", "2015-11-01", "2015-12-01") amCandlestick(data = data_candleStick2, dataDateFormat = "YYYY-MM-DD", minPeriod = "MM") # Decimal precision if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) amCandlestick(data = data_candleStick2, horiz = TRUE) %>>% setProperties(precision = 2) } ## End(Not run)
data("data_candleStick2") amCandlestick(data = data_candleStick2) ## Not run: # Change colors amCandlestick(data = data_candleStick2, positiveColor = "black", negativeColor = "green") # Naming the axes amCandlestick(data = data_candleStick2, xlab = "categories", ylab = "values") # Rotate the labels for x axis amCandlestick(data = data_candleStick2, labelRotation = 90) # Change names amCandlestick(data = data_candleStick2, names = c("min", "begin", "end", "max")) # Horizontal chart : amCandlestick(data = data_candleStick2, horiz = TRUE) # Parse date amCandlestick(data = data_candleStick2, dataDateFormat = "YYYY-MM-DD") # Datas over months data_candleStick2$category <- c("2015-01-01", "2015-02-01", "2015-03-01", "2015-04-01", "2015-05-01", "2015-06-01", "2015-07-01", "2015-08-01", "2015-09-01", "2015-10-01", "2015-11-01", "2015-12-01") amCandlestick(data = data_candleStick2, dataDateFormat = "YYYY-MM-DD", minPeriod = "MM") # Decimal precision if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) amCandlestick(data = data_candleStick2, horiz = TRUE) %>>% setProperties(precision = 2) } ## End(Not run)
Defines the AmChart properties.
API for plotting AmChart with R.
allLabels
list
of Label.
Example of a label object, with all possible properties:
label(x = 20, y = 20, text = "this is a label", align = "left", size = 12, color = "#CC0000",
alpha = 1, rotation = 0, bold = TRUE, url = "http=//www.amcharts.com").
Run api("Label")
for more informations.
arrows
list
of GaugeArrow. Only valid for gauge charts.
Run api("GaugeArrow")
for more informations.
axes
list
of GaugeAxis properties.
Only valid for gauge charts.
Run api("GaugeAxis")
for more informations.
balloon
AmBalloon.
Creates the balloons (tooltips) of the chart,
It follows the mouse cursor when you roll-over the data items.
The framework generates the instances automatically you just have to adjust
the appearance to your needs.
Run api("AmBalloon")
for more informations.
categoryAxis
CategoryAxis.
Read-only. Chart creates category axis itself.
If you want to change some properties,
you should get this axis from the chart and set properties to this object.
Run api("CategoryAxis")
for more informations.
categoryField
character
.
Category field name indicates the name of the field in your dataProvider object
which will be used for category axis values.
ChartCursor
ChartCursor.
Chart's cursor.
Run api("ChartCursor")
for more informations.
ChartScrollbar
ChartScrollbar.
Chart's scrollbar.
Run api("ChartScrollbar")
for more informations.
creditsPosition
character
,
specifies position of the amCharts' website link.
Allowed values are: "top-left", "top-right", "bottom-left" and "bottom-right".
dataProvider
data.frame
, containing the data.
graphs
list
of AmGraph.
Creates the visualization of the data in following types: line, column, step line,
smoothed line, olhc and candlestick.
Run api("AmGraph")
for more informations.
graph
AmGraph.
Only valid for Gantt charts.
Gant chart actually creates multiple graphs (separate for each segment).
Properties of this graph are passed to each of the created graphs
- this allows you to control the look of segments.
Run api("AmGraph")
for more informations.
guides
list
of Guide.
Instead of adding guides to the axes, you can push all of them to this array.
In case guide has category or date defined, it will automatically be assigned to the category axis,
otherwise to the first value axis, unless you specify a different valueAxes for the guide.
Run api("Guide")
for more informations.
legend
AmLegend.
Legend of a chart.
Run api("AmLegend")
for more informations.
segmentsField
character
.
Segments field in your data provider.
Only valid for Gantt Charts.
subChartProperties
list
.
Only valid for Drilldown charts.
theme
character
.
Theme of a chart. Config files of themes can be found in amcharts/themes/ folder.
See https://www.amcharts.com/docs/v3/tutorials/working-with-themes/.
titles
list
of Title.
Run api("Title")
for more informations.
trendLines
list
of TrendLine objects added to a chart.
You can add trend lines to a chart using this list or access already existing trend lines.
Run api("TrendLine")
for more informations.
type
character
.
Possible types are: "serial", "pie", "radar", "xy", "radar", "funnel", "gauge", "stock".
See details about using argument type.
(type map is in development).
valueAxes
list
of ValueAxis.
Chart creates one value axis automatically,
so if you need only one value axis, you don't need to create it.
Run api("ValueAxis")
for more informations.
valueAxis
ValueAxis.
Only valid for Gantt Charts.
Set it's type to "date" if your data is date or time based.
Run api("ValueAxis")
for more informations.
valueScrollbar
ChartScrollbar. Value scrollbar, enables scrolling value axes.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
Run runShinyExamples()
for examples.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
https://docs.amcharts.com/3/javascriptcharts/
# Run runShinyExamples() for examples.
# Run runShinyExamples() for examples.
View full API of amcharts.js
amChartsAPI(viewer = getOption("viewer"))
amChartsAPI(viewer = getOption("viewer"))
viewer |
: Set to NULL to open in a browser |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/
## Not run: amChartsAPI() amChartsAPI(NULL) ## End(Not run)
## Not run: amChartsAPI() amChartsAPI(NULL) ## End(Not run)
Widget output function for use in Shiny
amChartsOutput(outputId, type = NULL, width = "100%", height = "400px")
amChartsOutput(outputId, type = NULL, width = "100%", height = "400px")
outputId |
|
type |
|
width |
|
height |
|
amFloatingBar computes a floating bar chart of the given values.
amFloatingBar( x, y_inf, y_sup, data, xlab = "", ylab = "", groups_color = NULL, horiz = FALSE, show_values = FALSE, depth = 0, dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
amFloatingBar( x, y_inf, y_sup, data, xlab = "", ylab = "", groups_color = NULL, horiz = FALSE, show_values = FALSE, depth = 0, dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
x |
|
y_inf |
|
y_sup |
|
data |
|
xlab |
|
ylab |
|
groups_color |
|
horiz |
|
show_values |
|
depth |
|
dataDateFormat |
|
minPeriod |
Specifies the shortest period of your data. This should be set only if dataDateFormat is not 'NULL'. Possible period values: fff - milliseconds, ss - seconds, mm - minutes, hh - hours, DD - days, MM - months, YYYY - years. It's also possible to supply a number for increments, i.e. '15mm' which will instruct the chart that your data is supplied in 15 minute increments. |
... |
see |
Notice about labels: if the chart has many columns, several labels might be hidden. It depends on the width of the conatainer where the chart is displayed. Zoom on the chart to see if the chart can contain all labels. You can also add a cursor to your chart...
An object of class AmChart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
# Load data data(data_fbar) data(data_gbar) amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45) amFloatingBar(x = "year", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY", zoom = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(pipeR) # Reference example : column chart amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45) # Label rotation modification amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -90) # Horizontal bar amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, horiz = TRUE) # 3D bar amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45, depth = 15) # Display values amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -90, show_values = TRUE) # Change colors amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar[,1:3], labelRotation = -45, groups_color = "#67b7dc") # Grouped columns # Parse dates # Default label: firt day of each year amFloatingBar(x = "year", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY", zoom = TRUE) # Default label: first day of each month amFloatingBar(x = "month", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "MM/YYYY", minPeriod = "MM", zoom = TRUE) amFloatingBar(x = "day", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "DD/MM/YYYY", zoom = TRUE) ## End(Not run)
# Load data data(data_fbar) data(data_gbar) amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45) amFloatingBar(x = "year", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY", zoom = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(pipeR) # Reference example : column chart amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45) # Label rotation modification amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -90) # Horizontal bar amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, horiz = TRUE) # 3D bar amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -45, depth = 15) # Display values amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar, labelRotation = -90, show_values = TRUE) # Change colors amFloatingBar(x = "country", y_inf = "visits_inf", y_sup = "visits_sup", data = data_fbar[,1:3], labelRotation = -45, groups_color = "#67b7dc") # Grouped columns # Parse dates # Default label: firt day of each year amFloatingBar(x = "year", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "YYYY", minPeriod = "YYYY", zoom = TRUE) # Default label: first day of each month amFloatingBar(x = "month", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "MM/YYYY", minPeriod = "MM", zoom = TRUE) amFloatingBar(x = "day", y_inf = "expenses", y_sup = "income", data = data_gbar, dataDateFormat = "DD/MM/YYYY", zoom = TRUE) ## End(Not run)
amFunnel computes a funnel chart of the given value.
amFunnel( data, inverse = FALSE, neck_height = NULL, neck_width = NULL, depth = 0, label_side = "right", margin_right = 200, margin_left = 200, ... )
amFunnel( data, inverse = FALSE, neck_height = NULL, neck_width = NULL, depth = 0, label_side = "right", margin_right = 200, margin_left = 200, ... )
data |
|
inverse |
|
neck_height |
|
neck_width |
|
depth |
|
label_side |
|
margin_right |
|
margin_left |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data(data_funnel) amFunnel(data = data_funnel, inverse = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Change the orientation and legend side amFunnel(data = data_funnel, inverse = FALSE, label_side = "left", margin_right = 15, margin_left = 160) # Basic example : Funnel chart amFunnel(data = data_funnel, neck_height = 30, neck_width = 40) # 3D pyramid amFunnel(data = data_funnel, depth = 50, inverse = TRUE) ## End(Not run)
data(data_funnel) amFunnel(data = data_funnel, inverse = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Change the orientation and legend side amFunnel(data = data_funnel, inverse = FALSE, label_side = "left", margin_right = 15, margin_left = 160) # Basic example : Funnel chart amFunnel(data = data_funnel, neck_height = 30, neck_width = 40) # 3D pyramid amFunnel(data = data_funnel, depth = 50, inverse = TRUE) ## End(Not run)
Creates the visualization of the data in following types: line, column, step line, smoothed line, ohlc and candlestick.
Run api("AmGraph")
for more details and all avalaible properties.
balloonText
character
.
Balloon text. You can use tags like [[value]], [[description]], [[percents]], [[open]], [[category]]
or any other field name from your data provider. HTML tags can also be used.
title
character
. Graph title.
type
character
.
Type of the graph. Possible values are: "line", "column", "step", "smoothedLine", "candlestick", "ohlc".
XY and Radar charts can only display "line" otherArguments graphs.
valueField
character
.
Name of the value field in your dataProvider.
listeners
"list"
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
otherProperties
"list"
containing other avalaible properties not yet implemented in the package.
value
numeric
.
amHist computes a histogram of the given data values.
amHist(x, ...) ## S3 method for class 'numeric' amHist( x, col = "#1e90ff", border = "#1e90ff", freq = TRUE, plot = TRUE, labels = FALSE, xlab, ylab, ylim, control_hist, ... )
amHist(x, ...) ## S3 method for class 'numeric' amHist( x, col = "#1e90ff", border = "#1e90ff", freq = TRUE, plot = TRUE, labels = FALSE, xlab, ylab, ylim, control_hist, ... )
x |
|
... |
see |
col |
|
border |
|
freq |
|
plot |
|
labels |
|
xlab , ylab
|
|
ylim |
|
control_hist |
(optional) named |
An object of class AmChart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
amHist(x = rnorm(100)) ## Not run: # Other examples available which can be time consuming depending on your configuration. x <- replicate(1000, { if (round(runif(1))) { rnorm(1) } else { rnorm(1, mean = 5) } }) # Without plot amHist(x = x, plot = FALSE) # With options amHist(x = x, border = "blue") amHist(x = x, col = "lightblue", control_hist = list(breaks = 100)) amHist(x = x, col = "grey") amHist(x = x, col = "gray") amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis", col = "red") amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis", ylim = c(10, 15)) amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis") # Options for computing the histogram amHist(x = x, control_hist = list(breaks = "Scott")) ## End(Not run)
amHist(x = rnorm(100)) ## Not run: # Other examples available which can be time consuming depending on your configuration. x <- replicate(1000, { if (round(runif(1))) { rnorm(1) } else { rnorm(1, mean = 5) } }) # Without plot amHist(x = x, plot = FALSE) # With options amHist(x = x, border = "blue") amHist(x = x, col = "lightblue", control_hist = list(breaks = 100)) amHist(x = x, col = "grey") amHist(x = x, col = "gray") amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis", col = "red") amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis", ylim = c(10, 15)) amHist(x = x, main = "Histogram", ylab = "y-axis", xlab = "x-axis") # Options for computing the histogram amHist(x = x, control_hist = list(breaks = "Scott")) ## End(Not run)
Creates the legend for the chart, automatically adapts the color settings of the graphs.
Run api("AmLegend")
for more information and all avalaible properties.
useGraphSettings
logical
.
If TRUE, border color will be changed when user rolls-over the slice, graph,
etc, instead of background color.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
amLines adds a new serie to an existing serial chart.
amLines( chart, x = NULL, y = NULL, type = c("points", "line", "smoothedLine", "both", "step"), col = "#0066cc", title, fill_alphas = 0, balloon = T )
amLines( chart, x = NULL, y = NULL, type = c("points", "line", "smoothedLine", "both", "step"), col = "#0066cc", title, fill_alphas = 0, balloon = T )
chart |
AmChart. Chart you wish to add the new serie. |
x |
|
y |
|
type |
(optionnal) |
col |
|
title |
|
fill_alphas |
a |
balloon |
|
It is supposed here that x or y corresponds to the y-axis, and the x-axis is automatically linked to the x values of the chart "chart". That is why it makes sense to give the y argument.
if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) amPlot(x = rnorm(100), type = 'sl') %>>% amLines(x = rnorm(100), type = "p") } ## Not run: amPlot(x = rnorm(100), type = 'sl') %>>% amLines(x = rnorm(100), col = "blue") %>>% amLines(x = rnorm(100), type = "sl") %>>% amLines(x = rnorm(100), type = "p") # For an XY chart x <- sort(rnorm(100)) y1 <- rnorm(100, sd = 10) y2 <- rnorm(100, sd = 10) y3 <- rnorm(100, sd = 10) amPlot(x = x, y = y1) %>>% amLines(x = y2, col = "blue") %>>% amLines(x = y3, type = "p") ## End(Not run)
if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) amPlot(x = rnorm(100), type = 'sl') %>>% amLines(x = rnorm(100), type = "p") } ## Not run: amPlot(x = rnorm(100), type = 'sl') %>>% amLines(x = rnorm(100), col = "blue") %>>% amLines(x = rnorm(100), type = "sl") %>>% amLines(x = rnorm(100), type = "p") # For an XY chart x <- sort(rnorm(100)) y1 <- rnorm(100, sd = 10) y2 <- rnorm(100, sd = 10) y3 <- rnorm(100, sd = 10) amPlot(x = x, y = y1) %>>% amLines(x = y2, col = "blue") %>>% amLines(x = y3, type = "p") ## End(Not run)
amMekko computes a mekko chart of the given values.
amMekko( x, y, data, xlab = "", ylab = "", groups_color = NULL, horiz = FALSE, show_values = FALSE, ... )
amMekko( x, y, data, xlab = "", ylab = "", groups_color = NULL, horiz = FALSE, show_values = FALSE, ... )
x |
|
y |
|
data |
|
xlab |
|
ylab |
|
groups_color |
|
horiz |
|
show_values |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data(data_mekko) amMekko(x = "var1", y = "var2", data = data_mekko) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(pipeR) # Horizontal amMekko(x = "var1", y = "var2", data = data_mekko, horiz = TRUE) # Display values amMekko(x = "var1", y = "var2", data = data_mekko, show_values = TRUE) ## End(Not run)
data(data_mekko) amMekko(x = "var1", y = "var2", data = data_mekko) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(pipeR) # Horizontal amMekko(x = "var1", y = "var2", data = data_mekko, horiz = TRUE) # Display values amMekko(x = "var1", y = "var2", data = data_mekko, show_values = TRUE) ## End(Not run)
This is a virtual class for representing any Am** class
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
amOHLC computes an OHLC chart of the given value.
amOHLC( data, xlab = "", ylab = "", horiz = FALSE, zoom = TRUE, positiveColor = "#7f8da9", negativeColor = "#db4c3c", names = c("low", "open", "close", "high"), dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
amOHLC( data, xlab = "", ylab = "", horiz = FALSE, zoom = TRUE, positiveColor = "#7f8da9", negativeColor = "#db4c3c", names = c("low", "open", "close", "high"), dataDateFormat = NULL, minPeriod = ifelse(!is.null(dataDateFormat), "DD", ""), ... )
data |
|
xlab |
|
ylab |
|
horiz |
|
zoom |
|
positiveColor |
|
negativeColor |
|
names |
|
dataDateFormat |
|
minPeriod |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data("data_candleStick2") amOHLC(data = data_candleStick2) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change colors amOHLC(data = data_candleStick2, positiveColor = "green", negativeColor = "red") # Naming the axes amOHLC(data = data_candleStick2, xlab = "categories", ylab = "values") %>>% setChartCursor() # Rotate the labels for x axis amOHLC(data = data_candleStick2, labelRotation = 90) # Change names amOHLC(data = data_candleStick2, names = c("min", "begin", "end", "max")) %>>% setChartCursor() # Use amOptions amOHLC(data = data_candleStick2, zoom = FALSE) } ## End(Not run)
data("data_candleStick2") amOHLC(data = data_candleStick2) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change colors amOHLC(data = data_candleStick2, positiveColor = "green", negativeColor = "red") # Naming the axes amOHLC(data = data_candleStick2, xlab = "categories", ylab = "values") %>>% setChartCursor() # Rotate the labels for x axis amOHLC(data = data_candleStick2, labelRotation = 90) # Change names amOHLC(data = data_candleStick2, names = c("min", "begin", "end", "max")) %>>% setChartCursor() # Use amOptions amOHLC(data = data_candleStick2, zoom = FALSE) } ## End(Not run)
amOptions sets the most common options for chart customization. You can set other properties with the method setProperties. See details for exception.
amOptions( chart, theme = c("none", "light", "dark", "patterns", "chalk"), legend = FALSE, legendPosition = "right", legendAlign = "left", export = FALSE, exportFormat = character(), creditsPosition = "top-left", main = character(), mainColor = "#000000", mainSize = 15, zoom = FALSE, scrollbar = FALSE, scrollbarHeight = 20, valuescrollbar = FALSE, valuescrollbarHeight = 20, labelRotation = 0, ... )
amOptions( chart, theme = c("none", "light", "dark", "patterns", "chalk"), legend = FALSE, legendPosition = "right", legendAlign = "left", export = FALSE, exportFormat = character(), creditsPosition = "top-left", main = character(), mainColor = "#000000", mainSize = 15, zoom = FALSE, scrollbar = FALSE, scrollbarHeight = 20, valuescrollbar = FALSE, valuescrollbarHeight = 20, labelRotation = 0, ... )
chart |
|
theme |
|
legend |
|
legendPosition |
|
legendAlign |
|
export |
|
exportFormat |
|
creditsPosition |
|
main |
|
mainColor |
|
mainSize |
|
zoom |
|
scrollbar |
|
scrollbarHeight |
|
valuescrollbar |
|
valuescrollbarHeight |
|
labelRotation |
|
... |
Other properties added to the chart using |
Exception:
It's not possible to export a gauge chart data as CSV.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: library(pipeR) data(data_pie) # Export amPie(data = data_pie) %>>% amOptions(export = TRUE) # Legend amPie(data = data_pie) %>>% amOptions(legend = TRUE) # Legend position amPie(data = data_pie) %>>% amOptions(legend = TRUE, legendPosition = "bottom") # Credits position amPie(data = data_pie) %>>% amOptions(creditsPosition = "bottom-right") # Theme amPie(data = data_pie) %>>% amOptions(theme = "chalk") # Title amPie(data = data_pie) %>>% amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40, theme = "chalk") # Custom exemple amPie(data = data_pie) %>>% amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40, theme = "dark", legend = TRUE, legendPosition = "bottom", creditsPosition = "bottom-right" ) ## End(Not run)
## Not run: library(pipeR) data(data_pie) # Export amPie(data = data_pie) %>>% amOptions(export = TRUE) # Legend amPie(data = data_pie) %>>% amOptions(legend = TRUE) # Legend position amPie(data = data_pie) %>>% amOptions(legend = TRUE, legendPosition = "bottom") # Credits position amPie(data = data_pie) %>>% amOptions(creditsPosition = "bottom-right") # Theme amPie(data = data_pie) %>>% amOptions(theme = "chalk") # Title amPie(data = data_pie) %>>% amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40, theme = "chalk") # Custom exemple amPie(data = data_pie) %>>% amOptions(main = "Social network", mainColor = "#FFFFFF", mainSize = 40, theme = "dark", legend = TRUE, legendPosition = "bottom", creditsPosition = "bottom-right" ) ## End(Not run)
amPie computes a pie chart of the given value.
amPie(data, show_values = TRUE, depth = 0, inner_radius = 0, ...)
amPie(data, show_values = TRUE, depth = 0, inner_radius = 0, ...)
data |
|
show_values |
|
depth |
|
inner_radius |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data("data_pie") amPie(data = data_pie) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Don't display values amPie(data = data_pie, show_values = FALSE) # 3D pie amPie(data = data_pie, depth = 10) # Donut chart amPie(data = data_pie, inner_radius = 50) # All parameters amPie(data = data_pie, inner_radius = 50, depth = 10, show_values = FALSE) ## End(Not run)
data("data_pie") amPie(data = data_pie) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Don't display values amPie(data = data_pie, show_values = FALSE) # 3D pie amPie(data = data_pie, depth = 10) # Donut chart amPie(data = data_pie, inner_radius = 50) # All parameters amPie(data = data_pie, inner_radius = 50, depth = 10, show_values = FALSE) ## End(Not run)
amPlot computes a plot of the given data values (can be a vector, dataframe or formula).
amPlot(x, ...) ## Default S3 method: amPlot(x, ...) ## S3 method for class 'numeric' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, title = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'character' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, parseDates = FALSE, title = NULL, dataDateFormat, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'factor' amPlot( x, y, bullet = "round", type = "p", col = "gray", weights = NULL, precision = 2, parseDates = FALSE, dataDateFormat = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'data.frame' amPlot(x, columns, type = "l", precision = 2, xlab, ylab, fill_alphas = 0, ...) ## S3 method for class 'formula' amPlot(x, data, type = "p", fill_alphas = 0, xlab, ylab, main = "", ...)
amPlot(x, ...) ## Default S3 method: amPlot(x, ...) ## S3 method for class 'numeric' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, title = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'character' amPlot( x, y, bullet = c("round", "diamond", "square", "bubble", "yError", "xError", "triangleLeft", "triangleRight", "triangleUp", "triangleDown"), type = c("points", "line", "smoothedLine", "step", "both"), col = "#0066cc", fill_alphas = 0, weights = NULL, precision = 2, parseDates = FALSE, title = NULL, dataDateFormat, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'factor' amPlot( x, y, bullet = "round", type = "p", col = "gray", weights = NULL, precision = 2, parseDates = FALSE, dataDateFormat = NULL, id, error, xlab, ylab, lty, cex, lwd, xlim, ylim, ... ) ## S3 method for class 'data.frame' amPlot(x, columns, type = "l", precision = 2, xlab, ylab, fill_alphas = 0, ...) ## S3 method for class 'formula' amPlot(x, data, type = "p", fill_alphas = 0, xlab, ylab, main = "", ...)
x |
the coordinates of points in the plot : |
... |
see |
y |
|
bullet |
|
type |
|
col |
either a |
fill_alphas |
a |
weights |
|
precision |
|
title |
|
id |
|
error |
|
xlab |
|
ylab |
|
lty |
|
cex |
|
lwd |
|
xlim |
|
ylim |
|
parseDates |
|
dataDateFormat |
|
columns |
(optional) either a vector of |
data |
dataset |
main |
title |
Return an Amchart.
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: # 'numeric': amPlot(x = rnorm(100)) # add line chart <- amPlot(x = rnorm(100), type = 'sl', legend = T) amLines(chart, x = rnorm(100), type = "p") # 'character': start <- as.POSIXct('2015-01-01') end <- as.POSIXct('2015-12-31') date <- seq.POSIXt(from = start, to = end, by = 'day') date <- format(date) y <- rnorm(length(date)) amPlot(x = date, y = y, type = 'l', parseDates = TRUE, dataDateFormat = "YYYY-DD-MM") # notice that by default 'parseDates = FALSE' # 'data.frame' amPlot(iris, col = colnames(iris)[1:2], type = c("l", "st"), zoom = TRUE, legend = TRUE) # 'formula': amPlot(Petal.Length + Sepal.Length ~ Sepal.Width, data = iris, legend = TRUE, zoom = TRUE) ## End(Not run) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(data.table) iris <- as.data.table(get("iris", "package:datasets")) x <- rnorm(100) # Simple scatter plot with title and color # Also change type (set to "p" by default), avalaible "l", "sl", "st", "p", "b" amPlot(x = x, main = "Title", col = "lightblue", type = "b") x <- sort(rnorm(100)) y <- runif(100) weights <- runif(100, 0, 15) amPlot(x = x, y = y, weights = weights) ## End(Not run)
## Not run: # 'numeric': amPlot(x = rnorm(100)) # add line chart <- amPlot(x = rnorm(100), type = 'sl', legend = T) amLines(chart, x = rnorm(100), type = "p") # 'character': start <- as.POSIXct('2015-01-01') end <- as.POSIXct('2015-12-31') date <- seq.POSIXt(from = start, to = end, by = 'day') date <- format(date) y <- rnorm(length(date)) amPlot(x = date, y = y, type = 'l', parseDates = TRUE, dataDateFormat = "YYYY-DD-MM") # notice that by default 'parseDates = FALSE' # 'data.frame' amPlot(iris, col = colnames(iris)[1:2], type = c("l", "st"), zoom = TRUE, legend = TRUE) # 'formula': amPlot(Petal.Length + Sepal.Length ~ Sepal.Width, data = iris, legend = TRUE, zoom = TRUE) ## End(Not run) ## Not run: # Other examples available which can be time consuming depending on your configuration. library(data.table) iris <- as.data.table(get("iris", "package:datasets")) x <- rnorm(100) # Simple scatter plot with title and color # Also change type (set to "p" by default), avalaible "l", "sl", "st", "p", "b" amPlot(x = x, main = "Title", col = "lightblue", type = "b") x <- sort(rnorm(100)) y <- runif(100) weights <- runif(100, 0, 15) amPlot(x = x, y = y, weights = weights) ## End(Not run)
radar computes a radarplot of the given data values.
amRadar( data, col = NULL, backTransparency = 0.5, type = "polygons", pch = "round", xlim = NULL, ... )
amRadar( data, col = NULL, backTransparency = 0.5, type = "polygons", pch = "round", xlim = NULL, ... )
data |
|
col |
|
backTransparency |
|
type |
|
pch |
|
xlim |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data("data_radar") amRadar(data_radar) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change color amRadar(data_radar, col = "#FF0000") amRadar(data_radar, col = c("#0000FF", "#00FF00", "#FF0000")) # Change backTransparency amRadar(data_radar, backTransparency = 0.6) amRadar(data_radar, backTransparency = c(0, 0.4, 0.6)) # Change type amRadar(data_radar, type = "circles") # Change pch amRadar(data_radar, pch = "triangleRight") amRadar(data_radar, pch = "triangleLeft") # Min-Max amRadar(data_radar, xlim = c(0, 8)) } ## End(Not run)
data("data_radar") amRadar(data_radar) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change color amRadar(data_radar, col = "#FF0000") amRadar(data_radar, col = c("#0000FF", "#00FF00", "#FF0000")) # Change backTransparency amRadar(data_radar, backTransparency = 0.6) amRadar(data_radar, backTransparency = c(0, 0.4, 0.6)) # Change type amRadar(data_radar, type = "circles") # Change pch amRadar(data_radar, pch = "triangleRight") amRadar(data_radar, pch = "triangleLeft") # Min-Max amRadar(data_radar, xlim = c(0, 8)) } ## End(Not run)
amSolidGauge computes a gauge of the given value.
amSolidGauge( x, min = 0, max = 100, type = "full", width = 20, color = "", text = "", textSize = 20, ... )
amSolidGauge( x, min = 0, max = 100, type = "full", width = 20, color = "", text = "", textSize = 20, ... )
x |
|
min |
|
max |
|
type |
|
width |
|
color |
|
text |
|
textSize |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
amSolidGauge(x = 65) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change min and max values amSolidGauge(x = 65, min = 0, max = 200) # Semi solid gauge amSolidGauge(x = 65, type = "semi") # Change width amSolidGauge(x = 65, width = 50) # Change color amSolidGauge(x = 65, color = "#2F4F4F") # Put a color scale amSolidGauge(x = 10, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 35, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 70, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 90, color = c("#00ff00", "#ffd700", "#ff0000")) # Add some text to the printed value amSolidGauge(x = 65, text = "Pct") # Modify textSize value amSolidGauge(x = 65, text = "Pct", textSize = 50) } ## End(Not run)
amSolidGauge(x = 65) ## Not run: # Other examples available which can be time consuming depending on your configuration. if (requireNamespace("pipeR", quietly = TRUE)) { require(pipeR) # Change min and max values amSolidGauge(x = 65, min = 0, max = 200) # Semi solid gauge amSolidGauge(x = 65, type = "semi") # Change width amSolidGauge(x = 65, width = 50) # Change color amSolidGauge(x = 65, color = "#2F4F4F") # Put a color scale amSolidGauge(x = 10, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 35, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 70, color = c("#00ff00", "#ffd700", "#ff0000")) amSolidGauge(x = 90, color = c("#00ff00", "#ffd700", "#ff0000")) # Add some text to the printed value amSolidGauge(x = 65, text = "Pct") # Modify textSize value amSolidGauge(x = 65, text = "Pct", textSize = 50) } ## End(Not run)
Class to draw stock charts
balloon
comparedDataSets
list
of DataSet.
Properties of data sets selected for comparison.
dataSets
list
of DataSet.
Each element must be a list of DataSet properties.
dataSetSelector
list
of DataSetSelector.
You can add it if you have more than one data set and want users
to be able to select/compare them.
mainDataSet
DataSet. Data set selected as main.
panels
list
of StockPanel.
periodSelector
PeriodSelector. You can add it if you want users to be able to enter date ranges or zoom chart with predefined period buttons.
theme
character
type
equals "stock"
group
character
for synchronization
is_ts_module
logicalOrMissing
. Don't use. For rAmChartsTimeSeriesUI
listeners
list
containining the listeners to add to the chart.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
https://docs.amcharts.com/3/javascriptstockchart/AmStockChart
amStockMultiSet compute a stock of multi data-sets
amStockMultiSet( data, panelColumn = NULL, ZoomButtonPosition = "bottom", ZoomButton = data.frame(Unit = "MAX", multiple = 1, label = "All"), color = c("#2E2EFE", "#31B404", "#FF4000"), precision = 1, export = FALSE, percentHeightPanel = NULL, creditsPosition = "top-right", ... )
amStockMultiSet( data, panelColumn = NULL, ZoomButtonPosition = "bottom", ZoomButton = data.frame(Unit = "MAX", multiple = 1, label = "All"), color = c("#2E2EFE", "#31B404", "#FF4000"), precision = 1, export = FALSE, percentHeightPanel = NULL, creditsPosition = "top-right", ... )
data |
|
panelColumn |
|
ZoomButtonPosition |
|
ZoomButton |
|
color |
|
precision |
|
export |
|
percentHeightPanel |
|
creditsPosition |
|
... |
other first level attributes |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: data(data_stock_3) amStockMultiSet(data = data_stock_3) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1)) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,3,4)) ZoomButton <- data.frame(Unit = c("DD", "DD", "MAX"), multiple = c(1, 10 ,1), label = c("Day","10 days", "MAX")) ZoomButtonPosition <- "bottom" amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1), ZoomButton = ZoomButton, ZoomButtonPosition = "top") amStockMultiSet(data = data_stock_3, precision = 2) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1), percentHeightPanel = c(3,1)) ## End(Not run)
## Not run: data(data_stock_3) amStockMultiSet(data = data_stock_3) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1)) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,3,4)) ZoomButton <- data.frame(Unit = c("DD", "DD", "MAX"), multiple = c(1, 10 ,1), label = c("Day","10 days", "MAX")) ZoomButtonPosition <- "bottom" amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1), ZoomButton = ZoomButton, ZoomButtonPosition = "top") amStockMultiSet(data = data_stock_3, precision = 2) amStockMultiSet(data = data_stock_3, panelColumn = c(1,2,1,1), percentHeightPanel = c(3,1)) ## End(Not run)
amTimeSeries computes a stock chart.
amTimeSeries( data, col_date, col_series, main = "", ylab = "", color = c("#2E2EFE", "#31B404", "#FF4000", "#AEB404"), type = c("line"), bullet = NULL, bulletSize = 2, linetype = c(0, 5, 10, 15, 20), linewidth = c(1, 1, 1, 1, 1, 1), fillAlphas = 0, precision = 1, connect = FALSE, export = FALSE, legend = TRUE, legendPosition = "bottom", legendHidden = FALSE, aggregation = c("Average", "Low", "High", "Sum"), maxSeries = 300, groupToPeriods = c("ss", "mm", "hh", "DD", "MM", "YYYY"), checkGroupToPeriods = TRUE, ZoomButton = data.frame(Unit = "MAX", multiple = 1, label = "All"), ZoomButtonPosition = "bottom", periodFieldsSelection = FALSE, scrollbar = TRUE, scrollbarPosition = "bottom", scrollbarHeight = 40, scrollbarGraph = NULL, cursor = TRUE, cursorValueBalloonsEnabled = TRUE, creditsPosition = "top-right", group = NULL, is_ts_module = FALSE, dataDateFormat = "YYYY-MM-DD JJ:NN:SS", categoryBalloonDateFormats = list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "YYYY-MM"), list(period = "WW", format = "YYYY-MM-DD"), list(period = "DD", format = "YYYY-MM-DD"), list(period = "hh", format = "YYYY-MM-DD JJ:NN"), list(period = "mm", format = "YYYY-MM-DD JJ:NN"), list(period = "ss", format = "YYYY-MM-DD JJ:NN:SS"), list(period = "fff", format = "YYYY-MM-DD JJ:NN:SS")), dateFormats = list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "MMM"), list(period = "WW", format = "MMM DD"), list(period = "DD", format = "MMM DD"), list(period = "hh", format = "JJ:NN"), list(period = "mm", format = "JJ:NN"), list(period = "ss", format = "JJ:NN:SS"), list(period = "fff", format = "JJ:NN:SS")), thousandsSeparator = " ", decimalSeparator = ".", balloonFontSize = 10, balloonMaxWidth = 400, ... )
amTimeSeries( data, col_date, col_series, main = "", ylab = "", color = c("#2E2EFE", "#31B404", "#FF4000", "#AEB404"), type = c("line"), bullet = NULL, bulletSize = 2, linetype = c(0, 5, 10, 15, 20), linewidth = c(1, 1, 1, 1, 1, 1), fillAlphas = 0, precision = 1, connect = FALSE, export = FALSE, legend = TRUE, legendPosition = "bottom", legendHidden = FALSE, aggregation = c("Average", "Low", "High", "Sum"), maxSeries = 300, groupToPeriods = c("ss", "mm", "hh", "DD", "MM", "YYYY"), checkGroupToPeriods = TRUE, ZoomButton = data.frame(Unit = "MAX", multiple = 1, label = "All"), ZoomButtonPosition = "bottom", periodFieldsSelection = FALSE, scrollbar = TRUE, scrollbarPosition = "bottom", scrollbarHeight = 40, scrollbarGraph = NULL, cursor = TRUE, cursorValueBalloonsEnabled = TRUE, creditsPosition = "top-right", group = NULL, is_ts_module = FALSE, dataDateFormat = "YYYY-MM-DD JJ:NN:SS", categoryBalloonDateFormats = list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "YYYY-MM"), list(period = "WW", format = "YYYY-MM-DD"), list(period = "DD", format = "YYYY-MM-DD"), list(period = "hh", format = "YYYY-MM-DD JJ:NN"), list(period = "mm", format = "YYYY-MM-DD JJ:NN"), list(period = "ss", format = "YYYY-MM-DD JJ:NN:SS"), list(period = "fff", format = "YYYY-MM-DD JJ:NN:SS")), dateFormats = list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "MMM"), list(period = "WW", format = "MMM DD"), list(period = "DD", format = "MMM DD"), list(period = "hh", format = "JJ:NN"), list(period = "mm", format = "JJ:NN"), list(period = "ss", format = "JJ:NN:SS"), list(period = "fff", format = "JJ:NN:SS")), thousandsSeparator = " ", decimalSeparator = ".", balloonFontSize = 10, balloonMaxWidth = 400, ... )
data |
|
col_date |
|
col_series |
|
main |
|
ylab |
|
color |
|
type |
|
bullet |
|
bulletSize |
: |
linetype |
: |
linewidth |
: |
fillAlphas |
: |
precision |
|
connect |
|
export |
|
legend |
|
legendPosition |
|
legendHidden |
|
aggregation |
|
maxSeries |
|
groupToPeriods |
|
checkGroupToPeriods |
|
ZoomButton |
|
ZoomButtonPosition |
|
periodFieldsSelection |
|
scrollbar |
|
scrollbarPosition |
|
scrollbarHeight |
|
scrollbarGraph |
|
cursor |
|
cursorValueBalloonsEnabled |
|
creditsPosition |
|
group |
|
is_ts_module |
|
dataDateFormat |
|
categoryBalloonDateFormats |
|
dateFormats |
|
thousandsSeparator |
|
decimalSeparator |
|
balloonFontSize |
|
balloonMaxWidth |
|
... |
other first level attributes |
For dateFormats & categoryBalloonDateFormats
Available periods are: fff - millisecond, ss - second, mm - minute, hh - hour, DD - date, WW - week, MM - month, YYYY - year
Available formats :
Year. The number of Y letters represents digits in the resulting number. I.e.: YY = 05 (always two digits), YYYY = 2005
Month of the year. The output depends on the number of M's: M = 8 (one or two digits), MM = 08 (always two digits), MMM = Aug (3-letter month abbreviation), MMMM = August (full month name)
Week of the year W
Day of the month: D = 7 (one or two digits), DD = 07 (always two digits)
Day of week: E = 2 (single digit day of week), EE = 02 (two-digit day of week), EEE = Tue (3-letter abbreviation of the literal representation of the day of week), EEEE = Tuesday (full day of week name)
Hour: 0-23: J = 3 (one or two digits), JJ = 03 (always two digits)
Hour: 1-24: H = 3 (one or two digits), HH = 03 (always two digits) K Hour in am/pm: 0-11 L Hour in am/pm: 1-12 *
Minute in hour: N = 8 (one or two digits), NN = 08 (always two digits)
Second in minute: S = 5 (one or two digits), SS = 05 (always two digits)
Milliseconds: QQ = 51, QQQ = 051
Other characters Other characters will be displayed as they are without changing them. I.e.:YYYY-MM-DD = 2013-03-01
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
rAmChartsTimeSeriesUI for shiny module, amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: data("data_stock_2") amTimeSeries(data_stock_2, "date", c("ts1", "ts2")) # upper /lower data <- data_stock_2[1:50, ] data$ts1low <- data$ts1-100 data$ts1up <- data$ts1+100 amTimeSeries(data, "date", list(c("ts1low", "ts1", "ts1up"), "ts2")) amTimeSeries(data, "date", list(c("ts1low", "ts1", "ts1up"), "ts2"), color = c("red", "blue"), bullet = c("round", "square")) # column / step amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), type = c("column", "step"), fillAlphas = c(1, 0), linewidth = c(0, 1)) # some parameters amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('hh', 'DD', '10DD')) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('hh', 'DD', '10DD'), linewidth = c(3, 1)) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), aggregation = "Sum") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50, precision = 5) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = c("diamond", "square"), linetype = 0, bulletSize = c(5, 10), groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50, aggregation = "Sum") ZoomButton <- data.frame(Unit = c("DD", "DD", "MAX"), multiple = c(1, 2 ,1), label = c("Day","2 days", "MAX")) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest", export = TRUE, ZoomButtonPosition = "right", legendPosition = "bottom", scrollbarPosition = "top") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest", export = TRUE, creditsPosition = "bottom-left") # date formats amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), type = "column", fillAlphas = 1, linewidth = 0, legendHidden = T, categoryBalloonDateFormats = list(list(period = 'YYYY', format = 'YYYY'), list(period='MM', format = 'MM'), list(period = 'WW', format = 'MM-DD'), list(period='DD', format = 'MM-DD'), list(period = 'hh', format = 'MM-DD JJ:NN'), list(period='mm', format = 'MM-DD JJ:NN'), list(period = 'ss', format = 'MM-DD JJ:NN:SS'), list(period='fff', format = 'MM-DD JJ:NN:SS')), dateFormats = list(list(period = 'YYYY', format = 'YYYY'), list(period='MM', format = 'MMMM'), list(period = 'WW', format = 'MMMM-DD'), list(period='DD', format = 'MMMM-DD'), list(period = 'hh', format = 'MM-DD JJ:NN'), list(period='mm', format = 'MM-DD JJ:NN'), list(period = 'ss', format = 'MM-DD JJ:NN:SS'), list(period='fff', format = 'MM-DD JJ:NN:SS'))) ## End(Not run)
## Not run: data("data_stock_2") amTimeSeries(data_stock_2, "date", c("ts1", "ts2")) # upper /lower data <- data_stock_2[1:50, ] data$ts1low <- data$ts1-100 data$ts1up <- data$ts1+100 amTimeSeries(data, "date", list(c("ts1low", "ts1", "ts1up"), "ts2")) amTimeSeries(data, "date", list(c("ts1low", "ts1", "ts1up"), "ts2"), color = c("red", "blue"), bullet = c("round", "square")) # column / step amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), type = c("column", "step"), fillAlphas = c(1, 0), linewidth = c(0, 1)) # some parameters amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('hh', 'DD', '10DD')) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('hh', 'DD', '10DD'), linewidth = c(3, 1)) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), aggregation = "Sum") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50, precision = 5) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = c("diamond", "square"), linetype = 0, bulletSize = c(5, 10), groupToPeriods = c('12hh', 'DD', '10DD'), maxSeries = 50, aggregation = "Sum") ZoomButton <- data.frame(Unit = c("DD", "DD", "MAX"), multiple = c(1, 2 ,1), label = c("Day","2 days", "MAX")) amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest", export = TRUE, ZoomButtonPosition = "right", legendPosition = "bottom", scrollbarPosition = "top") amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), bullet = "round", ZoomButton = ZoomButton, main = "My title", ylab = "Interest", export = TRUE, creditsPosition = "bottom-left") # date formats amTimeSeries(data_stock_2, "date", c("ts1", "ts2"), type = "column", fillAlphas = 1, linewidth = 0, legendHidden = T, categoryBalloonDateFormats = list(list(period = 'YYYY', format = 'YYYY'), list(period='MM', format = 'MM'), list(period = 'WW', format = 'MM-DD'), list(period='DD', format = 'MM-DD'), list(period = 'hh', format = 'MM-DD JJ:NN'), list(period='mm', format = 'MM-DD JJ:NN'), list(period = 'ss', format = 'MM-DD JJ:NN:SS'), list(period='fff', format = 'MM-DD JJ:NN:SS')), dateFormats = list(list(period = 'YYYY', format = 'YYYY'), list(period='MM', format = 'MMMM'), list(period = 'WW', format = 'MMMM-DD'), list(period='DD', format = 'MMMM-DD'), list(period = 'hh', format = 'MM-DD JJ:NN'), list(period='mm', format = 'MM-DD JJ:NN'), list(period = 'ss', format = 'MM-DD JJ:NN:SS'), list(period='fff', format = 'MM-DD JJ:NN:SS'))) ## End(Not run)
amWaterfall computes a waterfall chart of the given value.
amWaterfall(data, start = 0, horiz = FALSE, show_values = FALSE, ...)
amWaterfall(data, start = 0, horiz = FALSE, show_values = FALSE, ...)
data |
|
start |
|
horiz |
|
show_values |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
data("data_waterfall") amWaterfall(data = data_waterfall, show_values = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Change the orientation : amWaterfall(data = data_waterfall, horiz = TRUE) ## End(Not run)
data("data_waterfall") amWaterfall(data = data_waterfall, show_values = TRUE) ## Not run: # Other examples available which can be time consuming depending on your configuration. # Change the orientation : amWaterfall(data = data_waterfall, horiz = TRUE) ## End(Not run)
amWind computes a windplot of the given data values.
amWind(data, col = NULL, backTransparency = 0.5, ...)
amWind(data, col = NULL, backTransparency = 0.5, ...)
data |
|
col |
|
backTransparency |
|
... |
see |
See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI
amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall
## Not run: data("data_wind") amWind(data_wind) # Other examples available which can be time consuming depending on your configuration. # Change color amWind(data = data_wind, col = "#0404B4") amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00")) # Change backTransparency amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = 0.1) amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = 1) amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = c(0.1, 0.1, 1)) ## End(Not run)
## Not run: data("data_wind") amWind(data_wind) # Other examples available which can be time consuming depending on your configuration. # Change color amWind(data = data_wind, col = "#0404B4") amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00")) # Change backTransparency amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = 0.1) amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = 1) amWind(data = data_wind, col = c("#0404B4","#01DF01","#FFBF00"), backTransparency = c(0.1, 0.1, 1)) ## End(Not run)
Open a window in your browser at the referenced documentation under https://docs.amcharts.com/3/javascriptstockchart/.
api(class = NULL)
api(class = NULL)
class |
Object of class |
api() api("AmChart")
api() api("AmChart")
Base class for ValueAxis and CategoryAxis. It can not be explicitly instantiated.
guides
list
.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
Guides of this axis. Use addGuide method.
datastorm-open
Children class of AxisBase. Automatically set.
Run api("CategoryAxis")
for more information and all avalaible properties.
gridPosition
character
.
Specifies if a grid line is placed on the center of a cell or on the beginning of a cell.
Possible values are: "start" and "middle"
This setting doesn't work if parseDates is set to TRUE.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates a cursor for the chart which follows the mouse movements. In case of AmSerialChart charts it shows the balloons of hovered data points.
Run api("ChartCursor")
for more information and all avalaible properties.
oneBalloonOnly
logical
.
If TRUE, border color will be changed when user rolls-over the slice, graph,
etc, instead of background color.
valueLineAxis
list
.
Properties of Axis of value line. If you set valueLineBalloonEnabled to true,
but you have more than one axis, you can use this property
to indicate which axis should display balloon.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates a scrollbar for amSerialChart and amXYChart charts.
Run api("ChartScrollbar")
for more information and all avalaible properties.
enabled
logical
.
Specifies if the chart should be updated while dragging/resizing the scrollbar
or only at the moment when user releases mouse button.
graph
list
.
Specifies which graph properties will be displayed in the scrollbar.
Only Serial chart's scrollbar can display a graph.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Only used in 'renderAmCharts'.
controlShinyPlot(x)
controlShinyPlot(x)
x |
expression passed to 'renderAmCharts'. Either an expression that generates an HTML widget, or an expression that generates an AmChart. |
This function has only an internal purpose. Never use it.
Based on the dataset 'AirPassengers' from the package 'datasets'.
data_AirPassengers
data_AirPassengers
2 column, 144 rows :
numeric
character
, MM/YYYY
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_bar
data_bar
Dataset of 3 columns and 12 rows
character
numeric
character
This dataset is used in the tutorial, moreover if you notice a bug, use this dataset to give us an example.
data_candleStick1
data_candleStick1
Dataset of 5 columns and 12 rows
character
, can be parsed as a date
numeric
numeric
numeric
numeric
This dataset is used in the tutorial, moreover if you notice a bug, use this dataset to give us an example.
data_candleStick2
data_candleStick2
Dataset of 5 columns and 12 rows
character
, can be parsed as a date
numeric
numeric
numeric
numeric
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_fbar
data_fbar
Dataset of 2 columns and 1000 rows
character
numeric
numeric
character
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_funnel
data_funnel
Dataset of 2 columns and 7 rows
character
numeric
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_gantt
data_gantt
Dataset of 5 columns and 4 rows
character
date
date
character
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_gbar
data_gbar
Dataset of 5 columns and 12 rows
character
character
character
numeric
numeric
Value in $ trillion
data_gdp
data_gdp
Dataset of 2 columns and 10 rows
character
numeric
https://www.insidermonkey.com/blog/10-richest-countries-in-the-world-by-2015-gdp-344692/
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_mekko
data_mekko
Dataset of 2 columns and 1000 rows
character
numeric
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_pie
data_pie
Dataset of 2 columns and 5 rows
character
numeric
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_radar
data_radar
Dataset of 4 columns and 5 rows
character
numeric
numeric
numeric
Times Series on 2015-2016, one data by hour
data_stock_2
data_stock_2
Each datasetis a data.table with 21 rows and 4 variables:
vector of datesTimes
random vector of data
random vector of data
Times Series on 2017, by months
data_stock_3
data_stock_3
List of 4 datasets, 4 variables in each
vector of datesTimes
random vector of data
random vector of data
random vector of data
random vector of data
A list containing 4 datasets.
data_stock1
data_stock1
Each datasetis a data.table with 21 rows and 4 variables:
vector of dates
random vector of data
random vector of data
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_waterfall
data_waterfall
Dataset of 3 columns and 15 rows
character
, can be parsed as a date
numeric
numeric
This dataset is used in the examples, moreover it can be used as a reference if you notice a bug.
data_wind
data_wind
Dataset of 3 columns and 8 rows
numeric
numeric
numeric
DataSet is an object which holds all information about data for AmStockChart
Run api("DataSet")
for more information.
dataProvider
list
, the data set data.
Important: the data sets need to come pre-ordered in ascending order.
Data with incorrect order might result in visual and functional glitches on the chart.
fieldMappings
list
, field mappings.
Field mapping is an object with fromField and toField properties.
fromField is the name of your value field in dataProvider.
toField might be chosen freely,
it will be used to set value/open/close/high/low fields for the StockChart.
Example: (fromField:"val1", toField:"value").
stockEvents
list
of StockEvent.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
DataSetSelector is a tool used to select data sets as main and to compare to main data set.
Run api("DataSetSelector")
for more information and all avalaible properties.
position
character
.
Possible values: "right", "left", "top", "bottom".
"top" and "bottom" positions has a limitation -
only one data set can be selected for comparing.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates an arrow for AmAngularGaugeChart, multiple can be assigned.
Run api("GaugeArrow")
for more information and all avalaible properties.
axis
list
containing properties of GaugeAxis.
Axis of the arrow. You can use reference to the axis or id of the axis.
If you don't set any axis, the first axis of the chart will be used.
listeners
list
containining the listeners to add to the chart.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates an axis for AmAngularGaugeChart, multiple can be assigned.
Run api("GaugeAxis")
for more information and all avalaible properties.
bands
list
containing properties of one or several GaugeBand objects.
Bands are used to draw color fills between specified values.
listeners
list
containining the listeners to add to the chart.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates a band for a specified value range on the GaugeAxis. Multiple bands can be assigned to a single GaugeAxis.
Run api("GaugeBand")
for more information and all avalaible properties.
id
character
. Unique id of a band.
listeners
list
containining the listeners to add to the chart.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Get data in shiny module
getCurrentStockData( data, col_date, col_series, zoom = NULL, maxPoints = 1000, tz = "UTC", ts = c("5 min", "10 min", "30 min", "hour", "3 hour", "12 hour", "day", "week", "month", "year"), fun_aggr = "mean", treat_missing = FALSE, maxgap = Inf, type_aggr = "first", na.rm = TRUE )
getCurrentStockData( data, col_date, col_series, zoom = NULL, maxPoints = 1000, tz = "UTC", ts = c("5 min", "10 min", "30 min", "hour", "3 hour", "12 hour", "day", "week", "month", "year"), fun_aggr = "mean", treat_missing = FALSE, maxgap = Inf, type_aggr = "first", na.rm = TRUE )
data |
: data.frame to transform |
col_date |
: Date column name, default to "date". Must be "POSIXct" or "CET24" colum |
col_series |
: Column name of quantitative variable(s) to be transformed. Default to setdiff(colnames(data), "date") |
zoom |
: List for init subset. NULL to keep all |
maxPoints |
: Maximal number of rows in results |
tz |
: Timezone of result. Defaut to "UTC". |
ts |
: Increment of the sequence. Default to "10 min". Can be a number, in seconds, or a character string containing one of "min", "hour", "day". This can optionally be preceded by a positive integer and a space |
fun_aggr |
: Aggregation function to use ("min", "max", "sum", "mean", "first", "last", "minabs", "maxabs"). Default to "mean". |
treat_missing |
: Boolean. Default to FALSE
Whether or not to interpolate missing values ?
see |
maxgap |
: When interpolate missing values with |
type_aggr |
: Character. Type of aggregation
|
na.rm |
: aggregation only. a logical value indicating whether NA values should be stripped before the computation proceeds. |
Transform quantitative variables. Aggregate or interpolate time series data.
getTransformTS( data, col_date = "date", col_series = setdiff(colnames(data), c(col_date, col_by)), col_by = NULL, ts = "10 min", tz = "UTC", fun_aggr = "mean", treat_missing = FALSE, control_date = TRUE, maxgap = Inf, keep_last = TRUE, type_aggr = "first", showwarn = FALSE, na.rm = TRUE )
getTransformTS( data, col_date = "date", col_series = setdiff(colnames(data), c(col_date, col_by)), col_by = NULL, ts = "10 min", tz = "UTC", fun_aggr = "mean", treat_missing = FALSE, control_date = TRUE, maxgap = Inf, keep_last = TRUE, type_aggr = "first", showwarn = FALSE, na.rm = TRUE )
data |
: data.frame to transform |
col_date |
: Date column name, default to "date". Must be "POSIXct" |
col_series |
: Column name of quantitative variable(s) to be transformed. Default to setdiff(colnames(data), "date") |
col_by |
: Column name of a optionnal grouping variable. Default to NULL |
ts |
: Increment of the sequence. Default to "10 min". Can be a number, in seconds, or a character string containing one of "min", "hour", "day". This can optionally be preceded by a positive integer and a space |
tz |
: Timezone of result. Defaut to "UTC". |
fun_aggr |
: Aggregation function to use ("min", "max", "sum", "mean", "first", "last", "maxabs", "minabs"). Default to "mean". |
treat_missing |
: Boolean. Default to FALSE
Whether or not to interpolate missing values ?
see |
control_date |
: Boolean. Control full data sequence ? Defaut to TRUE and set to TRUE if treat_missing |
maxgap |
: When interpolate missing values with |
keep_last |
: Boolean. Keep last date/time value after interpolation ? |
type_aggr |
: Character. Type of aggregation
|
showwarn |
: Boolean. Show warnings ? |
na.rm |
: aggregation only. a logical value indicating whether NA values should be stripped before the computation proceeds. |
a data.frame
Creates a horizontal/vertical guideline-/area for amSerialChart, amXYChart and amRadarChart charts, automatically adapts it's settings from the axes if none has been specified.
Run api("Guide")
for more information and all avalaible properties.
fillAlpha
numeric
.
Specifies if a grid line is placed on the center of a cell or on the beginning of a cell.
Possible values are: "start" and "middle" This setting doesn't work if parseDates is set to TRUE.
valueAxis
ValueAxis. As you can add guides directly to the chart, you might need to specify which value axis should be used.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Initializes or updates an object AmBalloon.
## S4 method for signature 'AmBalloon' initialize(.Object, adjustBorderColor, color, cornerRadius, fillColor, ...) amBalloon(adjustBorderColor, color, cornerRadius, fillColor, ...) setAdjustBorderColor(.Object, adjustBorderColor) ## S4 method for signature 'AmBalloon,logical' setAdjustBorderColor(.Object, adjustBorderColor) setColor(.Object, color) ## S4 method for signature 'AmBalloon,character' setColor(.Object, color) setCornerRadius(.Object, cornerRadius) ## S4 method for signature 'AmBalloon,numeric' setCornerRadius(.Object, cornerRadius) setFillColor(.Object, fillColor) ## S4 method for signature 'AmBalloon,character' setFillColor(.Object, fillColor)
## S4 method for signature 'AmBalloon' initialize(.Object, adjustBorderColor, color, cornerRadius, fillColor, ...) amBalloon(adjustBorderColor, color, cornerRadius, fillColor, ...) setAdjustBorderColor(.Object, adjustBorderColor) ## S4 method for signature 'AmBalloon,logical' setAdjustBorderColor(.Object, adjustBorderColor) setColor(.Object, color) ## S4 method for signature 'AmBalloon,character' setColor(.Object, color) setCornerRadius(.Object, cornerRadius) ## S4 method for signature 'AmBalloon,numeric' setCornerRadius(.Object, cornerRadius) setFillColor(.Object, fillColor) ## S4 method for signature 'AmBalloon,character' setFillColor(.Object, fillColor)
.Object |
|
adjustBorderColor |
|
color |
|
cornerRadius |
|
fillColor |
|
... |
other properties of AmBalloon. See https://docs.amcharts.com/3/javascriptcharts/AmBalloon. |
An object, possibly updated, of class AmBalloon.
new("AmBalloon", cornerRadius = 10) amBalloon(adjustBorderColor = TRUE, color = "#000000", other = TRUE) setAdjustBorderColor(.Object = amBalloon(), adjustBorderColor = TRUE) setColor(.Object = amBalloon(), color = "#000000") setCornerRadius(.Object = amBalloon(), cornerRadius = 5) setFillColor(.Object = amBalloon(), fillColor = "#FFFFFF")
new("AmBalloon", cornerRadius = 10) amBalloon(adjustBorderColor = TRUE, color = "#000000", other = TRUE) setAdjustBorderColor(.Object = amBalloon(), adjustBorderColor = TRUE) setColor(.Object = amBalloon(), color = "#000000") setCornerRadius(.Object = amBalloon(), cornerRadius = 5) setFillColor(.Object = amBalloon(), fillColor = "#FFFFFF")
Method to initialize any S4 class provided by the package.
## S4 method for signature 'AmChart' initialize( .Object, allLabels, arrows, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, graph, guides, legend, segmentsField, theme, titles, trendLines, type, valueAxes, valueAxis, valueScrollbar, ... ) amChart( allLabels, arrows, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graph, graphs, guides, legend, segmentsField, theme, titles, trendLines, type, valueAxes, valueAxis, ... ) amAngularGaugeChart(arrows, titles, axes, ...) amFunnelChart(dataProvider, marginLeft = 10, marginRight = 10, ...) amRadarChart( allLabels, balloon, categoryField, creditsPosition, dataProvider, graphs, guides, legend, titles, valueAxes, ... ) amSerialChart( allLabels, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, guides, legend, titles, trendLines, valueAxes, ... ) amPieChart( allLabels, balloon, creditsPosition, dataProvider, legend, titles, ... ) amGanttChart(categoryField, dataProvider, graph, segmentsField, valueAxis, ...) amXYChart(creditsPosition, dataProvider, graphs, ...) setAllLabels(.Object, allLabels) ## S4 method for signature 'AmChart,list' setAllLabels(.Object, allLabels) addLabel(.Object, label = NULL, ...) ## S4 method for signature 'AmChart,LabelOrMissing' addLabel(.Object, label = NULL, ...) setArrows(.Object, arrows = NULL) ## S4 method for signature 'AmChart' setArrows(.Object, arrows = NULL) addArrow(.Object, arrow = NULL, ...) ## S4 method for signature 'AmChart,GaugeArrowOrMissing' addArrow(.Object, arrow = NULL, ...) setAxes(.Object, axes, ...) ## S4 method for signature 'AmChart,list' setAxes(.Object, axes) addAxe(.Object, axe = NULL, ...) ## S4 method for signature 'AmChart,GaugeAxisOrMissing' addAxe(.Object, axe = NULL, ...) addAxis(.Object, axis = NULL, ...) ## S4 method for signature 'AmChart,GaugeAxisOrMissing' addAxis(.Object, axis = NULL, ...) ## S4 method for signature 'AmChart,AmBalloonOrMissing' setBalloon(.Object, amBalloon = NULL, ...) setCategoryAxis(.Object, categoryAxis = NULL, ...) ## S4 method for signature 'AmChart' setCategoryAxis(.Object, categoryAxis = NULL, ...) setCategoryField(.Object, categoryField) ## S4 method for signature 'AmChart,character' setCategoryField(.Object, categoryField) setChartCursor(.Object, chartCursor = NULL, ...) ## S4 method for signature 'AmChart,ChartCursorOrMissing' setChartCursor(.Object, chartCursor = NULL, ...) setChartScrollbar(.Object, chartScrollbar = NULL, ...) ## S4 method for signature 'AmChart,ChartScrollbarOrMissing' setChartScrollbar(.Object, chartScrollbar = NULL, ...) setCreditsPosition(.Object, creditsPosition) ## S4 method for signature 'AmChart,character' setCreditsPosition(.Object, creditsPosition) setDataLoader(.Object, url, format, ...) ## S4 method for signature 'AmChart,character,character' setDataLoader(.Object, url, format, ...) ## S4 method for signature 'AmChart,ANY,logicalOrMissing' setDataProvider(.Object, dataProvider, keepNA = TRUE) setGraphs(.Object, graphs) ## S4 method for signature 'AmChart,list' setGraphs(.Object, graphs) addGraph(.Object, amGraph = NULL, ...) ## S4 method for signature 'AmChart,AmGraphOrMissing' addGraph(.Object, amGraph = NULL, ...) ## S4 method for signature 'AmChart,AmGraphOrMissing' setGraph(.Object, graph = NULL, ...) setGuides(.Object, guides) ## S4 method for signature 'AmChart,list' setGuides(.Object, guides) ## S4 method for signature 'AmChart,GuideOrMissing' addGuide(.Object, guide = NULL, ...) setLegend(.Object, amLegend = NULL, ...) ## S4 method for signature 'AmChart,AmLegendOrMissing' setLegend(.Object, amLegend = NULL, ...) addSegment(.Object, categoryIDs, sgts) ## S4 method for signature 'AmChart,numeric' addSegment(.Object, categoryIDs, sgts) addSubData(.Object, categoryIDs, data) ## S4 method for signature 'AmChart,numeric' addSubData(.Object, categoryIDs, data) setSubChartProperties(.Object, .subObject = NULL, ...) ## S4 method for signature 'AmChart' setSubChartProperties(.Object, .subObject = NULL, ...) setTheme(.Object, theme) ## S4 method for signature 'AmChart,character' setTheme(.Object, theme) setTitles(.Object, titles) ## S4 method for signature 'AmChart,list' setTitles(.Object, titles) addTitle(.Object, title = NULL, ...) ## S4 method for signature 'AmChart,TitleOrMissing' addTitle(.Object, title = NULL, ...) setTrendLines(.Object, trendLines) ## S4 method for signature 'AmChart,list' setTrendLines(.Object, trendLines) addTrendLine(.Object, trendLine = NULL, ...) ## S4 method for signature 'AmChart,TrendLineOrMissing' addTrendLine(.Object, trendLine = NULL, ...) ## S4 method for signature 'AmChart,character' setType(.Object, type) setValueAxes(.Object, valueAxes) ## S4 method for signature 'AmChart,list' setValueAxes(.Object, valueAxes) addValueAxes(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' addValueAxes(.Object, valueAxis = NULL, ...) addValueAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' addValueAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' setValueAxis(.Object, valueAxis = NULL, ...) setValueScrollbar(.Object, valueScrollbar, ...) ## S4 method for signature 'AmChart,ChartScrollbarOrMissing' setValueScrollbar(.Object, valueScrollbar, ...)
## S4 method for signature 'AmChart' initialize( .Object, allLabels, arrows, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, graph, guides, legend, segmentsField, theme, titles, trendLines, type, valueAxes, valueAxis, valueScrollbar, ... ) amChart( allLabels, arrows, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graph, graphs, guides, legend, segmentsField, theme, titles, trendLines, type, valueAxes, valueAxis, ... ) amAngularGaugeChart(arrows, titles, axes, ...) amFunnelChart(dataProvider, marginLeft = 10, marginRight = 10, ...) amRadarChart( allLabels, balloon, categoryField, creditsPosition, dataProvider, graphs, guides, legend, titles, valueAxes, ... ) amSerialChart( allLabels, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, guides, legend, titles, trendLines, valueAxes, ... ) amPieChart( allLabels, balloon, creditsPosition, dataProvider, legend, titles, ... ) amGanttChart(categoryField, dataProvider, graph, segmentsField, valueAxis, ...) amXYChart(creditsPosition, dataProvider, graphs, ...) setAllLabels(.Object, allLabels) ## S4 method for signature 'AmChart,list' setAllLabels(.Object, allLabels) addLabel(.Object, label = NULL, ...) ## S4 method for signature 'AmChart,LabelOrMissing' addLabel(.Object, label = NULL, ...) setArrows(.Object, arrows = NULL) ## S4 method for signature 'AmChart' setArrows(.Object, arrows = NULL) addArrow(.Object, arrow = NULL, ...) ## S4 method for signature 'AmChart,GaugeArrowOrMissing' addArrow(.Object, arrow = NULL, ...) setAxes(.Object, axes, ...) ## S4 method for signature 'AmChart,list' setAxes(.Object, axes) addAxe(.Object, axe = NULL, ...) ## S4 method for signature 'AmChart,GaugeAxisOrMissing' addAxe(.Object, axe = NULL, ...) addAxis(.Object, axis = NULL, ...) ## S4 method for signature 'AmChart,GaugeAxisOrMissing' addAxis(.Object, axis = NULL, ...) ## S4 method for signature 'AmChart,AmBalloonOrMissing' setBalloon(.Object, amBalloon = NULL, ...) setCategoryAxis(.Object, categoryAxis = NULL, ...) ## S4 method for signature 'AmChart' setCategoryAxis(.Object, categoryAxis = NULL, ...) setCategoryField(.Object, categoryField) ## S4 method for signature 'AmChart,character' setCategoryField(.Object, categoryField) setChartCursor(.Object, chartCursor = NULL, ...) ## S4 method for signature 'AmChart,ChartCursorOrMissing' setChartCursor(.Object, chartCursor = NULL, ...) setChartScrollbar(.Object, chartScrollbar = NULL, ...) ## S4 method for signature 'AmChart,ChartScrollbarOrMissing' setChartScrollbar(.Object, chartScrollbar = NULL, ...) setCreditsPosition(.Object, creditsPosition) ## S4 method for signature 'AmChart,character' setCreditsPosition(.Object, creditsPosition) setDataLoader(.Object, url, format, ...) ## S4 method for signature 'AmChart,character,character' setDataLoader(.Object, url, format, ...) ## S4 method for signature 'AmChart,ANY,logicalOrMissing' setDataProvider(.Object, dataProvider, keepNA = TRUE) setGraphs(.Object, graphs) ## S4 method for signature 'AmChart,list' setGraphs(.Object, graphs) addGraph(.Object, amGraph = NULL, ...) ## S4 method for signature 'AmChart,AmGraphOrMissing' addGraph(.Object, amGraph = NULL, ...) ## S4 method for signature 'AmChart,AmGraphOrMissing' setGraph(.Object, graph = NULL, ...) setGuides(.Object, guides) ## S4 method for signature 'AmChart,list' setGuides(.Object, guides) ## S4 method for signature 'AmChart,GuideOrMissing' addGuide(.Object, guide = NULL, ...) setLegend(.Object, amLegend = NULL, ...) ## S4 method for signature 'AmChart,AmLegendOrMissing' setLegend(.Object, amLegend = NULL, ...) addSegment(.Object, categoryIDs, sgts) ## S4 method for signature 'AmChart,numeric' addSegment(.Object, categoryIDs, sgts) addSubData(.Object, categoryIDs, data) ## S4 method for signature 'AmChart,numeric' addSubData(.Object, categoryIDs, data) setSubChartProperties(.Object, .subObject = NULL, ...) ## S4 method for signature 'AmChart' setSubChartProperties(.Object, .subObject = NULL, ...) setTheme(.Object, theme) ## S4 method for signature 'AmChart,character' setTheme(.Object, theme) setTitles(.Object, titles) ## S4 method for signature 'AmChart,list' setTitles(.Object, titles) addTitle(.Object, title = NULL, ...) ## S4 method for signature 'AmChart,TitleOrMissing' addTitle(.Object, title = NULL, ...) setTrendLines(.Object, trendLines) ## S4 method for signature 'AmChart,list' setTrendLines(.Object, trendLines) addTrendLine(.Object, trendLine = NULL, ...) ## S4 method for signature 'AmChart,TrendLineOrMissing' addTrendLine(.Object, trendLine = NULL, ...) ## S4 method for signature 'AmChart,character' setType(.Object, type) setValueAxes(.Object, valueAxes) ## S4 method for signature 'AmChart,list' setValueAxes(.Object, valueAxes) addValueAxes(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' addValueAxes(.Object, valueAxis = NULL, ...) addValueAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' addValueAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'AmChart,ValueAxisOrMissing' setValueAxis(.Object, valueAxis = NULL, ...) setValueScrollbar(.Object, valueScrollbar, ...) ## S4 method for signature 'AmChart,ChartScrollbarOrMissing' setValueScrollbar(.Object, valueScrollbar, ...)
.Object |
|
allLabels |
|
arrows |
|
axes |
|
balloon |
AmBalloon.
Creates the balloons (tooltips) of the chart.
It follows the mouse cursor when you roll-over the data items.
The framework automatically generates the instances you just have to adjust
the appearance to your needs.
Run |
categoryAxis |
CategoryAxis.
Read-only. Chart creates category axis itself.
If you want to change some properties,
you should get this axis from the chart and set properties to this object.
Run |
categoryField |
|
chartCursor |
ChartCursor.
Chart's cursor.
Run |
chartScrollbar |
ChartScrollbar.
Chart's scrollbar.
Run |
creditsPosition |
|
dataProvider |
|
graphs |
|
graph |
AmGraph.
Only valid for Gantt charts.
Gant chart actually creates multiple graphs (separate for each segment).
Properties of this graph are passed to each of the created graphs
- this allows you to control the look of segments.
Run |
guides |
|
legend |
AmLegend.
Legend of a chart.
Run |
segmentsField |
|
theme |
|
titles |
|
trendLines |
|
type |
|
valueAxes |
|
valueAxis |
ValueAxis.
Only valid for Gantt Charts.
Set it's type to "date" if your data is date or time based.
Run |
valueScrollbar |
ChartScrollbar. Value scrollbar, enables scrolling value axes. |
... |
In case of constructor |
marginLeft |
|
marginRight |
|
label |
(optional) Label.
Argument of method |
arrow |
(optional) GaugeArrow.
Argument of method |
axe |
(optional) GaugeAxis.
Argument of deprecated method |
axis |
(optional) GaugeAxis. same as axe. |
amBalloon |
AmBalloon, argument of method 'setBalloon'. |
url |
|
format |
|
keepNA |
object of class |
amGraph |
(optional) AmGraph. |
guide |
(optional) Guide.
Argument of method |
amLegend |
(optional) AmLegend. |
categoryIDs |
|
sgts |
|
data |
|
.subObject |
|
title |
(optional) Title, argument of method |
trendLine |
(optional) TrendLine.
Argument of method |
amAngularGaugeChart is a shortcut for instantiating AmChart of type gauge
.
amFunnelChart is a shortcut
for instantiating AmChart of type funnel
.
amRadarChart is a shortcut
for instantiating AmChart of type radar
.
amSerialChart is a shortcut constructor
for instantiating AmChart of type serial
.
amPieChart is a shortcut constructor
for instantiating AmChart of type pie
.
amGanttChart is a constructor
for instantiating AmChart of type gantt
.
amXYChart is a shortcut constructor
for instantiating AmChart of type xy
.
Method 'addAxe' is deprecated, use 'addAxis'.
Method setGraph
is only valid for Gantt Charts.
'addSubData' allows to add subdata for a chart with drilldown.
In this case, categoryIDs indicates corresponding indice(s)
of the dataProvider
where to add the data.
For method addValueAxis
: valueAxis is optional. Method addValueAxes
is deprecated.
Method setValueAxis
is only valid for Gantt charts.
(updated) AmChart with given properties.
Refer to https://docs.amcharts.com/3/javascriptcharts/.
new("AmChart", valueField = "value", theme = "patterns") ## Not run: amChart(type = "pie") ## End(Not run) ## Not run: amAngularGaugeChart() ## End(Not run) ## Not run: amFunnelChart(marginLeft = 15) ## End(Not run) ## Not run: amRadarChart() ## End(Not run) ## Not run: amSerialChart(creditsPostion = "top-right") ## End(Not run) ## Not run: amPieChart() ## End(Not run) ## Not run: amGanttChart(segmentsField = "segments") ## End(Not run) ## Not run: amXYChart() ## End(Not run) ## Not run: allLabels <- list(label(text = "balloonText"), label(text = "column")) amSerialChart(allLabels = allLabels) ## End(Not run) # --- ## Not run: addLabel(.Object = amSerialChart(), text = "balloonText") # equivalent to: label_obj <- label(text = "balloonText") addLabel(.Object = amSerialChart(), label = label_obj) ## End(Not run) # --- ## Not run: arrows_ls <- list(gaugeArrow(value = 130), gaugeArrow(value = 150)) amAngularGaugeChart(arrows = arrows_ls) ## End(Not run) # --- ## Not run: chart <- addArrow(.Object = amAngularGaugeChart(), value = 10); print(chart) # equivalent to: gaugeArrow_obj <- gaugeArrow(value = 10) addArrow(.Object = amAngularGaugeChart(), arrow = gaugeArrow_obj) ## End(Not run) # --- ## Not run: axes_ls <- list(gaugeAxis(value = 130), gaugeAxis(value = 150)) setAxes(.Object = amAngularGaugeChart(), axes = axes_ls) # If possible, simplify your code by using the constructor: amAngularGaugeChart(axes = axes_ls) ## End(Not run) # --- ## Not run: addAxis(.Object = amAngularGaugeChart(), startValue = 0, endValue = 100, valueInterval = 10) # equivalent to: gaugeAxis_obj <- gaugeAxis(startValue = 0, enValue = 100, valueInterval = 10) addAxis(.Object = amAngularGaugeChart(), axis = gaugeAxis_obj) ## End(Not run) # --- ## Not run: setBalloon(.Object = amSerialChart(), adjustBorderColor = TRUE, fillColor = "#FFFFFF", color = "#000000", cornerRadius = 5) # equivalent to: amBalloon_obj <- amBalloon(adjustBorderColor = TRUE, fillColor = "#FFFFFF", color = "#000000", cornerRadius = 5) setBalloon(.Object = amSerialChart(), amBalloon = amBalloon_obj) ## End(Not run) # --- ## Not run: setCategoryAxis(.Object = amSerialChart(), gridPosition = "start") # equivalent to: categoryAxis_obj <- categoryAxis(gridPosition = "start") setCategoryAxis(.Object = amSerialChart(), categoryAxis = categoryAxis_obj) ## End(Not run) # --- setCategoryField(.Object = amSerialChart(), categoryField = "country") # --- ## Not run: # with default value, no argument needed setChartCursor(.Object = amSerialChart()) # other example setChartCursor(.Object = amSerialChart(), oneBallOnly = TRUE) # equivalent to chartCursor_obj <- chartCursor(oneBallOnly = TRUE) setChartCursor(.Object = amSerialChart(), chartCursor = chartCursor_obj) ## End(Not run) # --- ## Not run: # Add the default scrollbar setChartScrollbar(.Object = amSerialChart()) # equivalent to: chartScrollbar_obj <- chartScrollbar(updateOnReleaseOnly = FALSE) setChartScrollbar(.Object = amSerialChart(), chartScrollbar = chartScrollbar_obj) ## End(Not run) # --- ## Not run: setCreditsPosition(.Object = amPieChart(), creditsPosition = "top-right") ## End(Not run) # --- ## Not run: setDataLoader(.Object = amSerialChart(), url = "data.json", format = "json") ## End(Not run) # --- ## Not run: dataProvider_obj <- data.frame(key = c("FR", "US", "GER", "ENG", "IT" ), value = round(runif(5, max = 100))) setDataProvider(.Object = amPieChart(), dataProvider = dataProvider_obj) ## End(Not run) # --- ## Not run: graphs_ls <- list(graph(balloonText = "balloonText"), graph(type = "column")) setGraphs(.Object = amSerialChart(), graphs = graphs_ls) ## End(Not run) # --- ## Not run: addGraph(.Object = amSerialChart(), balloonText = "balloonText", "type" = "column") # equivalent to amGraph_obj <- amGraph(balloonText = "balloonText", "type" = "column") addGraph(.Object = amSerialChart(), amGraph = amGraph_obj) ## End(Not run) # --- ## Not run: print(setGraph(.Object = amGanttChart(), id = "amGraph-1")) # equivalent to: amGraph_obj <- amGraph(id = "amGraph-1") setGraph(.Object = amGanttChart(), amGraph = amGraph_obj) ## End(Not run) # --- ## Not run: guides_ls <- list(guide(fillAlpha = .1), guide(fillAlpha = .5)) amSerialChart(guides = guides_ls) ## End(Not run) # --- ## Not run: chart <- addGuide(.Object = amSerialChart(), fillAlpha = .1, value = 0, toVAlue = 10) print(chart) # equivalent to guide_obj <- guide(fillAlpha = .1, value = 0, toValue = 10, valueAxis = "1") addGuide(.Object = amSerialChart(), guide = guide_obj) ## End(Not run) ## Not run: setLegend(.Object = amChart(), amLegend = amLegend(useGraphSettings = TRUE)) # equivalent to: setLegend(.Object = amChart(), useGraphSettings = TRUE) ## End(Not run) # --- ## Not run: pipeR::pipeline( amGanttChart(segmentsField = "segments"), setDataProvider(data.frame(category = c( "John", "Julia"))), addSegment(1, data.frame(start = 7, duration = 2:3, task = c("Task #1", "Task #2"))), addSegment(2, data.frame(start = 10, duration = 2:3, task = c("Task #1", "Task #2"))) ) # --- ls <- list(data.frame(start = 7, duration = 2:3, task = c("Task #1", "Task #2")), data.frame(start = 10, duration = 2:3, task = c("Task #1", "Task #2"))) pipeR::pipeline( amGanttChart(segmentsField = "segments"), setDataProvider(data.frame(category = c( "John", "Julia"))), addSegment(1:2, ls) ) ## End(Not run) # --- ## Not run: amChart_obj <- amChart(dataProvider = data.frame(a = 1:5, b = 6:10)) addSubData(.Object = amChart_obj, categoryIDs = 3, data = data.frame(a = 1:10, b = 11:20)) ## End(Not run) # --- ## Not run: setSubChartProperties(.Object = amSerialChart(), type = "serial") ## End(Not run) # --- ## Not run: setTheme(.Object = amPieChart(), theme = "dark") ## End(Not run) # --- ## Not run: titles_ls <- list(amTitle(text = "balloonText"), amTitle(text = "column")) setTitles(.Object = amXYChart(), titles = titles_ls) # or... amXYChart(titles = titles_ls) ## End(Not run) # --- ## Not run: addTitle(.Object = amPieChart(), text = "balloonText", size = 15) # equivalent to title_obj <- amTitle(text = "balloonText", size = 15) addTitle(.Object = amPieChart(), title = title_obj) ## End(Not run) # --- ## Not run: trendLines <- list(trendLine(initialValue = 1, finalValue = 5), trendLine(initialValue = 7, finalValue = 19)) setTrendLines(.Object = amSerialChart(), trendLines = trendLines) # or... amSerialChart(trendLines = trendLines) # Equivalent ## End(Not run) # --- ## Not run: addTrendLine(.Object = amSerialChart(), initialValue = 1, initialXValue = 1, finalValue = 11, finalXValue = 12) # equivalent to: trendLine_obj <- trendLine(initialValue = 1, initialXValue = 1, finalValue = 11, finalXValue = 12) chart <- addTrendLine(.Object = amSerialChart(), trendLine = trendLine_obj); print(chart) ## End(Not run) # --- ## Not run: setType(.Object = amChart(), type = "pie") # equivalent to: amPieChart() ## End(Not run) ## Not run: valueAxes <- list(valueAxis(axisTitleOffset = 12, tickLength = 10), valueAxis(axisTitleOffset = 10, tickLength = 10)) setValueAxes(.Object = amSerialChart(), valueAxes = valueAxes) # or... amSerialChart(valueAxes = valueAxes) ## End(Not run) # --- ## Not run: print(addValueAxis(.Object = amSerialChart(), axisTitleOffset = 12, tickLength = 10, title = "foo")) # equivalent to: valueAxis_obj <- valueAxis(axisTitleOffset = 12, tickLength = 10, title = "foo") addValueAxis(.Object = amSerialChart(), valueAxis = valueAxis_obj) ## End(Not run) # --- ## Not run: setValueAxis(.Object = amGanttChart()) setValueAxis(.Object = amGanttChart(), type = "date") ## End(Not run) ## Not run: valueScrollbar_obj <- chartScrollbar(updateOnReleaseOnly = FALSE) chart <- setValueScrollbar(.Object = amSerialChart(), valueScrollbar = valueScrollbar_obj) print(chart) # or... amSerialChart(updateOnReleaseOnly = FALSE) ## End(Not run) # ---
new("AmChart", valueField = "value", theme = "patterns") ## Not run: amChart(type = "pie") ## End(Not run) ## Not run: amAngularGaugeChart() ## End(Not run) ## Not run: amFunnelChart(marginLeft = 15) ## End(Not run) ## Not run: amRadarChart() ## End(Not run) ## Not run: amSerialChart(creditsPostion = "top-right") ## End(Not run) ## Not run: amPieChart() ## End(Not run) ## Not run: amGanttChart(segmentsField = "segments") ## End(Not run) ## Not run: amXYChart() ## End(Not run) ## Not run: allLabels <- list(label(text = "balloonText"), label(text = "column")) amSerialChart(allLabels = allLabels) ## End(Not run) # --- ## Not run: addLabel(.Object = amSerialChart(), text = "balloonText") # equivalent to: label_obj <- label(text = "balloonText") addLabel(.Object = amSerialChart(), label = label_obj) ## End(Not run) # --- ## Not run: arrows_ls <- list(gaugeArrow(value = 130), gaugeArrow(value = 150)) amAngularGaugeChart(arrows = arrows_ls) ## End(Not run) # --- ## Not run: chart <- addArrow(.Object = amAngularGaugeChart(), value = 10); print(chart) # equivalent to: gaugeArrow_obj <- gaugeArrow(value = 10) addArrow(.Object = amAngularGaugeChart(), arrow = gaugeArrow_obj) ## End(Not run) # --- ## Not run: axes_ls <- list(gaugeAxis(value = 130), gaugeAxis(value = 150)) setAxes(.Object = amAngularGaugeChart(), axes = axes_ls) # If possible, simplify your code by using the constructor: amAngularGaugeChart(axes = axes_ls) ## End(Not run) # --- ## Not run: addAxis(.Object = amAngularGaugeChart(), startValue = 0, endValue = 100, valueInterval = 10) # equivalent to: gaugeAxis_obj <- gaugeAxis(startValue = 0, enValue = 100, valueInterval = 10) addAxis(.Object = amAngularGaugeChart(), axis = gaugeAxis_obj) ## End(Not run) # --- ## Not run: setBalloon(.Object = amSerialChart(), adjustBorderColor = TRUE, fillColor = "#FFFFFF", color = "#000000", cornerRadius = 5) # equivalent to: amBalloon_obj <- amBalloon(adjustBorderColor = TRUE, fillColor = "#FFFFFF", color = "#000000", cornerRadius = 5) setBalloon(.Object = amSerialChart(), amBalloon = amBalloon_obj) ## End(Not run) # --- ## Not run: setCategoryAxis(.Object = amSerialChart(), gridPosition = "start") # equivalent to: categoryAxis_obj <- categoryAxis(gridPosition = "start") setCategoryAxis(.Object = amSerialChart(), categoryAxis = categoryAxis_obj) ## End(Not run) # --- setCategoryField(.Object = amSerialChart(), categoryField = "country") # --- ## Not run: # with default value, no argument needed setChartCursor(.Object = amSerialChart()) # other example setChartCursor(.Object = amSerialChart(), oneBallOnly = TRUE) # equivalent to chartCursor_obj <- chartCursor(oneBallOnly = TRUE) setChartCursor(.Object = amSerialChart(), chartCursor = chartCursor_obj) ## End(Not run) # --- ## Not run: # Add the default scrollbar setChartScrollbar(.Object = amSerialChart()) # equivalent to: chartScrollbar_obj <- chartScrollbar(updateOnReleaseOnly = FALSE) setChartScrollbar(.Object = amSerialChart(), chartScrollbar = chartScrollbar_obj) ## End(Not run) # --- ## Not run: setCreditsPosition(.Object = amPieChart(), creditsPosition = "top-right") ## End(Not run) # --- ## Not run: setDataLoader(.Object = amSerialChart(), url = "data.json", format = "json") ## End(Not run) # --- ## Not run: dataProvider_obj <- data.frame(key = c("FR", "US", "GER", "ENG", "IT" ), value = round(runif(5, max = 100))) setDataProvider(.Object = amPieChart(), dataProvider = dataProvider_obj) ## End(Not run) # --- ## Not run: graphs_ls <- list(graph(balloonText = "balloonText"), graph(type = "column")) setGraphs(.Object = amSerialChart(), graphs = graphs_ls) ## End(Not run) # --- ## Not run: addGraph(.Object = amSerialChart(), balloonText = "balloonText", "type" = "column") # equivalent to amGraph_obj <- amGraph(balloonText = "balloonText", "type" = "column") addGraph(.Object = amSerialChart(), amGraph = amGraph_obj) ## End(Not run) # --- ## Not run: print(setGraph(.Object = amGanttChart(), id = "amGraph-1")) # equivalent to: amGraph_obj <- amGraph(id = "amGraph-1") setGraph(.Object = amGanttChart(), amGraph = amGraph_obj) ## End(Not run) # --- ## Not run: guides_ls <- list(guide(fillAlpha = .1), guide(fillAlpha = .5)) amSerialChart(guides = guides_ls) ## End(Not run) # --- ## Not run: chart <- addGuide(.Object = amSerialChart(), fillAlpha = .1, value = 0, toVAlue = 10) print(chart) # equivalent to guide_obj <- guide(fillAlpha = .1, value = 0, toValue = 10, valueAxis = "1") addGuide(.Object = amSerialChart(), guide = guide_obj) ## End(Not run) ## Not run: setLegend(.Object = amChart(), amLegend = amLegend(useGraphSettings = TRUE)) # equivalent to: setLegend(.Object = amChart(), useGraphSettings = TRUE) ## End(Not run) # --- ## Not run: pipeR::pipeline( amGanttChart(segmentsField = "segments"), setDataProvider(data.frame(category = c( "John", "Julia"))), addSegment(1, data.frame(start = 7, duration = 2:3, task = c("Task #1", "Task #2"))), addSegment(2, data.frame(start = 10, duration = 2:3, task = c("Task #1", "Task #2"))) ) # --- ls <- list(data.frame(start = 7, duration = 2:3, task = c("Task #1", "Task #2")), data.frame(start = 10, duration = 2:3, task = c("Task #1", "Task #2"))) pipeR::pipeline( amGanttChart(segmentsField = "segments"), setDataProvider(data.frame(category = c( "John", "Julia"))), addSegment(1:2, ls) ) ## End(Not run) # --- ## Not run: amChart_obj <- amChart(dataProvider = data.frame(a = 1:5, b = 6:10)) addSubData(.Object = amChart_obj, categoryIDs = 3, data = data.frame(a = 1:10, b = 11:20)) ## End(Not run) # --- ## Not run: setSubChartProperties(.Object = amSerialChart(), type = "serial") ## End(Not run) # --- ## Not run: setTheme(.Object = amPieChart(), theme = "dark") ## End(Not run) # --- ## Not run: titles_ls <- list(amTitle(text = "balloonText"), amTitle(text = "column")) setTitles(.Object = amXYChart(), titles = titles_ls) # or... amXYChart(titles = titles_ls) ## End(Not run) # --- ## Not run: addTitle(.Object = amPieChart(), text = "balloonText", size = 15) # equivalent to title_obj <- amTitle(text = "balloonText", size = 15) addTitle(.Object = amPieChart(), title = title_obj) ## End(Not run) # --- ## Not run: trendLines <- list(trendLine(initialValue = 1, finalValue = 5), trendLine(initialValue = 7, finalValue = 19)) setTrendLines(.Object = amSerialChart(), trendLines = trendLines) # or... amSerialChart(trendLines = trendLines) # Equivalent ## End(Not run) # --- ## Not run: addTrendLine(.Object = amSerialChart(), initialValue = 1, initialXValue = 1, finalValue = 11, finalXValue = 12) # equivalent to: trendLine_obj <- trendLine(initialValue = 1, initialXValue = 1, finalValue = 11, finalXValue = 12) chart <- addTrendLine(.Object = amSerialChart(), trendLine = trendLine_obj); print(chart) ## End(Not run) # --- ## Not run: setType(.Object = amChart(), type = "pie") # equivalent to: amPieChart() ## End(Not run) ## Not run: valueAxes <- list(valueAxis(axisTitleOffset = 12, tickLength = 10), valueAxis(axisTitleOffset = 10, tickLength = 10)) setValueAxes(.Object = amSerialChart(), valueAxes = valueAxes) # or... amSerialChart(valueAxes = valueAxes) ## End(Not run) # --- ## Not run: print(addValueAxis(.Object = amSerialChart(), axisTitleOffset = 12, tickLength = 10, title = "foo")) # equivalent to: valueAxis_obj <- valueAxis(axisTitleOffset = 12, tickLength = 10, title = "foo") addValueAxis(.Object = amSerialChart(), valueAxis = valueAxis_obj) ## End(Not run) # --- ## Not run: setValueAxis(.Object = amGanttChart()) setValueAxis(.Object = amGanttChart(), type = "date") ## End(Not run) ## Not run: valueScrollbar_obj <- chartScrollbar(updateOnReleaseOnly = FALSE) chart <- setValueScrollbar(.Object = amSerialChart(), valueScrollbar = valueScrollbar_obj) print(chart) # or... amSerialChart(updateOnReleaseOnly = FALSE) ## End(Not run) # ---
To create an AmGraph, you can use the usual methode Initialize or the constructor. You can update properties with setters.
## S4 method for signature 'AmGraph' initialize( .Object, animationPlayed = FALSE, balloonText, title, type, valueField, ... ) amGraph(animationPlayed = FALSE, balloonText, title, type, valueField, ...) graph(animationPlayed = FALSE, balloonText, title, type, valueField, ...) setBalloonText(.Object, balloonText) ## S4 method for signature 'AmGraph,character' setBalloonText(.Object, balloonText) ## S4 method for signature 'AmGraph,character' setTitle(.Object, title) ## S4 method for signature 'AmGraph,character' setType(.Object, type) setValueField(.Object, valueField) ## S4 method for signature 'AmGraph,character' setValueField(.Object, valueField)
## S4 method for signature 'AmGraph' initialize( .Object, animationPlayed = FALSE, balloonText, title, type, valueField, ... ) amGraph(animationPlayed = FALSE, balloonText, title, type, valueField, ...) graph(animationPlayed = FALSE, balloonText, title, type, valueField, ...) setBalloonText(.Object, balloonText) ## S4 method for signature 'AmGraph,character' setBalloonText(.Object, balloonText) ## S4 method for signature 'AmGraph,character' setTitle(.Object, title) ## S4 method for signature 'AmGraph,character' setType(.Object, type) setValueField(.Object, valueField) ## S4 method for signature 'AmGraph,character' setValueField(.Object, valueField)
.Object |
|
animationPlayed |
|
balloonText |
|
title |
|
type |
|
valueField |
|
... |
other properties of AmGraph. See https://docs.amcharts.com/3/javascriptcharts/AmGraph. |
An object of class AmGraph with the given properties.
# --- method 'initialize' new("AmGraph", valueField = "value") # constructor amGraph(balloonText = "My text") ## Not run: amGraph(balloonText = "balloonText", "type" = "column", title = "myGraph!", valueField = "value", animationPlayed = TRUE, other = TRUE) ## End(Not run) amGraph(balloonText = "some text") # --- shortcut constructor graph(balloonText = "balloonText", "type" = "column", valueField = "value", animationPlayed = TRUE) # --- update 'balloonText' setBalloonText(.Object = amGraph(), balloonText = "performance") # --- update 'title' setTitle(.Object = amGraph(), title = "Power") # --- update 'type' setType(.Object = amGraph(), type = "type") # --- update valueField setValueField(.Object = amGraph(), valueField = "score")
# --- method 'initialize' new("AmGraph", valueField = "value") # constructor amGraph(balloonText = "My text") ## Not run: amGraph(balloonText = "balloonText", "type" = "column", title = "myGraph!", valueField = "value", animationPlayed = TRUE, other = TRUE) ## End(Not run) amGraph(balloonText = "some text") # --- shortcut constructor graph(balloonText = "balloonText", "type" = "column", valueField = "value", animationPlayed = TRUE) # --- update 'balloonText' setBalloonText(.Object = amGraph(), balloonText = "performance") # --- update 'title' setTitle(.Object = amGraph(), title = "Power") # --- update 'type' setType(.Object = amGraph(), type = "type") # --- update valueField setValueField(.Object = amGraph(), valueField = "score")
Constructor for an AmLegend.
## S4 method for signature 'AmLegend' initialize(.Object, useGraphSettings, ...) amLegend(useGraphSettings, ...) legend(useGraphSettings, ...) setUseGraphSettings(.Object, useGraphSettings) ## S4 method for signature 'AmLegend,logical' setUseGraphSettings(.Object, useGraphSettings)
## S4 method for signature 'AmLegend' initialize(.Object, useGraphSettings, ...) amLegend(useGraphSettings, ...) legend(useGraphSettings, ...) setUseGraphSettings(.Object, useGraphSettings) ## S4 method for signature 'AmLegend,logical' setUseGraphSettings(.Object, useGraphSettings)
.Object |
|
useGraphSettings |
|
... |
Other properties of AmLegend. See https://docs.amcharts.com/3/javascriptstockchart/AmLegend. |
new("AmLegend", useGraphSettings = TRUE) amLegend(useGraphSettings = FALSE) rAmCharts:::legend(useGraphSettings = FALSE) setUseGraphSettings(.Object = amLegend(), useGraphSettings = TRUE)
new("AmLegend", useGraphSettings = TRUE) amLegend(useGraphSettings = FALSE) rAmCharts:::legend(useGraphSettings = FALSE) setUseGraphSettings(.Object = amLegend(), useGraphSettings = TRUE)
Method to initialize any S4 class provided by the package.
## S4 method for signature 'AmStockChart' initialize( .Object, balloon, comparedDataSets, dataSets, dataSetSelector, mainDataSet, panels, periodSelector, theme, group, is_ts_module, ... ) amStockChart( balloon, comparedDataSets, dataSets, dataSetSelector, mainDataSet, panels, periodSelector, theme, group, is_ts_module, ... ) ## S4 method for signature 'AmStockChart,AmBalloonOrMissing' setBalloon(.Object, amBalloon = NULL, ...) setCategoryAxesSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setCategoryAxesSettings(.Object, ...) setChartCursorSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setChartCursorSettings(.Object, ...) setChartScrollbarSettings(.Object, chartScrollbarSettings = NULL, ...) ## S4 method for signature 'AmStockChart,ChartScrollbarOrMissing' setChartScrollbarSettings(.Object, chartScrollbarSettings = NULL, ...) setComparedDataSets(.Object, comparedDataSets) ## S4 method for signature 'AmStockChart' setComparedDataSets(.Object, comparedDataSets) addComparedDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' addComparedDataSet(.Object, dataSet = NULL, ...) setDataSets(.Object, dataSets) ## S4 method for signature 'AmStockChart' setDataSets(.Object, dataSets) addDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' addDataSet(.Object, dataSet = NULL, ...) setDataSetSelector(.Object, dataSetSelector = NULL, ...) ## S4 method for signature 'AmStockChart' setDataSetSelector(.Object, dataSetSelector = NULL, ...) setLegendSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setLegendSettings(.Object, ...) setMainDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' setMainDataSet(.Object, dataSet = NULL, ...) setPanels(.Object, panels) ## S4 method for signature 'AmStockChart,list' setPanels(.Object, panels) addPanel(.Object, panel = NULL, ...) ## S4 method for signature 'AmStockChart,StockPanelOrMissing' addPanel(.Object, panel = NULL, ...) setPanelsSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setPanelsSettings(.Object, ...) setPeriodSelector(.Object, periodSelector = NULL, ...) ## S4 method for signature 'AmStockChart,PeriodSelectorOrMissing' setPeriodSelector(.Object, periodSelector = NULL, ...) setStockEventsSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setStockEventsSettings(.Object, ...) setValueAxesSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setValueAxesSettings(.Object, ...)
## S4 method for signature 'AmStockChart' initialize( .Object, balloon, comparedDataSets, dataSets, dataSetSelector, mainDataSet, panels, periodSelector, theme, group, is_ts_module, ... ) amStockChart( balloon, comparedDataSets, dataSets, dataSetSelector, mainDataSet, panels, periodSelector, theme, group, is_ts_module, ... ) ## S4 method for signature 'AmStockChart,AmBalloonOrMissing' setBalloon(.Object, amBalloon = NULL, ...) setCategoryAxesSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setCategoryAxesSettings(.Object, ...) setChartCursorSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setChartCursorSettings(.Object, ...) setChartScrollbarSettings(.Object, chartScrollbarSettings = NULL, ...) ## S4 method for signature 'AmStockChart,ChartScrollbarOrMissing' setChartScrollbarSettings(.Object, chartScrollbarSettings = NULL, ...) setComparedDataSets(.Object, comparedDataSets) ## S4 method for signature 'AmStockChart' setComparedDataSets(.Object, comparedDataSets) addComparedDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' addComparedDataSet(.Object, dataSet = NULL, ...) setDataSets(.Object, dataSets) ## S4 method for signature 'AmStockChart' setDataSets(.Object, dataSets) addDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' addDataSet(.Object, dataSet = NULL, ...) setDataSetSelector(.Object, dataSetSelector = NULL, ...) ## S4 method for signature 'AmStockChart' setDataSetSelector(.Object, dataSetSelector = NULL, ...) setLegendSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setLegendSettings(.Object, ...) setMainDataSet(.Object, dataSet = NULL, ...) ## S4 method for signature 'AmStockChart,DataSetOrMissing' setMainDataSet(.Object, dataSet = NULL, ...) setPanels(.Object, panels) ## S4 method for signature 'AmStockChart,list' setPanels(.Object, panels) addPanel(.Object, panel = NULL, ...) ## S4 method for signature 'AmStockChart,StockPanelOrMissing' addPanel(.Object, panel = NULL, ...) setPanelsSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setPanelsSettings(.Object, ...) setPeriodSelector(.Object, periodSelector = NULL, ...) ## S4 method for signature 'AmStockChart,PeriodSelectorOrMissing' setPeriodSelector(.Object, periodSelector = NULL, ...) setStockEventsSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setStockEventsSettings(.Object, ...) setValueAxesSettings(.Object, ...) ## S4 method for signature 'AmStockChart' setValueAxesSettings(.Object, ...)
.Object |
|
balloon |
|
comparedDataSets |
|
dataSets |
|
dataSetSelector |
|
mainDataSet |
DataSet. Data set selected as main. |
panels |
|
periodSelector |
PeriodSelector. You can add it if you want user's to be able to enter date ranges or zoom chart with predefined period buttons. |
theme |
|
group |
|
is_ts_module |
|
... |
other properties of AmStockChart. |
amBalloon |
AmBalloon.
Argument for method |
chartScrollbarSettings |
ChartScrollbar. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of ChartScrollbar class will be used. |
dataSet |
|
panel |
CategoryAxesSettings sets common settings for all CategoryAxes of StockPanels. If you change a property after the chart is initialized, you should call stockChart.validateNow() method. If there is no specified value, default value of CategoryAxis class will be used. you should get this axis from the chart and set properties to this object.
ChartCursorSettings sets settings for chart cursor. If you change a property after the chart is initialized, you should call stockChart.validateNow() method. If there is no specified value, default value of ChartCursor class will be used.
You can add it if you have more than one data set and want users to be able to select/compare them.
An object of class AmStockChart.
## Not run: # --- method 'initialize' new("AmStockChart", theme = "dark") ## End(Not run) ## Not run: # --- constructor amStockChart() ## End(Not run) library(pipeR) ## Not run: # Dummy example amStockChart() %>>% setBalloon(gridPosition = "start") ## End(Not run) ## Not run: # Dummy example setCategoryAxesSettings(.Object = amStockChart(), gridPosition = "start") ## End(Not run) ## Not run: # Dummy example setChartCursorSettings(.Object = amStockChart(), oneBallOnly = TRUE) ## End(Not run) ## Not run: # Dummy example amchart <- setChartScrollbarSettings(.Object = amStockChart(), enabled = TRUE) print(amchart) # equivalent to: chartScrollbarSettings_obj <- chartScrollbarSettings() setChartScrollbarSettings(.Object = amStockChart(), chartScrollbarSettings = chartScrollbarSettings_obj) ## End(Not run) ## Not run: # Dummy example comparedDataSets_ls <- list(dataSet(compared = TRUE), dataSet(compared = TRUE)) setComparedDataSets(.Object = amStockChart(), comparedDataSets = comparedDataSets_ls) ## End(Not run) ## Not run: # Dummy example addComparedDataSet(.Object = amStockChart(), compared = TRUE) ## End(Not run) ## Not run: # Dummy example dataSets_ls <- list(dataSet(compared = FALSE), dataSet(compared = FALSE)) setDataSets(.Object = amStockChart(), dataSets = dataSets_ls) ## End(Not run) ## Not run: # Dummy example addDataSet(.Object = amStockChart(), compared = FALSE) # equivalent to: dataSet_obj <- dataSet(compared = FALSE) addDataSet(.Object = amStockChart(), dataSet = dataSet_obj) ## End(Not run) ## Not run: # Dummy example print(setDataSetSelector(.Object = amStockChart(), width = 180)) # equivalent to: dataSetSelector_obj <- dataSetSelector(width = 180) print(setDataSetSelector(.Object = amStockChart(), dataSetSelector = dataSetSelector_obj)) ## End(Not run) ## Not run: # Dummy example setLegendSettings(.Object = amStockChart(), equalWidths = TRUE) ## End(Not run) ## Not run: # Dummy example setMainDataSet(.Object = amStockChart(), showInCompare = TRUE) ## End(Not run) ## Not run: # Dummy example panels_ls <- list(stockPanel(compared = TRUE), stockPanel(compared = TRUE)) setPanels(.Object = amStockChart(), panels = panels_ls) ## End(Not run) ## Not run: # Dummy example chart <- addPanel(.Object = amStockChart(), allowTurningOff = TRUE); print(chart) # equivalent to: panel_obj <- panel(allowTurningOff = TRUE) addPanel(.Object = amStockChart(), panel = panel_obj) ## End(Not run) ## Not run: # Dummy example setPanelsSettings(.Object = amStockChart(), backgroundAlpha = 0) ## End(Not run) ## Not run: # Dummy example setPeriodSelector(.Object = amStockChart(), dateFormat = "DD-MM-YYYY") ## End(Not run) ## Not run: # Dummy example setStockEventsSettings(.Object = amStockChart(), backgroundAlpha = 1) ## End(Not run) ## Not run: # Dummy example setValueAxesSettings(.Object = amStockChart(), autoGridCount = "TRUE") ## End(Not run)
## Not run: # --- method 'initialize' new("AmStockChart", theme = "dark") ## End(Not run) ## Not run: # --- constructor amStockChart() ## End(Not run) library(pipeR) ## Not run: # Dummy example amStockChart() %>>% setBalloon(gridPosition = "start") ## End(Not run) ## Not run: # Dummy example setCategoryAxesSettings(.Object = amStockChart(), gridPosition = "start") ## End(Not run) ## Not run: # Dummy example setChartCursorSettings(.Object = amStockChart(), oneBallOnly = TRUE) ## End(Not run) ## Not run: # Dummy example amchart <- setChartScrollbarSettings(.Object = amStockChart(), enabled = TRUE) print(amchart) # equivalent to: chartScrollbarSettings_obj <- chartScrollbarSettings() setChartScrollbarSettings(.Object = amStockChart(), chartScrollbarSettings = chartScrollbarSettings_obj) ## End(Not run) ## Not run: # Dummy example comparedDataSets_ls <- list(dataSet(compared = TRUE), dataSet(compared = TRUE)) setComparedDataSets(.Object = amStockChart(), comparedDataSets = comparedDataSets_ls) ## End(Not run) ## Not run: # Dummy example addComparedDataSet(.Object = amStockChart(), compared = TRUE) ## End(Not run) ## Not run: # Dummy example dataSets_ls <- list(dataSet(compared = FALSE), dataSet(compared = FALSE)) setDataSets(.Object = amStockChart(), dataSets = dataSets_ls) ## End(Not run) ## Not run: # Dummy example addDataSet(.Object = amStockChart(), compared = FALSE) # equivalent to: dataSet_obj <- dataSet(compared = FALSE) addDataSet(.Object = amStockChart(), dataSet = dataSet_obj) ## End(Not run) ## Not run: # Dummy example print(setDataSetSelector(.Object = amStockChart(), width = 180)) # equivalent to: dataSetSelector_obj <- dataSetSelector(width = 180) print(setDataSetSelector(.Object = amStockChart(), dataSetSelector = dataSetSelector_obj)) ## End(Not run) ## Not run: # Dummy example setLegendSettings(.Object = amStockChart(), equalWidths = TRUE) ## End(Not run) ## Not run: # Dummy example setMainDataSet(.Object = amStockChart(), showInCompare = TRUE) ## End(Not run) ## Not run: # Dummy example panels_ls <- list(stockPanel(compared = TRUE), stockPanel(compared = TRUE)) setPanels(.Object = amStockChart(), panels = panels_ls) ## End(Not run) ## Not run: # Dummy example chart <- addPanel(.Object = amStockChart(), allowTurningOff = TRUE); print(chart) # equivalent to: panel_obj <- panel(allowTurningOff = TRUE) addPanel(.Object = amStockChart(), panel = panel_obj) ## End(Not run) ## Not run: # Dummy example setPanelsSettings(.Object = amStockChart(), backgroundAlpha = 0) ## End(Not run) ## Not run: # Dummy example setPeriodSelector(.Object = amStockChart(), dateFormat = "DD-MM-YYYY") ## End(Not run) ## Not run: # Dummy example setStockEventsSettings(.Object = amStockChart(), backgroundAlpha = 1) ## End(Not run) ## Not run: # Dummy example setValueAxesSettings(.Object = amStockChart(), autoGridCount = "TRUE") ## End(Not run)
Initializes or update a CategoryAxis.
## S4 method for signature 'CategoryAxis' initialize(.Object, gridPosition, guides, ...) categoryAxis(gridPosition, ...) setGridPosition(.Object, gridPosition) ## S4 method for signature 'CategoryAxis,character' setGridPosition(.Object, gridPosition)
## S4 method for signature 'CategoryAxis' initialize(.Object, gridPosition, guides, ...) categoryAxis(gridPosition, ...) setGridPosition(.Object, gridPosition) ## S4 method for signature 'CategoryAxis,character' setGridPosition(.Object, gridPosition)
.Object |
|
gridPosition |
|
guides |
|
... |
Other properties. |
guides <- list(guide(fillAlpha = .4, adjustBorderColor = TRUE), guide(fillAlpha = .4, adjustBorderColor = TRUE)) new("CategoryAxis", gridPosition = "start", gridThickness = 1, guides = guides) ## Not run: new("CategoryAxis") new("CategoryAxis", gridPosition = "start", 1) # 1 is not take into account ## End(Not run) categoryAxis(gridPosition = "start", adjustBorderColor = TRUE) setGridPosition(.Object = categoryAxis(), gridPosition = "start")
guides <- list(guide(fillAlpha = .4, adjustBorderColor = TRUE), guide(fillAlpha = .4, adjustBorderColor = TRUE)) new("CategoryAxis", gridPosition = "start", gridThickness = 1, guides = guides) ## Not run: new("CategoryAxis") new("CategoryAxis", gridPosition = "start", 1) # 1 is not take into account ## End(Not run) categoryAxis(gridPosition = "start", adjustBorderColor = TRUE) setGridPosition(.Object = categoryAxis(), gridPosition = "start")
Initializes or updates a ChartCursor.
## S4 method for signature 'ChartCursor' initialize(.Object, oneBalloonOnly, valueLineAxis, ...) chartCursor(animationDuration = 0.3, oneBalloonOnly, valueLineAxis, ...) setOneBalloonOnly(.Object, oneBalloonOnly) ## S4 method for signature 'ChartCursor,logical' setOneBalloonOnly(.Object, oneBalloonOnly) setValueLineAxis(.Object, valueLineAxis = NULL, ...) ## S4 method for signature 'ChartCursor,ValueAxisOrCharacterOrMissing' setValueLineAxis(.Object, valueLineAxis = NULL, ...)
## S4 method for signature 'ChartCursor' initialize(.Object, oneBalloonOnly, valueLineAxis, ...) chartCursor(animationDuration = 0.3, oneBalloonOnly, valueLineAxis, ...) setOneBalloonOnly(.Object, oneBalloonOnly) ## S4 method for signature 'ChartCursor,logical' setOneBalloonOnly(.Object, oneBalloonOnly) setValueLineAxis(.Object, valueLineAxis = NULL, ...) ## S4 method for signature 'ChartCursor,ValueAxisOrCharacterOrMissing' setValueLineAxis(.Object, valueLineAxis = NULL, ...)
.Object |
|
oneBalloonOnly |
|
valueLineAxis |
ValueAxis. If you set valueLineBalloonEnabled to TRUE, but you have more than one axis, you can use this property to indicate which axis should display balloon. |
... |
other properties of ChartCursor. Run : api("ChartCursor") for more information. |
animationDuration |
|
(updated) .Object of class ChartCursor.
new("ChartCursor", oneBalloonOnly = TRUE) chartCursor() chartCursor(oneBalloonOnly = TRUE) setOneBalloonOnly(.Object = chartCursor(), oneBalloonOnly = TRUE) setValueLineAxis(.Object = chartCursor(), id = "valueAxis1", title = "Hello !", axisTitleOffset = 12) # equivalent to: valueLineAxis_obj <- valueAxis(id = "valueAxis1", title = "Hello !", axisTitleOffset = 12) setValueLineAxis(.Object = chartCursor(), valueLineAxis = valueLineAxis_obj) # or iff 'valueLineAxis_obj' has already been added to the chart: setValueLineAxis(.Object = chartCursor(), valueLineAxis = "valueAxis1")
new("ChartCursor", oneBalloonOnly = TRUE) chartCursor() chartCursor(oneBalloonOnly = TRUE) setOneBalloonOnly(.Object = chartCursor(), oneBalloonOnly = TRUE) setValueLineAxis(.Object = chartCursor(), id = "valueAxis1", title = "Hello !", axisTitleOffset = 12) # equivalent to: valueLineAxis_obj <- valueAxis(id = "valueAxis1", title = "Hello !", axisTitleOffset = 12) setValueLineAxis(.Object = chartCursor(), valueLineAxis = valueLineAxis_obj) # or iff 'valueLineAxis_obj' has already been added to the chart: setValueLineAxis(.Object = chartCursor(), valueLineAxis = "valueAxis1")
ChartScrollbarSettings sets settings for chart scrollbar.
If you change a property after the chart is initialized,
you should call stockChart.validateNow() method.
If there is no default value specified, default value of ChartScrollbar class will be used.
Run api("ChartScrollbarSettings")
for more informations.
## S4 method for signature 'ChartScrollbar' initialize(.Object, graph, enabled, ...) chartScrollbar(graph, enabled = TRUE, ...) chartScrollbarSettings(graph, enabled = TRUE, ...) ## S4 method for signature 'ChartScrollbar,AmGraphOrCharacterOrMissing' setGraph(.Object, graph = NULL, ...) setEnabled(.Object, enabled) ## S4 method for signature 'ChartScrollbar,logical' setEnabled(.Object, enabled)
## S4 method for signature 'ChartScrollbar' initialize(.Object, graph, enabled, ...) chartScrollbar(graph, enabled = TRUE, ...) chartScrollbarSettings(graph, enabled = TRUE, ...) ## S4 method for signature 'ChartScrollbar,AmGraphOrCharacterOrMissing' setGraph(.Object, graph = NULL, ...) setEnabled(.Object, enabled) ## S4 method for signature 'ChartScrollbar,logical' setEnabled(.Object, enabled)
.Object |
|
graph |
AmGraph. Specifies which graph will be displayed in the scrollbar. |
enabled |
|
... |
other properties of ChartScrollbar. Run : api("ChartScrollbar") for more information. |
new("ChartScrollbar", graph = "g1") new("ChartScrollbar", graph = amGraph(test = 1)) chartScrollbar() chartScrollbar(enabled = TRUE) chartScrollbar() chartScrollbar(enabled = TRUE) # chartScrollbar with default graph setGraph(.Object = chartScrollbar()) # example with arguments setGraph(.Object = chartScrollbar(), id = "graph1", balloonText = "performance") # equivalent to: graph_obj <- amGraph(id = "graph1", balloonText = "performance") (chartScrollbar_obj <- setGraph(.Object = chartScrollbar(), graph = graph_obj)) # or, iff graph_obj has alreadey been added to the chart: setGraph(.Object = chartScrollbar(), graph = "graph1") # --- setEnabled(.Object = chartScrollbar(), enabled = TRUE)
new("ChartScrollbar", graph = "g1") new("ChartScrollbar", graph = amGraph(test = 1)) chartScrollbar() chartScrollbar(enabled = TRUE) chartScrollbar() chartScrollbar(enabled = TRUE) # chartScrollbar with default graph setGraph(.Object = chartScrollbar()) # example with arguments setGraph(.Object = chartScrollbar(), id = "graph1", balloonText = "performance") # equivalent to: graph_obj <- amGraph(id = "graph1", balloonText = "performance") (chartScrollbar_obj <- setGraph(.Object = chartScrollbar(), graph = graph_obj)) # or, iff graph_obj has alreadey been added to the chart: setGraph(.Object = chartScrollbar(), graph = "graph1") # --- setEnabled(.Object = chartScrollbar(), enabled = TRUE)
Uses the constructors to create the object with its properties or updates an existing one with the setters.
## S4 method for signature 'DataSet' initialize( .Object, compared = FALSE, dataProvider, fieldMappings, stockEvents, ... ) dataSet(compared = FALSE, dataProvider, fieldMappings, stockEvents, ...) ## S4 method for signature 'DataSet,ANY,ANY' setDataProvider(.Object, dataProvider, keepNA = TRUE) setFieldMappings(.Object, fieldMappings) ## S4 method for signature 'DataSet,list' setFieldMappings(.Object, fieldMappings) addFieldMapping(.Object, ...) ## S4 method for signature 'DataSet' addFieldMapping(.Object, ...) setStockEvents(.Object, stockEvents) ## S4 method for signature 'DataSet,list' setStockEvents(.Object, stockEvents) addStockEvent(.Object, stockEvent = NULL, ...) ## S4 method for signature 'DataSet,StockEventOrMissing' addStockEvent(.Object, stockEvent = NULL, ...)
## S4 method for signature 'DataSet' initialize( .Object, compared = FALSE, dataProvider, fieldMappings, stockEvents, ... ) dataSet(compared = FALSE, dataProvider, fieldMappings, stockEvents, ...) ## S4 method for signature 'DataSet,ANY,ANY' setDataProvider(.Object, dataProvider, keepNA = TRUE) setFieldMappings(.Object, fieldMappings) ## S4 method for signature 'DataSet,list' setFieldMappings(.Object, fieldMappings) addFieldMapping(.Object, ...) ## S4 method for signature 'DataSet' addFieldMapping(.Object, ...) setStockEvents(.Object, stockEvents) ## S4 method for signature 'DataSet,list' setStockEvents(.Object, stockEvents) addStockEvent(.Object, stockEvent = NULL, ...) ## S4 method for signature 'DataSet,StockEventOrMissing' addStockEvent(.Object, stockEvent = NULL, ...)
.Object |
|
compared |
|
dataProvider |
|
fieldMappings |
|
stockEvents |
|
... |
other properties of DataSet. |
keepNA |
|
stockEvent |
StockEvent.
Argument for method |
(updated) DataSet object
new("DataSet") dataSet(categoryField = "categoryField") setDataProvider(.Object = dataSet(), data.frame(key = c("FR", "US"), value = c(20,10))) dataset <- addFieldMapping(.Object = dataSet(), fieldMappings = list(fromField ="val1", toField ="value")) print(dataset) dataset <- addFieldMapping(.Object = dataSet(), fromField ="val1", toField ="value") print(dataset) addStockEvent(.Object = dataSet(), backgroundAlpha = 1, backgroundColor = "#DADADA") # equivalent to: stockEvent_obj <- stockEvent(backgroundAlpha = 1, backgroundColor = "#DADADA") chart <- addStockEvent(.Object = dataSet(), stockEvent = stockEvent_obj); print(chart)
new("DataSet") dataSet(categoryField = "categoryField") setDataProvider(.Object = dataSet(), data.frame(key = c("FR", "US"), value = c(20,10))) dataset <- addFieldMapping(.Object = dataSet(), fieldMappings = list(fromField ="val1", toField ="value")) print(dataset) dataset <- addFieldMapping(.Object = dataSet(), fromField ="val1", toField ="value") print(dataset) addStockEvent(.Object = dataSet(), backgroundAlpha = 1, backgroundColor = "#DADADA") # equivalent to: stockEvent_obj <- stockEvent(backgroundAlpha = 1, backgroundColor = "#DADADA") chart <- addStockEvent(.Object = dataSet(), stockEvent = stockEvent_obj); print(chart)
Use the constructors to create the object with its properties or update an existing one with the setters.
## S4 method for signature 'DataSetSelector' initialize(.Object, position, ...) dataSetSelector(position, ...) setPosition(.Object, position) ## S4 method for signature 'DataSetSelector,character' setPosition(.Object, position)
## S4 method for signature 'DataSetSelector' initialize(.Object, position, ...) dataSetSelector(position, ...) setPosition(.Object, position) ## S4 method for signature 'DataSetSelector,character' setPosition(.Object, position)
.Object |
|
position |
|
... |
other properties of DataSetSelector. |
(updated) DataSetSelector.
new("DataSetSelector", size = 10) dataSetSelector(position = "left") setPosition(.Object = dataSetSelector(), position = "left")
new("DataSetSelector", size = 10) dataSetSelector(position = "left") setPosition(.Object = dataSetSelector(), position = "left")
Uses the constructor to create the object with its properties or update an existing one with the setters.
## S4 method for signature 'GaugeArrow' initialize(.Object, alpha = 1, axis, ...) gaugeArrow(alpha = 1, axis, ...) setAxis(.Object, axis = NULL, ...) ## S4 method for signature 'GaugeArrow,GaugeAxisOrCharacterOrMissing' setAxis(.Object, axis = NULL, ...)
## S4 method for signature 'GaugeArrow' initialize(.Object, alpha = 1, axis, ...) gaugeArrow(alpha = 1, axis, ...) setAxis(.Object, axis = NULL, ...) ## S4 method for signature 'GaugeArrow,GaugeAxisOrCharacterOrMissing' setAxis(.Object, axis = NULL, ...)
.Object |
|
alpha |
|
axis |
GaugeAxis. Axis of the arrow. You can use reference to the axis or id of the axis. If you don't set any axis, the first axis of the chart will be used. |
... |
other properties of GaugeArrow. |
(updated) .Object of class GaugeArrow.
# --- method initialize new("GaugeArrow", alpha = 2) # --- constructor gaugeArrow(value = 10) # -- update 'axis' property setAxis(.Object = gaugeArrow(), id = "axis1", startValue = 0, endValue = 100, valueInterval = 10) # equivalent to: axis_obj <- gaugeAxis(id = "axis1", startValue = 0, endValue = 100, valueInterval = 10) setAxis(.Object = gaugeArrow(), axis = axis_obj) # or, iff, 'axis_obj' has already been added to the chart setAxis(.Object = gaugeArrow(), axis = "axis1")
# --- method initialize new("GaugeArrow", alpha = 2) # --- constructor gaugeArrow(value = 10) # -- update 'axis' property setAxis(.Object = gaugeArrow(), id = "axis1", startValue = 0, endValue = 100, valueInterval = 10) # equivalent to: axis_obj <- gaugeAxis(id = "axis1", startValue = 0, endValue = 100, valueInterval = 10) setAxis(.Object = gaugeArrow(), axis = axis_obj) # or, iff, 'axis_obj' has already been added to the chart setAxis(.Object = gaugeArrow(), axis = "axis1")
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'GaugeAxis' initialize(.Object, axisAlpha = 1, bands, ...) gaugeAxis(axisAlpha = 1, bands, ...) setBands(.Object, bands) ## S4 method for signature 'GaugeAxis,list' setBands(.Object, bands) addBand(.Object, band = NULL, ...) ## S4 method for signature 'GaugeAxis,GaugeBandOrMissing' addBand(.Object, band = NULL, ...)
## S4 method for signature 'GaugeAxis' initialize(.Object, axisAlpha = 1, bands, ...) gaugeAxis(axisAlpha = 1, bands, ...) setBands(.Object, bands) ## S4 method for signature 'GaugeAxis,list' setBands(.Object, bands) addBand(.Object, band = NULL, ...) ## S4 method for signature 'GaugeAxis,GaugeBandOrMissing' addBand(.Object, band = NULL, ...)
.Object |
|
axisAlpha |
|
bands |
|
... |
other properties of GaugeAxis. |
band |
GaugeBand.
Argument for method |
# --- method initialize new("GaugeAxis", alpha = 1) # -- constructor gaugeAxis() # -- update 'bands' at once bands <- list(gaugeBand(startValue = 70, endValue = 90), gaugeBand(startValue = 40, endValue = 60)) gaugeAxis(bands = bands) # --- add 'band' one by one one addBand(.Object = gaugeAxis(), startValue = 0, endValue = 100) # equivalent to gaugeBand_obj <- gaugeBand(startValue = 0, endValue = 100) addBand(.Object = gaugeAxis(), band = gaugeBand_obj)
# --- method initialize new("GaugeAxis", alpha = 1) # -- constructor gaugeAxis() # -- update 'bands' at once bands <- list(gaugeBand(startValue = 70, endValue = 90), gaugeBand(startValue = 40, endValue = 60)) gaugeAxis(bands = bands) # --- add 'band' one by one one addBand(.Object = gaugeAxis(), startValue = 0, endValue = 100) # equivalent to gaugeBand_obj <- gaugeBand(startValue = 0, endValue = 100) addBand(.Object = gaugeAxis(), band = gaugeBand_obj)
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'GaugeBand' initialize(.Object, alpha = 1, id, ...) gaugeBand(alpha = 1, id, ...) setID(.Object, id) ## S4 method for signature 'GaugeBand' setID(.Object, id)
## S4 method for signature 'GaugeBand' initialize(.Object, alpha = 1, id, ...) gaugeBand(alpha = 1, id, ...) setID(.Object, id) ## S4 method for signature 'GaugeBand' setID(.Object, id)
.Object |
GaugeBand (or "GaugeBand" for initialize). |
alpha |
|
id |
|
... |
other properties of GaugeBand. |
(updated) .Object of class GaugeBand.
# --- method 'initialize' new("GaugeBand") # --- constructor gaugeBand(alpha = 2, id = "band2") # --- set the 'id' setID(.Object = gaugeBand(), id = "1")
# --- method 'initialize' new("GaugeBand") # --- constructor gaugeBand(alpha = 2, id = "band2") # --- set the 'id' setID(.Object = gaugeBand(), id = "1")
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'Guide' initialize(.Object, fillAlpha, valueAxis, value, ...) guide(fillAlpha, valueAxis, value, ...) setFillAlpha(.Object, fillAlpha) ## S4 method for signature 'Guide,numeric' setFillAlpha(.Object, fillAlpha) ## S4 method for signature 'Guide,ValueAxisOrCharacterOrMissing' setValueAxis(.Object, valueAxis = NULL, ...)
## S4 method for signature 'Guide' initialize(.Object, fillAlpha, valueAxis, value, ...) guide(fillAlpha, valueAxis, value, ...) setFillAlpha(.Object, fillAlpha) ## S4 method for signature 'Guide,numeric' setFillAlpha(.Object, fillAlpha) ## S4 method for signature 'Guide,ValueAxisOrCharacterOrMissing' setValueAxis(.Object, valueAxis = NULL, ...)
.Object |
|
fillAlpha |
|
valueAxis |
ValueAxis class. As you can add guides directly to the chart, you might need to specify which value axis should be used. |
value |
|
... |
other properties of Guide. |
# --- method initialize new("Guide", fillAlpha = 0.1, gridThickness = 1, value = 1) # --- constructor guide(fillAlpha = .4, value = 1) guide(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) setFillAlpha(.Object = guide(), fillAlpha = 1) valueAxis_obj <- valueAxis(test = "foo") setValueAxis(.Object = guide(), valueAxis = valueAxis_obj)
# --- method initialize new("Guide", fillAlpha = 0.1, gridThickness = 1, value = 1) # --- constructor guide(fillAlpha = .4, value = 1) guide(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) setFillAlpha(.Object = guide(), fillAlpha = 1) valueAxis_obj <- valueAxis(test = "foo") setValueAxis(.Object = guide(), valueAxis = valueAxis_obj)
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'Label' initialize(.Object, text, bold, x, y, ...) label(text, bold, x, y, ...) setBold(.Object, bold) ## S4 method for signature 'Label,logical' setBold(.Object, bold) ## S4 method for signature 'Label,character' setText(.Object, text) setX(.Object, x) ## S4 method for signature 'Label,numericOrCharacter' setX(.Object, x) setY(.Object, y) ## S4 method for signature 'Label,numericOrCharacter' setY(.Object, y)
## S4 method for signature 'Label' initialize(.Object, text, bold, x, y, ...) label(text, bold, x, y, ...) setBold(.Object, bold) ## S4 method for signature 'Label,logical' setBold(.Object, bold) ## S4 method for signature 'Label,character' setText(.Object, text) setX(.Object, x) ## S4 method for signature 'Label,numericOrCharacter' setX(.Object, x) setY(.Object, y) ## S4 method for signature 'Label,numericOrCharacter' setY(.Object, y)
.Object |
|
text |
|
bold |
|
x |
|
y |
|
... |
other properties of Label. |
(updated) .Object of class Label.
# --- method initialize new("Label", x = 10) # --- constructor label(text = "bonjour") label(text = "Male", x = "28%", y = "97%") # --- update property 'bold' setBold(.Object = label(), bold = TRUE) # --- update 'text' setText(.Object = label(), text = "Bonjour") # --- update 'x' setX(.Object = label(), x = 16) # --- update 'y' setY(.Object = label(), y = 16)
# --- method initialize new("Label", x = 10) # --- constructor label(text = "bonjour") label(text = "Male", x = "28%", y = "97%") # --- update property 'bold' setBold(.Object = label(), bold = TRUE) # --- update 'text' setText(.Object = label(), text = "Bonjour") # --- update 'x' setX(.Object = label(), x = 16) # --- update 'y' setY(.Object = label(), y = 16)
Uses the constructors to create the object with its properties or update an existing one with the setters.
## S4 method for signature 'PeriodSelector' initialize(.Object, periods, ...) periodSelector(periods, ...) addPeriod(.Object, ...) ## S4 method for signature 'PeriodSelector' addPeriod(.Object, ...)
## S4 method for signature 'PeriodSelector' initialize(.Object, periods, ...) periodSelector(periods, ...) addPeriod(.Object, ...) ## S4 method for signature 'PeriodSelector' addPeriod(.Object, ...)
.Object |
|
periods |
|
... |
other properties of PeriodSelector. |
(updated) .Object of class PeriodSelector.
new( "PeriodSelector") periodSelector(fillAlpha = .4, value = 1) periodSelector(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) addPeriod(.Object = periodSelector(), period = "MM", selected = TRUE, count = 1, label= "1 month")
new( "PeriodSelector") periodSelector(fillAlpha = .4, value = 1) periodSelector(fillAlpha = .4, adjustBorderColor = TRUE, gridThickness = 1) addPeriod(.Object = periodSelector(), period = "MM", selected = TRUE, count = 1, label= "1 month")
Use the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'StockEvent' initialize(.Object, backgroundAlpha = 1, stockGraph, ...) stockEvent(backgroundAlpha = 1, stockGraph, ...) setStockGraph(.Object, stockGraph = NULL, ...) ## S4 method for signature 'StockEvent,AmGraphOrCharacterOrMissing' setStockGraph(.Object, stockGraph = NULL, ...)
## S4 method for signature 'StockEvent' initialize(.Object, backgroundAlpha = 1, stockGraph, ...) stockEvent(backgroundAlpha = 1, stockGraph, ...) setStockGraph(.Object, stockGraph = NULL, ...) ## S4 method for signature 'StockEvent,AmGraphOrCharacterOrMissing' setStockGraph(.Object, stockGraph = NULL, ...)
.Object |
|
backgroundAlpha |
|
stockGraph |
AmGraph created with stockGraph(*). This is the graph on which event will be displayed. You can use a reference to the stock graph object or id of the graph. |
... |
other properties of StockEvent. |
(updated) argument .Object of class StockEvent.
new("StockEvent") stockEvent() setStockGraph(.Object = stockEvent(), id = "stockGraph1", balloonText = "balloonText") # equivalent to: stockGraph_obj <- stockGraph(id = "stockGraph1", balloonText = "balloonText") setStockGraph(.Object = stockEvent(), stockGraph = stockGraph_obj) # if stockGraph_obj has already been added to the chart: setStockGraph(.Object = stockEvent(), stockGraph = "stockGraph1")
new("StockEvent") stockEvent() setStockGraph(.Object = stockEvent(), id = "stockGraph1", balloonText = "balloonText") # equivalent to: stockGraph_obj <- stockGraph(id = "stockGraph1", balloonText = "balloonText") setStockGraph(.Object = stockEvent(), stockGraph = stockGraph_obj) # if stockGraph_obj has already been added to the chart: setStockGraph(.Object = stockEvent(), stockGraph = "stockGraph1")
Use the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'StockPanel' initialize( .Object, allLabels, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, graph, guides, legend, theme, title, titles, trendLines, type, valueAxes, valueScrollbar, drawOnAxis, stockGraphs, stockLegend, ... ) stockPanel(...) panel(...) setDrawOnAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'StockPanel,ValueAxisOrCharacterOrMissing' setDrawOnAxis(.Object, valueAxis = NULL, ...) setStockGraphs(.Object, stockGraphs) ## S4 method for signature 'StockPanel,list' setStockGraphs(.Object, stockGraphs) addStockGraph(.Object, stockGraph = NULL, ...) ## S4 method for signature 'StockPanel,AmGraphOrMissing' addStockGraph(.Object, stockGraph = NULL, ...) setStockLegend(.Object, stockLegend = NULL, ...) ## S4 method for signature 'StockPanel,AmLegendOrMissing' setStockLegend(.Object, stockLegend = NULL, ...)
## S4 method for signature 'StockPanel' initialize( .Object, allLabels, axes, balloon, categoryAxis, categoryField, chartCursor, chartScrollbar, creditsPosition, dataProvider, graphs, graph, guides, legend, theme, title, titles, trendLines, type, valueAxes, valueScrollbar, drawOnAxis, stockGraphs, stockLegend, ... ) stockPanel(...) panel(...) setDrawOnAxis(.Object, valueAxis = NULL, ...) ## S4 method for signature 'StockPanel,ValueAxisOrCharacterOrMissing' setDrawOnAxis(.Object, valueAxis = NULL, ...) setStockGraphs(.Object, stockGraphs) ## S4 method for signature 'StockPanel,list' setStockGraphs(.Object, stockGraphs) addStockGraph(.Object, stockGraph = NULL, ...) ## S4 method for signature 'StockPanel,AmGraphOrMissing' addStockGraph(.Object, stockGraph = NULL, ...) setStockLegend(.Object, stockLegend = NULL, ...) ## S4 method for signature 'StockPanel,AmLegendOrMissing' setStockLegend(.Object, stockLegend = NULL, ...)
.Object |
|
allLabels |
|
axes |
|
balloon |
AmBalloon.
Creates the balloons (tooltips) of the chart.
It follows the mouse cursor when you roll-over the data items.
The framework automatically generates the instances you just have to adjust
the appearance to your needs.
Run |
categoryAxis |
CategoryAxis.
Read-only. Chart creates category axis itself.
If you want to change some properties,
you should get this axis from the chart and set properties to this object.
Run |
categoryField |
|
chartCursor |
ChartCursor.
Chart's cursor.
Run |
chartScrollbar |
ChartScrollbar.
Chart's scrollbar.
Run |
creditsPosition |
|
dataProvider |
|
graphs |
|
graph |
AmGraph.
Only valid for Gantt charts.
Gant chart actually creates multiple graphs (separate for each segment).
Properties of this graph are passed to each of the created graphs
- this allows you to control the look of segments.
Run |
guides |
|
legend |
AmLegend.
Legend of a chart.
Run |
theme |
|
title |
A title of a panel. Note, StockLegend should be added in order title to be displayed. |
titles |
|
trendLines |
|
type |
|
valueAxes |
|
valueScrollbar |
ChartScrollbar. Value scrollbar, enables scrolling value axes. |
drawOnAxis |
ValueAxis. Specifies on which value axis user can draw trend lines. Set drawingIconsEnabled to true if you want drawing icons to be visible. First value axis will be used if not set here. You can use a reference to the value axis object or id of value axis. |
stockGraphs |
|
stockLegend |
|
... |
other properties of StockPanel. |
valueAxis |
A ValueAxis for the property 'drawnOnAxis'. |
stockGraph |
AmGraph, created with stockGraph(...).
Argument for method |
(updated) StockPanel with given properties.
new("StockPanel", title = "Volume") stockPanel(stockLegend = amLegend(useGraphSettings = TRUE)) panel(creditsPosition = "top-right") panel(title = "top-right") valueAxis_obj <- valueAxis(id = "valueAxis1") setDrawOnAxis(.Object = stockPanel(), valueAxis = valueAxis_obj) setDrawOnAxis(.Object = stockPanel(), valueAxis = "valueAxis1") # --- stockGraphs <- list(stockGraph(comparable = TRUE), stockGraph(comparable = FALSE)) setStockGraphs(.Object = stockPanel(), stockGraphs = stockGraphs) stockPanel(stockGraphs = stockGraphs) # --- stock_panel <- addStockGraph(.Object = stockPanel(), comparable = FALSE); print(stock_panel) # or... stock_panel <- addStockGraph(.Object = stockPanel(), stockGraph = stockGraph(comparable = FALSE)) # --- setStockLegend(.Object = stockPanel(), valueTextRegular = "[[value]]") # equivalent to: stockLegend_obj <- stockLegend(valueTextRegular = "[[value]]") setStockLegend(.Object = stockPanel(), stockLegend = stockLegend_obj) # ---
new("StockPanel", title = "Volume") stockPanel(stockLegend = amLegend(useGraphSettings = TRUE)) panel(creditsPosition = "top-right") panel(title = "top-right") valueAxis_obj <- valueAxis(id = "valueAxis1") setDrawOnAxis(.Object = stockPanel(), valueAxis = valueAxis_obj) setDrawOnAxis(.Object = stockPanel(), valueAxis = "valueAxis1") # --- stockGraphs <- list(stockGraph(comparable = TRUE), stockGraph(comparable = FALSE)) setStockGraphs(.Object = stockPanel(), stockGraphs = stockGraphs) stockPanel(stockGraphs = stockGraphs) # --- stock_panel <- addStockGraph(.Object = stockPanel(), comparable = FALSE); print(stock_panel) # or... stock_panel <- addStockGraph(.Object = stockPanel(), stockGraph = stockGraph(comparable = FALSE)) # --- setStockLegend(.Object = stockPanel(), valueTextRegular = "[[value]]") # equivalent to: stockLegend_obj <- stockLegend(valueTextRegular = "[[value]]") setStockLegend(.Object = stockPanel(), stockLegend = stockLegend_obj) # ---
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'Title' initialize(.Object, text, size, ...) title(text, size, ...) amTitle(text, size, ...) ## S4 method for signature 'Title,character' setText(.Object, text) setSize(.Object, size) ## S4 method for signature 'Title,numeric' setSize(.Object, size)
## S4 method for signature 'Title' initialize(.Object, text, size, ...) title(text, size, ...) amTitle(text, size, ...) ## S4 method for signature 'Title,character' setText(.Object, text) setSize(.Object, size) ## S4 method for signature 'Title,numeric' setSize(.Object, size)
.Object |
|
text |
|
size |
|
... |
other properties of Title. |
(updated) Title
new("Title", size = 10) rAmCharts:::title(text = "Main", size = 10) rAmCharts:::title(text = "Main", bold = TRUE) amTitle(text = "Main", size = 10) amTitle(text = "Main", bold = TRUE) setText(.Object = amTitle(), text = "Bonjour") setSize(amTitle(), 16)
new("Title", size = 10) rAmCharts:::title(text = "Main", size = 10) rAmCharts:::title(text = "Main", bold = TRUE) amTitle(text = "Main", size = 10) amTitle(text = "Main", bold = TRUE) setText(.Object = amTitle(), text = "Bonjour") setSize(amTitle(), 16)
Uses the constructor to create the object or update an existing one with the setters.
## S4 method for signature 'TrendLine' initialize( .Object, initialValue, initialXValue, finalValue, finalXValue, valueAxis, valueAxisX, ... ) trendLine( .Object, initialValue, initialXValue, finalValue, finalXValue, valueAxis, valueAxisX, ... ) setInitialValue(.Object, initialValue) ## S4 method for signature 'TrendLine,numeric' setInitialValue(.Object, initialValue) setInitialXValue(.Object, initialXValue) ## S4 method for signature 'TrendLine,numeric' setInitialXValue(.Object, initialXValue) setFinalValue(.Object, finalValue) ## S4 method for signature 'TrendLine,numeric' setFinalValue(.Object, finalValue) setFinalXValue(.Object, finalXValue) ## S4 method for signature 'TrendLine,numeric' setFinalXValue(.Object, finalXValue) ## S4 method for signature 'TrendLine,ValueAxisOrCharacterOrMissing' setValueAxis(.Object, valueAxis = NULL, ...) setValueAxisX(.Object, valueAxisX = NULL, ...) ## S4 method for signature 'TrendLine,ValueAxisOrCharacterOrMissing' setValueAxisX(.Object, valueAxisX = NULL, ...)
## S4 method for signature 'TrendLine' initialize( .Object, initialValue, initialXValue, finalValue, finalXValue, valueAxis, valueAxisX, ... ) trendLine( .Object, initialValue, initialXValue, finalValue, finalXValue, valueAxis, valueAxisX, ... ) setInitialValue(.Object, initialValue) ## S4 method for signature 'TrendLine,numeric' setInitialValue(.Object, initialValue) setInitialXValue(.Object, initialXValue) ## S4 method for signature 'TrendLine,numeric' setInitialXValue(.Object, initialXValue) setFinalValue(.Object, finalValue) ## S4 method for signature 'TrendLine,numeric' setFinalValue(.Object, finalValue) setFinalXValue(.Object, finalXValue) ## S4 method for signature 'TrendLine,numeric' setFinalXValue(.Object, finalXValue) ## S4 method for signature 'TrendLine,ValueAxisOrCharacterOrMissing' setValueAxis(.Object, valueAxis = NULL, ...) setValueAxisX(.Object, valueAxisX = NULL, ...) ## S4 method for signature 'TrendLine,ValueAxisOrCharacterOrMissing' setValueAxisX(.Object, valueAxisX = NULL, ...)
.Object |
|
initialValue |
|
initialXValue |
|
finalValue |
|
finalXValue |
|
valueAxis |
ValueAxis. Value axis of the trend line. Will use first value axis of the chart if not set any. You can use a reference to the value axis object or id of value axis. |
valueAxisX |
ValueAxis. Used by XY chart only. X axis of trend line. Will use first X axis of the chart if not set any. You can use a reference to the value axis object or id of value axis. |
... |
other properties of TrendLine. |
(possibly updated) .Object of class TrendLine.
new("TrendLine", initialValue = 1, finalValue = 11) # Other example valueAxis <- valueAxis(title = "Hello !", axisTitleOffset = 12) new("TrendLine", valueAxis = valueAxis) trendLine(initialValue = 1, finalValue = 11) setInitialValue(.Object = trendLine(), initialValue = 16) setInitialXValue(.Object = trendLine(), initialXValue = 16) setFinalValue(.Object = trendLine(), finalValue = 16) setFinalXValue(.Object = trendLine(), finalXValue = 16) setValueAxis(.Object = trendLine(), id = "valueAxis-1", title = "Hello !", axisTitleOffset = 12) # equival to: valueAxis_obj <- valueAxis(id = "valueAxis-1", title = "Hello !", axisTitleOffset = 12) trendLine(valueAxis = valueAxis_obj) # or... trendLine(valueAxis = "valueAxis-1") # valid if and only if 'valueAxis_obj' has already been added to the chart setValueAxisX(.Object = trendLine(), id = "valueAxisX-1", title = "Hello !", axisTitleOffset = 12) # equival to: valueAxisX_obj <- valueAxis(id = "valueAxisX-1", title = "Hello !", axisTitleOffset = 12) trendLine(valueAxisX = valueAxisX_obj) # or... trendLine(valueAxisX = "valueAxisX-1") # valid if and only if 'valueAxisX_obj' has already been added to the chart
new("TrendLine", initialValue = 1, finalValue = 11) # Other example valueAxis <- valueAxis(title = "Hello !", axisTitleOffset = 12) new("TrendLine", valueAxis = valueAxis) trendLine(initialValue = 1, finalValue = 11) setInitialValue(.Object = trendLine(), initialValue = 16) setInitialXValue(.Object = trendLine(), initialXValue = 16) setFinalValue(.Object = trendLine(), finalValue = 16) setFinalXValue(.Object = trendLine(), finalXValue = 16) setValueAxis(.Object = trendLine(), id = "valueAxis-1", title = "Hello !", axisTitleOffset = 12) # equival to: valueAxis_obj <- valueAxis(id = "valueAxis-1", title = "Hello !", axisTitleOffset = 12) trendLine(valueAxis = valueAxis_obj) # or... trendLine(valueAxis = "valueAxis-1") # valid if and only if 'valueAxis_obj' has already been added to the chart setValueAxisX(.Object = trendLine(), id = "valueAxisX-1", title = "Hello !", axisTitleOffset = 12) # equival to: valueAxisX_obj <- valueAxis(id = "valueAxisX-1", title = "Hello !", axisTitleOffset = 12) trendLine(valueAxisX = valueAxisX_obj) # or... trendLine(valueAxisX = "valueAxisX-1") # valid if and only if 'valueAxisX_obj' has already been added to the chart
Creates a ValuesAxis or updates its properties.
## S4 method for signature 'ValueAxis' initialize(.Object, title, guides, ...) valueAxis(...) ## S4 method for signature 'ValueAxis,character' setTitle(.Object, title)
## S4 method for signature 'ValueAxis' initialize(.Object, title, guides, ...) valueAxis(...) ## S4 method for signature 'ValueAxis,character' setTitle(.Object, title)
.Object |
|
title |
|
guides |
|
... |
Other properties (depend of call function) |
guides <- list(guide(fillAlpha = .4), guide(fillAlpha = .5)) new("ValueAxis", title = "Hello !", gridThickness = 1, guides = guides) valueAxis(title = "Hello !", axisTitleOffset = 12) setTitle(.Object = valueAxis(), title = "Hello !")
guides <- list(guide(fillAlpha = .4), guide(fillAlpha = .5)) new("ValueAxis", title = "Hello !", gridThickness = 1, guides = guides) valueAxis(title = "Hello !", axisTitleOffset = 12) setTitle(.Object = valueAxis(), title = "Hello !")
Creates a label on the chart which can be placed anywhere, multiple can be assigned.
Run api("Label")
for more information and all avalaible properties.
bold
character
. Specifies if label is bold or not.
text
character
. Text of a title.
x
numeric
. X position of a label.
y
numeric
. Y position of a label.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Each S4 class implements the method to list its properties (usefull to update complex properties).
listProperties(.Object) ## S4 method for signature 'AmObject' listProperties(.Object)
listProperties(.Object) ## S4 method for signature 'AmObject' listProperties(.Object)
.Object |
any class object of the package |
A list containing all the chart's properties.
amChart(type = "serial")
amChart(type = "serial")
Defines the PeriodSelector properties.
periods
list
.
Period object has 4 properties - period, count, label and selected.
Possible period values are:
"ss" - seconds, "mm" - minutes, "hh" - hours, "DD" - days, "MM" - months and "YYYY" - years.
property "count" specifies how many periods this button will select.
"label" will be displayed on a button and "selected" is logical.
which specifies if this button is selected when chart is initialized or not.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
Object of class numeric
.
datastorm-open
Basic method to plot an AmChart
## S4 method for signature 'AmCharts' plot(x, y, width = "100%", height = NULL, background = "#ffffff", ...)
## S4 method for signature 'AmCharts' plot(x, y, width = "100%", height = NULL, background = "#ffffff", ...)
x |
|
y |
unused. |
width |
|
height |
|
background |
|
... |
Other properties. |
Plots an object of class AmChart
Display the object in the console.
## S4 method for signature 'AmObject' print(x, withDetail = TRUE, ...)
## S4 method for signature 'AmObject' print(x, withDetail = TRUE, ...)
x |
|
withDetail |
|
... |
Other properties. |
If the object possess a 'dataProvider' property, it will be hidden in the console. To see if it's correctly registered use '@dataProvider'.
print(new("AmChart", categoryField = "variables", type = "serial")) print(new("AmChart", categoryField = "variables", type = "serial"), withDetail = FALSE)
print(new("AmChart", categoryField = "variables", type = "serial")) print(new("AmChart", categoryField = "variables", type = "serial"), withDetail = FALSE)
This function need the base64enc
package to save image.
rAmChartsExportServerUI(id) rAmChartsExportServer( input, output, session, list_am_graph, path = shiny::reactive(tempdir()), mode = "single", progress = T, message = "Calculation in progress", detail = "This may take a while..." )
rAmChartsExportServerUI(id) rAmChartsExportServer( input, output, session, list_am_graph, path = shiny::reactive(tempdir()), mode = "single", progress = T, message = "Calculation in progress", detail = "This may take a while..." )
id |
character, used to specify namesapce, see |
input |
standard, |
output |
standard, |
session |
standard, |
list_am_graph |
named list, reactive expression with all amCharts to export
|
path |
character, directory. tempdir() by Defaut |
mode |
character, 'single' : graphics are rendered and saved one by one. 'multiple' all at same time |
progress |
boolean, set a progress bar or not ? |
message |
character, if progress, message. Defaut to "Calculation in progress" |
detail |
character, if progress, detail. Defaut to "This may take a while...' |
a reactive expression
## Not run: # ui rAmChartsExportServerUI("export_server_graphs") # server mult_amgraph <- reactive({ if(input$goSave > 0){ isolate({ list( list(graph = amPie(data = data_pie), name = "pie.jpg", height = "200px", width = "300px"), list(graph = amBarplot(x = "country", y = "visits", data = data_bar, main = "example") %>% setExport(), name = "bar.jpg", height = "600px") ) }) } else { NULL } }) callModule(rAmChartsExportServer, "export_server_graphs", mult_amgraph, reactive("/home/benoit/amchart_export")) ## End(Not run)
## Not run: # ui rAmChartsExportServerUI("export_server_graphs") # server mult_amgraph <- reactive({ if(input$goSave > 0){ isolate({ list( list(graph = amPie(data = data_pie), name = "pie.jpg", height = "200px", width = "300px"), list(graph = amBarplot(x = "country", y = "visits", data = data_bar, main = "example") %>% setExport(), name = "bar.jpg", height = "600px") ) }) } else { NULL } }) callModule(rAmChartsExportServer, "export_server_graphs", mult_amgraph, reactive("/home/benoit/amchart_export")) ## End(Not run)
Shiny module to render large time-series data with live server-client aggregation
rAmChartsTimeSeriesUI(id, width = "100%", height = "400px") rAmChartsTimeSeriesServer( input, output, session, data, col_date, col_series, maxPoints = shiny::reactive(600), tz = shiny::reactive("UTC"), ts = shiny::reactive(c("5 min", "10 min", "30 min", "hour", "3 hour", "12 hour", "day", "week", "month", "year")), fun_aggr = shiny::reactive("mean"), treat_missing = shiny::reactive(FALSE), maxgap = shiny::reactive(Inf), type_aggr = shiny::reactive("first"), na.rm = shiny::reactive(TRUE), main = shiny::reactive(""), ylab = shiny::reactive(""), color = shiny::reactive(c("#2E2EFE", "#31B404", "#FF4000", "#AEB404")), type = shiny::reactive(c("line")), bullet = shiny::reactive(NULL), bulletSize = shiny::reactive(2), linetype = shiny::reactive(c(0, 5, 10, 15, 20)), linewidth = shiny::reactive(c(1, 1, 1, 1, 1, 1)), fillAlphas = shiny::reactive(0), precision = shiny::reactive(1), connect = shiny::reactive(FALSE), export = shiny::reactive(FALSE), legend = shiny::reactive(TRUE), legendPosition = shiny::reactive("bottom"), legendHidden = shiny::reactive(FALSE), ZoomButton = shiny::reactive(data.frame(Unit = "MAX", multiple = 1, label = "All")), ZoomButtonPosition = shiny::reactive("bottom"), periodFieldsSelection = shiny::reactive(FALSE), scrollbar = shiny::reactive(TRUE), scrollbarPosition = shiny::reactive("bottom"), scrollbarHeight = shiny::reactive(40), scrollbarGraph = shiny::reactive(NULL), cursor = shiny::reactive(TRUE), cursorValueBalloonsEnabled = shiny::reactive(TRUE), creditsPosition = shiny::reactive("top-right"), group = shiny::reactive(NULL), dataDateFormat = shiny::reactive("YYYY-MM-DD JJ:NN:ss"), categoryBalloonDateFormats = shiny::reactive(list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "YYYY-MM"), list(period = "WW", format = "YYYY-MM-DD"), list(period = "DD", format = "YYYY-MM-DD"), list(period = "hh", format = "YYYY-MM-DD JJ:NN"), list(period = "mm", format = "YYYY-MM-DD JJ:NN"), list(period = "ss", format = "YYYY-MM-DD JJ:NN:ss"), list(period = "fff", format = "YYYY-MM-DD JJ:NN:ss"))), dateFormats = shiny::reactive(list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "MMM"), list(period = "WW", format = "MMM DD"), list(period = "DD", format = "MMM DD"), list(period = "hh", format = "JJ:NN"), list(period = "mm", format = "JJ:NN"), list(period = "ss", format = "JJ:NN:ss"), list(period = "fff", format = "JJ:NN:ss"))), thousandsSeparator = shiny::reactive(" "), decimalSeparator = shiny::reactive("."), balloonFontSize = shiny::reactive(10), balloonMaxWidth = shiny::reactive(400) )
rAmChartsTimeSeriesUI(id, width = "100%", height = "400px") rAmChartsTimeSeriesServer( input, output, session, data, col_date, col_series, maxPoints = shiny::reactive(600), tz = shiny::reactive("UTC"), ts = shiny::reactive(c("5 min", "10 min", "30 min", "hour", "3 hour", "12 hour", "day", "week", "month", "year")), fun_aggr = shiny::reactive("mean"), treat_missing = shiny::reactive(FALSE), maxgap = shiny::reactive(Inf), type_aggr = shiny::reactive("first"), na.rm = shiny::reactive(TRUE), main = shiny::reactive(""), ylab = shiny::reactive(""), color = shiny::reactive(c("#2E2EFE", "#31B404", "#FF4000", "#AEB404")), type = shiny::reactive(c("line")), bullet = shiny::reactive(NULL), bulletSize = shiny::reactive(2), linetype = shiny::reactive(c(0, 5, 10, 15, 20)), linewidth = shiny::reactive(c(1, 1, 1, 1, 1, 1)), fillAlphas = shiny::reactive(0), precision = shiny::reactive(1), connect = shiny::reactive(FALSE), export = shiny::reactive(FALSE), legend = shiny::reactive(TRUE), legendPosition = shiny::reactive("bottom"), legendHidden = shiny::reactive(FALSE), ZoomButton = shiny::reactive(data.frame(Unit = "MAX", multiple = 1, label = "All")), ZoomButtonPosition = shiny::reactive("bottom"), periodFieldsSelection = shiny::reactive(FALSE), scrollbar = shiny::reactive(TRUE), scrollbarPosition = shiny::reactive("bottom"), scrollbarHeight = shiny::reactive(40), scrollbarGraph = shiny::reactive(NULL), cursor = shiny::reactive(TRUE), cursorValueBalloonsEnabled = shiny::reactive(TRUE), creditsPosition = shiny::reactive("top-right"), group = shiny::reactive(NULL), dataDateFormat = shiny::reactive("YYYY-MM-DD JJ:NN:ss"), categoryBalloonDateFormats = shiny::reactive(list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "YYYY-MM"), list(period = "WW", format = "YYYY-MM-DD"), list(period = "DD", format = "YYYY-MM-DD"), list(period = "hh", format = "YYYY-MM-DD JJ:NN"), list(period = "mm", format = "YYYY-MM-DD JJ:NN"), list(period = "ss", format = "YYYY-MM-DD JJ:NN:ss"), list(period = "fff", format = "YYYY-MM-DD JJ:NN:ss"))), dateFormats = shiny::reactive(list(list(period = "YYYY", format = "YYYY"), list(period = "MM", format = "MMM"), list(period = "WW", format = "MMM DD"), list(period = "DD", format = "MMM DD"), list(period = "hh", format = "JJ:NN"), list(period = "mm", format = "JJ:NN"), list(period = "ss", format = "JJ:NN:ss"), list(period = "fff", format = "JJ:NN:ss"))), thousandsSeparator = shiny::reactive(" "), decimalSeparator = shiny::reactive("."), balloonFontSize = shiny::reactive(10), balloonMaxWidth = shiny::reactive(400) )
id |
character, used to specify namesapce, see |
width |
|
height |
|
input |
standard, |
output |
standard, |
session |
standard, |
data |
: data.frame to transform. |
col_date |
Date column name, default to "date". Must be "POSIXct" |
col_series |
Column name of quantitative variable(s) to be transformed. Default to setdiff(colnames(data), "date") |
maxPoints |
: Maximal number of rows in results |
tz |
: Timezone of result. Defaut to "UTC". |
ts |
All enabled aggregation. Default to c("5 min", "10 min", "30 min", "hour", "3 hour", "12 hour", "day", "week", "month", "year"). Can be a number, in seconds, or a character string containing one of "min", "hour", "day".... This can optionally be preceded by a positive integer and a space |
fun_aggr |
: Aggregation function to use ("min", "max", "sum", "mean", "first", "last", "minabs", "maxabs"). Default to "mean". |
treat_missing |
: Boolean. Default to FALSE
Whether or not to interpolate missing values ?
see |
maxgap |
When interpolate missing values with |
type_aggr |
|
na.rm |
: aggregation only. a logical value indicating whether NA values should be stripped before the computation proceeds. |
main |
|
ylab |
|
color |
|
type |
|
bullet |
|
bulletSize |
|
linetype |
|
linewidth |
|
fillAlphas |
|
precision |
|
connect |
|
export |
|
legend |
|
legendPosition |
|
legendHidden |
|
ZoomButton |
|
ZoomButtonPosition |
|
periodFieldsSelection |
|
scrollbar |
|
scrollbarPosition |
|
scrollbarHeight |
|
scrollbarGraph |
|
cursor |
|
cursorValueBalloonsEnabled |
|
creditsPosition |
|
group |
|
dataDateFormat |
|
categoryBalloonDateFormats |
|
dateFormats |
|
thousandsSeparator |
|
decimalSeparator |
|
balloonFontSize |
|
balloonMaxWidth |
|
a reactive expression with aggregate data and ts
## Not run: library(shiny) library(rAmCharts) library(data.table) # number of points n <- 1000000 data <- data.frame(date = seq(c(ISOdate(1999,12,31)), by = "5 min", length.out = n), value = rnorm(n, 100, 50), check.names = FALSE) # maximun of points in javascript max_points <- 1000 # Call module in UI ui <- fluidPage( rAmChartsTimeSeriesUI("ts_1", height = "600px"), h4(textOutput("ts")) ) # Define server server <- function(input, output) { # Call module in server res <- callModule(rAmChartsTimeSeriesServer, "ts_1", reactive(data), reactive("date"), reactive("value"), maxPoints = shiny::reactive(max_points), main = reactive("Example of rAmChartsTimeSeries module"), color = reactive("red"), periodFieldsSelection = reactive(TRUE) ) # show module return and print ts output$ts <- renderText({ print(res()) paste0("Current ts : ", res()$ts) }) } # Run the application shinyApp(ui = ui, server = server) ## End(Not run)
## Not run: library(shiny) library(rAmCharts) library(data.table) # number of points n <- 1000000 data <- data.frame(date = seq(c(ISOdate(1999,12,31)), by = "5 min", length.out = n), value = rnorm(n, 100, 50), check.names = FALSE) # maximun of points in javascript max_points <- 1000 # Call module in UI ui <- fluidPage( rAmChartsTimeSeriesUI("ts_1", height = "600px"), h4(textOutput("ts")) ) # Define server server <- function(input, output) { # Call module in server res <- callModule(rAmChartsTimeSeriesServer, "ts_1", reactive(data), reactive("date"), reactive("value"), maxPoints = shiny::reactive(max_points), main = reactive("Example of rAmChartsTimeSeries module"), color = reactive("red"), periodFieldsSelection = reactive(TRUE) ) # show module return and print ts output$ts <- renderText({ print(res()) paste0("Current ts : ", res()$ts) }) } # Run the application shinyApp(ui = ui, server = server) ## End(Not run)
Widget output function to use in Shiny.
renderAmCharts(expr, env = parent.frame(), quoted = FALSE)
renderAmCharts(expr, env = parent.frame(), quoted = FALSE)
expr |
an expression that generates an HTML widget. |
env |
the environment in which expr must be evaluated. |
quoted |
is expr a quoted expression (with quote()). This is useful if you want to save an expression into variable. |
See some examples in a shiny web application. Both 'am' functions and basic functions are illustrated.
runExamples()
runExamples()
## Not run: if (interactive()) runExamples() ## End(Not run)
## Not run: if (interactive()) runExamples() ## End(Not run)
These methods can be used both for AmChart and AmStockChart. There are general for some first-level properties.
setExport(.Object, enabled = TRUE, ...) ## S4 method for signature 'AmCharts,logicalOrMissing' setExport(.Object, enabled = TRUE, ...) setResponsive(.Object, enabled = TRUE, ...) ## S4 method for signature 'AmCharts,logicalOrMissing' setResponsive(.Object, enabled = TRUE, ...)
setExport(.Object, enabled = TRUE, ...) ## S4 method for signature 'AmCharts,logicalOrMissing' setExport(.Object, enabled = TRUE, ...) setResponsive(.Object, enabled = TRUE, ...) ## S4 method for signature 'AmCharts,logicalOrMissing' setResponsive(.Object, enabled = TRUE, ...)
.Object |
AmChart or AmStockChart. |
enabled |
|
... |
Other properties that can be used depending on the setter. |
## Not run: # Dummy examples setExport(amPlot(1:10)) setExport(amStockChart()) ## End(Not run) ## Not run: # Dummy examples setResponsive(amSerialChart()) setResponsive(amStockChart()) ## End(Not run)
## Not run: # Dummy examples setExport(amPlot(1:10)) setExport(amStockChart()) ## End(Not run) ## Not run: # Dummy examples setResponsive(amSerialChart()) setResponsive(amStockChart()) ## End(Not run)
Display the object in the console.
## S4 method for signature 'AmChart' show(object)
## S4 method for signature 'AmChart' show(object)
object |
If the object has a valid type, it will plot the chart. If not the method will trigger the method 'print'.
Display the object in the console.
## S4 method for signature 'AmObject' show(object)
## S4 method for signature 'AmObject' show(object)
object |
library(pipeR) amPieChart(valueField = "value", titleField = "key", backgroundColor = "#7870E8") %>>% setDataProvider(data.frame(key = c("FR", "US"), value = c(20,10))) %>>% setExport(position = "bottom-left")
library(pipeR) amPieChart(valueField = "value", titleField = "key", backgroundColor = "#7870E8") %>>% setDataProvider(data.frame(key = c("FR", "US"), value = c(20,10))) %>>% setExport(position = "bottom-left")
Display the object in the console.
## S4 method for signature 'AmStockChart' show(object)
## S4 method for signature 'AmStockChart' show(object)
object |
If the object has a valid type, it will plot the chart. If not the method will trigger the method 'print'.
StockEvent is an object which holds information about event (bullet). Values from StockEventsSettings will be used if not set. Stock event bullet's size depends on it's graphs fontSize. When user rolls-over, clicks or rolls-out of the event bullet, AmStockChart dispatches events.
Run api("StockEvent")
for more informations.
stockGraph
AmGraph containing properties of stockGraph. This is the graph on which event will be displayed. You can use a reference to the stock graph object or id of the graph.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Constructor used for AmStockChart
stockGraph(animationPlayed = FALSE, balloonText, title, type, valueField, ...)
stockGraph(animationPlayed = FALSE, balloonText, title, type, valueField, ...)
animationPlayed |
|
balloonText |
|
title |
|
type |
|
valueField |
|
... |
Other properties |
An object of class AmGraph.
# --- constructor stockGraph(balloonText = "balloonText",valueField = "value", animationPlayed = TRUE)
# --- constructor stockGraph(balloonText = "balloonText",valueField = "value", animationPlayed = TRUE)
This method is used for AmStockChart.
stockLegend(useGraphSettings, valueTextComparing = "[[percents.value]]%", ...)
stockLegend(useGraphSettings, valueTextComparing = "[[percents.value]]%", ...)
useGraphSettings |
|
valueTextComparing |
|
... |
Properties of AmLegend. See https://docs.amcharts.com/3/javascriptstockchart/StockLegend |
An AmLegend object
stockLegend(useGraphSettings = TRUE)
stockLegend(useGraphSettings = TRUE)
StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels.
Run api("StockPanel")
for more information and all avalaible properties.
drawOnAxis
ValueAxis. Specifies on which value axis user can draw trend lines. Set drawingIconsEnabled to TRUE if you want icons to be visible. First value axis will be used if not set here. You can use a reference to the value axis object or id of value axis.
stockGraphs
list
.
Each element must be have been created with stockGraph(*)
stockLegend
list
.
Each element must be have been created with stockLegend(*)
allLabels
list
of Label.
Example of label object, with all possible properties:
label(x = 20, y = 20, text = "this is label", align = "left", size = 12, color = "#CC0000",
alpha = 1, rotation = 0, bold = TRUE, url = "http=//www.amcharts.com").
Run api("Label")
for more informations.
arrows
list
of GaugeArrow. Only valid for gauge charts.
Run api("GaugeArrow")
for more informations.
axes
list
of GaugeAxis properties.
Only valid for gauge charts.
Run api("GaugeAxis")
for more informations.
balloon
AmBalloon
Creates the balloons (tooltips) of the chart.
It follows the mouse cursor when you roll-over the data items.
The framework automatically generates the instances you just have to adjust
the appearance to your needs.
Run api("AmBalloon")
for more informations.
categoryAxis
CategoryAxis. Read-only. Chart creates category axis itself. If you want to change some properties, you should get this axis from the chart and set properties to this object.
categoryField
character
.
Category field name indicates the chart the name of the field in your dataProvider object
which will be used for category axis values.
ChartCursor
ChartCursor.
Cursor of a chart.
Run api("ChartCursor")
for more informations.
ChartScrollbar
ChartScrollbar.
Chart's scrollbar.
Run api("ChartScrollbar")
for more informations.
creditsPosition
character
,
specifies position of the amCharts' website link.
Allowed values are: "top-left", "top-right", "bottom-left" and "bottom-right".
dataProvider
data.frame
, containing the data.
graphs
list
of AmGraph.
Creates the visualization of the data in following types: line, column, step line,
smoothed line, olhc and candlestick.
graph
AmGraph.
Only valid for Gantt charts.
Gant chart actually creates multiple graphs (separate for each segment).
Properties of this graph are passed to each of the created graphs
- this allows you to control the look of segments.
Run api("AmGraph")
for more informations.
guides
list
of Guide.
Instead of adding guides to the axes, you can push all of them to this array.
In case guide has category or date defined, it automatically will be assigned to the category axis.
Otherwise to first value axis, unless you specify a different valueAxes for the guide.
Run api("Guide")
for more informations.
legend
AmLegend.
Chart's legend.
Run api("AmLegend")
for more informations.
segmentsField
character
.
Segments field in your data provider.
Only valid for Gantt Charts.
subChartProperties
list
.
Only valid for Drilldown charts.
theme
character
.
Chart's theme. Config files of themes can be found in amcharts/themes/ folder.
See https://www.amcharts.com/docs/v3/tutorials/working-with-themes/.
titles
list
of Title.
Run api("Title")
for more informations.
trendLines
list
of TrendLine objects added to a chart.
You can add trend lines to a chart using this list or access already existing trend lines.
type
character
.
Possible types are: "serial", "pie", "radar", "xy", "radar", "funnel", "gauge", "stock".
See details about using argument type.
(type map is in development).
valueAxes
list
of ValueAxis.
Chart creates one value axis automatically,
so if you need only one value axis, you don't need to create it.
Run api("ValueAxis")
for more informations.
valueAxis
ValueAxis. Only valid for Gantt Charts. Set it's type to "date" if your data is date or time based.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
Run runShinyExamples()
for examples.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates a title on above the chart, multiple can be assigned.
Run api("Title")
for more informations and all avalaible properties.
text
character
, title's text.
size
numeric
, title's size.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
datastorm-open
Creates a trendline for amSerialChart and amXYChart charts which indicates the trend of your data or covers some different purposes. Multiple can be assigned.
Run api("TrendLine")
for more information and all avalaible properties.
finalValue
numeric
. Value at which trend line should end.
finalXValue
numeric
. Used by XY chart only. X value at which trend line should end.
initialValue
numeric
. Value from which trend line should start.
initialXValue
numeric
. Used by XY chart only.
X value from which trend line should start.
valueAxis
ValueAxis. Value axis of the trend line. Will use first value axis of the chart if not set any. You can use a reference to the value axis object or id of value axis.
valueAxisX
ValueAxis. Used by XY chart only. X axis of trend line. Will use first X axis of the chart if not set any. You can use a reference to the value axis object or id of value axis.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
otherProperties
list
,
containing other avalaible properties.
value
numeric
.
datastorm-open
Extension for ValueAxis to create an axis for amSerialChart, amRadarChart, amXYChart charts, multiple can be assigned. Gets automatically populated, one for amSerialChart and two for amXYChart charts, if none has been specified.
Run api("ValueAxis")
for more information and all avalaible properties.
title
character
. Title of the axis.
guides
list
.
listeners
list
containining the listeners to add to the object.
The list must be named as in the official API. Each element must be a character string.
See examples for details.
otherProperties
list
containing other avalaible properties not yet implemented in the package.
value
numeric
.
Guides belonging to this axis. Use addGuide method
datastorm-open