# Rangeslider in xaxis label not working

**URL:** https://community.plotly.com/t/rangeslider-in-xaxis-label-not-working/26360
**Category:** Dash Python
**Created:** [July 25, 2019, 7:34am UTC](https://community.plotly.com/t/rangeslider-in-xaxis-label-not-working/26360 "2019-07-25T07:34:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![babbarsome](https://avatars.discourse-cdn.com/v4/letter/b/ea5d25/32.png) [@babbarsome](https://community.plotly.com/u/babbarsome)
#### Post date: [July 25, 2019, 7:34am UTC](https://community.plotly.com/t/rangeslider-in-xaxis-label-not-working/26360/1 "2019-07-25T07:34:07Z")

</div>

I have the following code snippet which is part of a function which is called on callback to update a graph plot :

```
layout = go.Layout(
                #title='X Weekly ',
                showlegend=True,
                barmode = 'stack',
                boxmode = 'overlay',
                legend=dict(x=1.1, y=0,orientation="v"),
                xaxis={
                    'title':'Time Period : ' + radioTimeCLLNPS,
                    'rangeslider': {'visible': True}, 
                    'type': 'date'
                },
                
                yaxis={'title': dropDownCLLLine + ' CLL',
                        "tickformat" : '.0%',
                        'range' : [0,1]
                },
                
                margin=go.layout.Margin(l=90, r=0, t=20, b=20)
            )    

```

Now I wanted to also add a callback with the time selection based on the the range selected as [Here](https://community.plotly.com/t/the-range-slider-is-not-working-with-graph/9027) so I tried to add an id to the rangeslider like this :

```
layout = go.Layout(
                #title='VENCLEXTA Weekly NPS(SP+SD) ',
                showlegend=True,
                barmode = 'stack',
                boxmode = 'overlay',
                legend=dict(x=1.1, y=0,orientation="v"),
                xaxis={
                    'title':'Time Period : ' + radioTimeCLLNPS,
                    'rangeslider': {'id':'Claims_RangeSlider', 'visible': True}, 
                    'type': 'date'
                },
                
                yaxis={'title': dropDownCLLLine + ' CLL NPS',
                        "tickformat" : '.0%',
                        'range' : [0,1]
                },
                
                margin=go.layout.Margin(l=90, r=0, t=20, b=20)
            )

```

but unfortunately after doing this, my graph doesn’t get updated with the figure at all even though there is no exception. Is there any issue with how I’m defining my id?

---

<div class="post-metadata">

### Author: ![Snizl](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Snizl](https://community.plotly.com/u/Snizl)
#### Post date: [July 25, 2019, 10:36am UTC](https://community.plotly.com/t/rangeslider-in-xaxis-label-not-working/26360/2 "2019-07-25T10:36:50Z")

</div>

If I understand correctly you are defining the range slider within the layout of your graph?  
I am not sure if that is possible, but how I made it working is to define the range slider in the layout of the app,  
get a callback like  
return dcc.Slider(  
id=‘Claims\_RangeSlider’,  
min=0,  
max=10,  
step=1,  
value=0,  
marks={0:‘0’,  
5:‘5’,  
10:‘10’})  
Then I have a callback with [Input(‘Claims\_RangeSlider’, ‘value’)], which is then used in the function to filter the data, which is then used as the input of the plot function

I am not sure if this is exactly the same thing as you want to do, but that should make the slider work.
