Skip to content

Chart lines colors/width/style and/or title/subtitle customization #19

Answered by serkor1
andreltr asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @andreltr,

The chart()-function and family is rather high-level and restricted in customization. However, some elements of the chart can be modified in its color. Below is an example for the bollinger_bands()-function,

library(cryptoQuotes)
# get BTCUSDT
# pair
BTC <- get_quote(
  ticker = "BTCUSDT",
  source = "bybit"
)
# chart with bollinger bands
# in red
chart(
  ticker = BTC,
  main   = kline(),
  sub    = list(
    volume()
  ),
  indicator = list(
    bollinger_bands(
      color = "red"
    )
  )
)

Hacking the chart()-function

The rendered chart is from {plotly}, and can be modified using the layout()-function. Below is an example where the title is changed and a subtitle is c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andreltr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request question Further information is requested
2 participants