Created
June 29, 2020 06:39
-
-
Save JohnCoene/c0b57c2b2b99babcb6b3105b75371e7f to your computer and use it in GitHub Desktop.
Candlestick color
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(echarts4r) | |
library(quantmod) | |
getSymbols("GS") #Goldman Sachs | |
GS <- as.data.frame(GS) | |
GS$date <- row.names(GS) | |
# https://echarts.apache.org/en/option.html#series-candlestick.itemStyle.color | |
GS %>% | |
e_charts(date) %>% | |
e_candle( | |
GS.Open, GS.Close, GS.Low, GS.High, | |
name = "Goldman Sachs", | |
itemStyle = list( | |
color = "blue", # bull | |
color0 = "black", # bear | |
borderColor = "blue", | |
borderColor0 = "black" | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment