I want to create a date range slider , which will help me to select any interval between min and max values from my data.
################################
import dash
import dash_html_components as html
import dash_core_components as dcc
import pandas as pd
external_stylesheets = [‘https://codepen.io/chriddyp/pen/bWLwgP.css’]
df= pd.read_excel(‘Sample MallPeopleCount.xlsx’)
app = dash.Dash(name, external_stylesheets=external_stylesheets)
app.layout = html.Div([
dcc.RangeSlider(
id=‘my-range-slider’,
min=df['Date'].min(),
max=df['Date'].max(),
step=None,
value=[df['Date'].min()+5, df['Date'].max()-5]
),
html.Div(id='output-container-range-slider')
])
@app.callback(
dash.dependencies.Output(‘output-container-range-slider’, ‘children’),
[dash.dependencies.Input(‘my-range-slider’, ‘value’)])
def update_output(value):
return ‘You have selected “{}”’.format(value)
if name == ‘main’:
app.run_server()
###########################
step=None,
** value=[df[‘Date’].min()+5, df[‘Date’].max()-5]**
How to assign step and default value as min+5 next days , max- 5 previous days.
ValueError: Cannot add integral value to Timestamp without freq.