使用正在创建一些饼图和圆环图MorrisJS
像这一切都很好,但我想有一个模式弹出,当我在图表中单击线段。
习惯以这种方式进行模态
<!-- Link to shw Modal -->
<a href="#modal-id" class="btn btn-success" data-toggle="modal" > Click to show modal</a>
<!-- Modal -->
<div class="modal fade" id="modal-id" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
...
</div>
现在,在此莫里斯饼图中,我没有ID
要素,因此我无法实现模态。有办法吗?
将此点击事件处理程序添加到Donut或饼图的末尾
Charts.Donut({
element: _element,
data: _data,
colors: _colors,
}).on('click', function (i, row) {
$('#id_modal').modal({ show: true });
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句