Highchart点击图形绑定事件
点击highchart H1柱型绑定事件,显示其他的highchart H2图形,但是想要隐藏H2图形是一个问题,于是我仿照网上的逻辑进行修改,代码如下:
<script type="text/javascript">
var onclickDelect = true;
$('#ShowTeamChart').highcharts({
series: {
cursor: 'pointer',
events: {
click: function (event) {
TeamName = event.point.category;
if (this.name == "onGoing" || this.name == "Tracking" || this.name == "Closed"{
if (onclick == true) {
$.ajax({
type: "Post",
url:跳转action 路径,
data: {传参},
dataType: 'json',
success: function (data) {
if (data.length != 0) {
document.getElementById("TeamQuestionPie").style.display = "block";
};
if (data.ClsIssue.length != 0) {
document.getElementById("TeamIssuePie").style.display = "block";
};
},
error: function (XMLHttpRequest, textStatus, errorThrown) { alert(errorThrown); }
})
onclickDelect= false;
}
else {
document.getElementById("TeamQuestionPie").style.display = "none";
document.getElementById("TeamIssuePie").style.display = "none";
onclickDelect= true;
}
}
..........
</script >
<div id="TeamQuestionPie" style="float: left; width: 45%; height: 35%; font-family:'Microsoft YaHei UI'; display: none; margin: 0px,0px,0px,0px;"></div>
<div id="TeamIssuePie" style="float: left; width: 45%; height: 35%; font-family: 'Microsoft YaHei UI'; display: none; margin: 0px,0px,0px,0px;"></div>
思维导图: