Learn R Programming

rAmCharts (version 2.0.2)

initialize,AmGraph-method: Initializes an AmGraph

Description

To create an AmGraph, you can use the usual methode Initialize or the constructor. You can update properties with setters.

Usage

"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)
"setBalloonText"(.Object, balloonText)
"setTitle"(.Object, title)
"setType"(.Object, type)
setValueField(.Object, valueField)
"setValueField"(.Object, valueField)

Arguments

.Object
AmGraph.
animationPlayed
logical.
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.
...
other properties of AmGraph. See http://docs.amcharts.com/3/javascriptcharts/AmGraph.

Value

An object of class AmGraph with the given properties.

Examples

Run this code
# --- method 'initialize'
new("AmGraph", valueField = "value")

# constructor
amGraph(balloonText = "balloonText", "type" = "column",
        valueField = "value", animationPlayed = TRUE)
# --- 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")

Run the code above in your browser using DataLab