amOHLC: Plotting OHLC chart

Description Usage Arguments References See Also Examples

View source: R/chart_amOHLC.R

Description

amOHLC computes an OHLC chart of the given value.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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", ""),
  ...
)

Arguments

data

data.frame, dataframe with at least 5 columns : category, open (numeric), close (numeric), low (numeric), high (numeric).

xlab

character, label for x-axis.

ylab

character, label for y-axis.

horiz

logical, TRUE for an horizontal chart, FALSE for a vertical one

zoom

logical, default set to TRUE : a cursor is added to the chart.

positiveColor

character, color for positive values (in hexadecimal).

negativeColor

character, color for negative values (in hexadecimal).

names

character, names for the tooltip. Default to c("low", "open", "close", "high").

dataDateFormat

character, default set to NULL. Even if your chart parses dates, you can pass them as strings in your dataframe - all you need to do is to set data date format and the chart will parse dates to date objects. Check this page for available formats. Please note that two-digit years (YY) as well as literal month names (MMM) are NOT supported in this setting.

minPeriod

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

References

See online documentation https://datastorm-open.github.io/introduction_ramcharts/ and amChartsAPI

See Also

amOptions, amBarplot, amBoxplot, amHist, amPie, amPlot, amTimeSeries, amStockMultiSet, amBullet, amRadar, amWind, amFunnel, amAngularGauge, amSolidGauge, amMekko, amCandlestick, amFloatingBar, amOHLC, amWaterfall

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data("data_candleStick2")
amOHLC(data = data_candleStick2)


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

# Rotate the labels for x axis
amOHLC(data = data_candleStick2, labelRotation = 90)

# Change names
amOHLC(data = data_candleStick2, names = c("min", "begin", "end", "max")) 

# Use amOptions
amOHLC(data = data_candleStick2, zoom = FALSE)
}

rAmCharts documentation built on Dec. 6, 2019, 5:11 p.m.

Related to amOHLC in rAmCharts...