[英]How to remove plotly.js x-axis tick label / button?
I don't know how it's called, maybe that's the reason why I didn't find anything in the plotly.js reference. 我不知道它怎么称呼,也许这就是为什么我在plotly.js参考中找不到任何内容的原因。 The label / button overlaps the regular x-axis labels and as seen in the screenshot is even cut off because it's not supposed to be there.
标签/按钮与常规的x轴标签重叠,并且如屏幕快照所示,由于不应该存在,因此甚至被截断了。
You are probably looking for hoverinfo
. 您可能正在寻找
hoverinfo
。
Any combination of "
x
", "y
", "z
", "text
", "name
" joined with a "+
" > OR "all
" or "none
" or "skip
".“
x
”,“y
”,“z
”,“text
”,“name
”的任意组合与“+
”>或“all
”或“none
”或“skip
”结合在一起。examples: "
x
", "y
", "x+y
", "x+y+z
", "all
"示例:“
x
”,“y
”,“x+y
”,“x+y+z
”,“all
”default: "
all
"默认值:“
all
”Determines which trace information appear on hover.
确定在悬停时显示哪些跟踪信息。 If
none
orskip
are set, no information is displayed upon hovering.如果
none
设置或skip
,则悬停时不显示任何信息。 But, ifnone
is set, click and hover events are still fired.但是,如果
none
设置,单击和悬停事件仍然被解雇。
Setting it to none
or y
in your case should solve the problem. 在您的情况下将其设置为
none
或y
应该可以解决问题。
var data = [{ type: 'bar', x: ['giraffes', 'orangutans', 'monkeys'], y: [20, 14, 23], hoverinfo: 'y' }]; Plotly.newPlot(document.getElementById("mydiv"), data);
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> <div id="mydiv"></div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.