我正在尝试用plotly
制作一些烛台,我只有一个问题:我不希望底部的滑块显示出来,我只希望显示我的整个图形。
我阅读了一些文档,sliders=list(visible=F))
应该可以做到这一点,但如果您运行以下代码,滑块仍然会出现。任何帮助都将不胜感激。
library(tidyverse)
library(binancer)
library(plotly)
library(TTR)
library(lubridate)
sma <- binance_klines("KAVAUSDT", interval = "3m",
start_time=Sys.time()-hours(10), end_time=Sys.time())%>%
select(open_time, open, high, low, close)%>%
rename(time=1)%>%
mutate(SMA_5= SMA(close, 5), SMA_10= SMA(close,10), SMA_20= SMA(close,20))
sma %>% plot_ly(x = ~time, type="candlestick",
open = ~open, close = ~close,
high = ~high, low = ~low) %>%
add_lines(x = ~time, y= ~SMA_5, line = list(color = "tomato", width = 1.25), inherit = F,
name = "SMA 5", showlegend=T)%>%
add_lines(x = ~time, y= ~SMA_10, line = list(color = "blue", width = 1.25), inherit = F,
name = "SMA 10", showlegend=T)%>%
add_lines(x = ~time, y= ~SMA_20, line = list(color = "deeppink", width = 1.25), inherit = F,
name = "SMA 20", showlegend=T)%>%
layout(title = "KAVA Simple Moving Average 3m",
xaxis= list(title="Time"), yaxis = list(title = "Price"),
sliders=list(visible=F))
发布于 2021-09-26 12:12:44
请参阅此处的参考:https://plotly.com/r/candlestick-charts/使用以下代码更改布局部分:
layout(title = "KAVA Simple Moving Average 3m",
xaxis = list(rangeslider = list(visible = F)),
yaxis = list(title = "Price"))
https://stackoverflow.com/questions/69338215
复制相似问题