范围滑块标签未显示(标记)
Range Slider Labels are not showing (marks)
data = [[30, 100], [31, 200], [32, 80], [33, 90], [34, 25], [35, 125],[36, 130],[37, 159],
[38, 60]]
df = pd.DataFrame(data, columns = ['week', 'orders'])
html.Div([
html.H3('Week Range'),
dcc.RangeSlider(
id='slider',
min=df["week"].min(),
max=df["week"].max(),
value=[30, 38],
step=None,
marks={int(i):int(i) for i in list(df["week"].unique())}
)])
找了很多都没有找到这个RangeSlider标签为什么不显示,查看附图我们会发现滑块的两端有3和8,我认为这是左边的数字第一周 = 30“3”,最后一周的最后一个数字 = 38“8”
data = [[30, 100], [31, 200], [32, 80], [33, 90], [34, 25], [35, 125],[36, 130],[37, 159],
[38, 60]]
df = pd.DataFrame(data, columns = ['week', 'orders'])
html.Div([
html.H3('Week Range'),
dcc.RangeSlider(
id='slider',
min=df["week"].min(),
max=df["week"].max(),
value=[30, 38],
step=None,
marks={int(i):str(i) for i in list(df["week"].unique())}
)]),html.Br(),
第二个图表 div 刚好在 RangeSlider 下方的问题导致几乎显示标签区域不显示,因此断线将 100% 解决问题
data = [[30, 100], [31, 200], [32, 80], [33, 90], [34, 25], [35, 125],[36, 130],[37, 159],
[38, 60]]
df = pd.DataFrame(data, columns = ['week', 'orders'])
html.Div([
html.H3('Week Range'),
dcc.RangeSlider(
id='slider',
min=df["week"].min(),
max=df["week"].max(),
value=[30, 38],
step=None,
marks={int(i):int(i) for i in list(df["week"].unique())}
)])
找了很多都没有找到这个RangeSlider标签为什么不显示,查看附图我们会发现滑块的两端有3和8,我认为这是左边的数字第一周 = 30“3”,最后一周的最后一个数字 = 38“8”
data = [[30, 100], [31, 200], [32, 80], [33, 90], [34, 25], [35, 125],[36, 130],[37, 159],
[38, 60]]
df = pd.DataFrame(data, columns = ['week', 'orders'])
html.Div([
html.H3('Week Range'),
dcc.RangeSlider(
id='slider',
min=df["week"].min(),
max=df["week"].max(),
value=[30, 38],
step=None,
marks={int(i):str(i) for i in list(df["week"].unique())}
)]),html.Br(),
第二个图表 div 刚好在 RangeSlider 下方的问题导致几乎显示标签区域不显示,因此断线将 100% 解决问题