Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Candlestick plot with RangeSlider trouble in R

I have an interactive candlestick chart with buy/sell signals on the chart for the respective buy/sell days.

I have an OHLC candlestick chart in r built with the help of the following blog post.
Here is a link to the blog: http://moderndata.plot.ly/candlestick-charts-using-plotly-and-quantmod/

Now when I add a rangeslider to my X axis I have two problems:

  1. The range slider does not show up below the X axis but when I point on the chart then I am able to click and select a range.
    I want the rangeslider to be separately visible at the bottom as is shown in the example in the link:
    https://plot.ly/r/range-sliders-selectors/

  2. When I select the range using the rangeslider then I want the y axis scale to auto adjust to the new range otherwise my candlestick for a range looks really tiny (almost invisible at times). Is this possible in Plotly?

Hi there,

  1. You’ll have to make sure to include: rangeslider = list(type = “date”) in addition to the rangeselector attribute as demonstrated in that example. I can take a look at your example if you can provide the code to see if I can locate the problem.
  2. Autoscaling of the y-axis based on the the range slider isn’t available at the moment.

I am including the rangeslider code but I do not get a slider separately below my candlestick, instead it is appears to be on top of the candlestick when I click on it. Also the box select does not function any more.
The code is lengthy and shows up messy.