rAmCharts (version 1.1.2)

addListener: Methods of AmObject

Description

Methods of AmObject

Usage

addListener(.Object, name, expression)
"addListener"(.Object, name, expression)
setProperties(.Object, list, ...)
"setProperties"(.Object, list, ...)

Arguments

.Object
AmObject.
name
character containing the name of the listener.
expression
character containing the associated function event.
list
(Optional) list containing properties to set. The former properties will be overwritten.
...
Other properties

Value

The updated object of class AmChart.

Details

If the property is a class property, it will be overwritten if the attribute is non NULL

Examples

Run this code
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)
# For an AmChart
ls <- list(categoryAxis = list(gridPosition = "start"), test = 1)
amPieChart() %>>% setProperties(list = ls) %>>% setProperties(fontSize = 15)

Run the code above in your browser using DataLab