如何在 R 中隐藏滑块?
How to hide slider from plotly in R?
我正在尝试用 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))
在此处查看参考资料:https://plotly.com/r/candlestick-charts/
使用此代码更改布局部分:
layout(title = "KAVA Simple Moving Average 3m",
xaxis = list(rangeslider = list(visible = F)),
yaxis = list(title = "Price"))
我正在尝试用 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))
在此处查看参考资料:https://plotly.com/r/candlestick-charts/ 使用此代码更改布局部分:
layout(title = "KAVA Simple Moving Average 3m",
xaxis = list(rangeslider = list(visible = F)),
yaxis = list(title = "Price"))