我有一个显示启用缩放类型'x'的Highcharts图表的网页。图表的div被包装在容器中的div,如:如何在启用缩放功能的情况下使用Highcharts触发模态视图?
<div class='chart-container'>
<div id='chart_0' class='chart'></div>
</div>
还有连接到图表-容器通过切换modalChart CSS交换机的图表模态的视图的“鼠标松开”事件的事件处理程序类定义为:
.modalChart {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.7);
z-index: 999999;
}
.chart {
height: 300px;
}
.modalChart .chart {
height: 90%;
width: 90%;
max-width: none;
margin: 1em auto;
}
的事件处理函数被定义为:
$("body").on("mouseup", ".chart-container", function(){
$(this).toggleClass "modalChart"
$(".chart", this).highcharts().reflow()
});
时遇到的问题是,setExtreme之前的“图表容器”火灾MouseUp事件当变焦正在发生时,事件在x轴上发生。因此,每次用户使用缩放功能时,都会切换模式视图。我如何阻止这种情况发生?我希望用户能够在不切换模态视图的情况下进行缩放,并且能够点击图表来切换模态视图。
我还必须将clearTimeout功能添加到plotOptions中不同图表类型的legendItemClick事件。 – ProfNimrod 2014-10-28 15:22:36