
我如何隐藏图表上的日期?
<div class="highcharts-container" id="highcharts-6">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1330" height="532"><desc>Created with Highstock 1.3.7</desc><defs><clipPath id="highcharts-7"><rect fill="none" x="0" y="0" width="1239" height="290"></rect></clipPath></defs>
<path fill="none" d="M 71 45 L 71 335 180 335 180 45" zIndex="5"></path>
<text x="126" y="29" transform="translate(0,0)" visibility="visible">
<tspan x="126">7/9/15</tspan></text></svg></div>发布于 2015-09-01 16:17:41
如果只有一个,那么这段代码应该可以工作:
document.querySelector("tspan").style.display = "none";如果有多个,那么:
[].forEach.call(document.querySelectorAll("tspan"), function(item) {
item.style.display = "none";
});或者如果您想使用jQuery:
$("tspan").hide();https://stackoverflow.com/questions/32336063
复制相似问题