Black Lives Matter. Please consider donating to Black Girls Code today.

Disable default Graph RangeSelector

So I have been trying to figure out if there is a way implemented to remove the default “RangeSlider” that appears under a default OHLC graph. I can’t seem to find any documentation about it.

I have the area highlighted in the reference image that i’m looking to edit or remove.

#Configure the layout
app.layout = html.Div(
    style = {
        'backgroundColor' : colors['background']
    },
    children = [
        dcc.Graph(
            id = 'cool_graph',
            style = {
                'height' : '98vh'
            },
            figure = {
                'data' : [
                    {
                        'x' : date,
                        'open' : open,
                        'high' : high,
                        'low' : low,
                        'close' : close,
                        'type' : 'ohlc',
                        'name' : 'Bar'
                    }
                ],
               'layout' : {
                    'title' : 'Crude Oil',
                    'rangeslider' : False,
                    'plot_bgcolor' : colors['background'],
                    'paper_bgcolor' : colors['background'],
                    'font' : {
                        'color' : colors['text']
                    }
                }
            },
            config = {
                'displayModeBar': False,
                'scrollZoom': True
            }
        )
    ]
)

Here is a simple example of what i’m working with.

The only way I can think of is to add it under the layout section but that don’t seem to work.

Example:

'layout' : {
                'title' : 'Some Title',
                'rangeslider' : {
                    'visible' : False
                },
}

See the OHLC examples here: https://plot.ly/python/ohlc-charts/#ohlc-chart-without-rangeslider. It needs to be

'layout': {
    'xaxis': {'rangeslider': {'visible': False}
}

Thanks, I got it to work.