initialize-StockPanel: Initialize a StockPanel

initialize,StockPanel-methodR Documentation

Initialize a StockPanel

Description

Use the constructor to create the object or update an existing one with the setters.

Usage

## 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, ...)

Arguments

.Object

StockPanel.

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.

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. 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.

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/.

title

A title of a panel. Note, StockLegend should be added in order title to be displayed.

titles

list of Title. Run api("Title") for more informations.

trendLines

list of TrendLine objects added to the 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.

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

list of AmGraph. Each element must be have been created with stockGraph(*)

stockLegend

list of AmLegend. Each element must be have been created with stockLegend(*)

...

other properties of StockPanel.

valueAxis

A ValueAxis for the property 'drawnOnAxis'.

stockGraph

AmGraph, created with stockGraph(...). Argument for method addStockGraph.

Value

(updated) StockPanel with given properties.

Examples

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)
# ---

DataKnowledge/rAmCharts documentation built on Oct. 3, 2022, 5:42 a.m.