但是,我不希望以随机间隔显示可见的刻度线(45,001,90,001等)。很简单,它看起来很丑陋。如何更改我的代码,使其标记为1,50k,100k,150k ... 400k,428,036?
这是我目前的代码:
<select id="mySelect">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
</select>
<select id="mySelect2">
<option value="Option 1">Option 1</option>
<option value="Option 2">Option 2</option>
<option value="Option 3">Option 3</option>
</select>
<input type="text" id="myInput" />
<input type="text" id="myInput2" />
我认为 sliderInput(inputId = "CR_num",
label = "Please choose how many case reports you would like our tool to analyze.",
value = "20000",
step = 5000,
min = 1,
max = 428036)
参数只允许用户从该间隔的比例中选择值...它不会更改标签。
感谢。
答案 0 :(得分:1)
我可以使用shinyWidgets库来完成。基本上,创建所需步长值的列表并调用sliderTextInput()函数。
numlist <- prettyNum(c(1, seq(5000, (floor(428036/5000)*5000), 5000), 428036), big.mark = ",")
slider <- sliderTextInput(
inputId = "CR_num",
label = "Please choose how many case reports you would like our tool to analyze.",
choices = numlist,
selected ="20,000",
grid = FALSE, dragRange = FALSE)
现在唯一的选择是您选择的选项:
现在唯一的打嗝是值是字符串,因此有很多刻度线。 所以,我删除了它们。